Commit 25b67a3
[MISC] Remove broken is_default fallback in get_adapter_by_name_and_type (#1998)
* [FIX] Remove broken is_default fallback in get_adapter_by_name_and_type
`AdapterInstance` has no `is_default` field — never defined in any migration.
The dead `else: is_default=True` branch in `get_adapter_by_name_and_type`
raises Django `FieldError` whenever entered, surfacing as HTTP 500 on the
tool_instance PATCH path (seen via the customer org-clone script).
The path is reached from `update_metadata_with_adapter_properties` when an
adapter slot is present in metadata but its value is empty/None (e.g. an
unbound x2text_adapter on a text_extractor tool). Two-part fix:
- `adapter_processor.py`: drop the unreachable-as-feature else; require
`adapter_name` and raise `AdapterNotFound` if missing. Default-adapter
semantics live in `UserDefaultAdapter` / `get_default_adapters`, not here.
- `tool_instance_helper.py`: short-circuit on empty/None `adapter_value`
in `update_metadata_with_adapter_properties` — nothing to resolve.
All 3 in-tree callers already pass a truthy `adapter_name` (or now skip
beforehand), so no behavior change for valid inputs.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* [MISC] Drop redundant comment on empty-adapter-value skip
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 26624d0 commit 25b67a3
2 files changed
Lines changed: 13 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
273 | 278 | | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | | - | |
285 | | - | |
286 | | - | |
| 284 | + | |
| 285 | + | |
287 | 286 | | |
288 | 287 | | |
289 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
0 commit comments