Commit 3474ae3
refactor: decouple file_search from legacy knowledge_search tool_groups (#5175)
## Summary
Decouples the Responses API's `file_search` tool from the legacy
`knowledge_search` tool_groups infrastructure.
**Before**: When a user passed `{"type": "file_search"}`, the code
looked up `knowledge_search` from the `builtin::rag` tool group registry
and presented it to the LLM under that name. This required
`builtin::rag` to be registered at startup and showed `knowledge_search`
in tracing spans.
**After**: The Responses API creates an inline tool definition with the
name `file_search` — matching the OpenAI convention. No dependency on
`builtin::rag` for the Responses API path. Backward compatibility
preserved: `knowledge_search` still works if used directly.
### Changes
**`streaming.py`**:
- `file_search` tool type now creates an inline
`ChatCompletionToolParam` with name `"file_search"` instead of looking
up `knowledge_search` from tool_groups
- Added `"file_search"` to `_SERVER_SIDE_BUILTIN_TOOL_NAMES`
- Output item events match both `"knowledge_search"` and `"file_search"`
**`tool_executor.py`**:
- All 6 places that checked `== "knowledge_search"` now use `in
("knowledge_search", "file_search")`
- Tracer span uses `function_name` dynamically instead of hardcoded
`"knowledge_search"`
**Recordings**: 44 new recordings for file_search tests with the updated
tool name.
### Why
- Removes unnecessary coupling to `builtin::rag` tool group registration
- LLM now sees `file_search` (matching OpenAI convention) instead of the
non-standard `knowledge_search`
- Tracing spans correctly show `file_search`
- Related to #3901 (closed without merge — this is a more surgical
approach)
## Test Plan
- All 144 unit tests in `tests/unit/providers/agents/builtin/` pass
- Integration test recordings re-generated against OpenAI
---------
Signed-off-by: Sébastien Han <seb@redhat.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>1 parent e516ada commit 3474ae3
File tree
91 files changed
+102671
-13
lines changed- src/llama_stack/providers/inline/agents/builtin/responses
- tests/integration/responses/recordings
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
91 files changed
+102671
-13
lines changedLines changed: 18 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
1299 | 1299 | | |
1300 | 1300 | | |
1301 | 1301 | | |
1302 | | - | |
| 1302 | + | |
1303 | 1303 | | |
1304 | 1304 | | |
1305 | 1305 | | |
| |||
1417 | 1417 | | |
1418 | 1418 | | |
1419 | 1419 | | |
1420 | | - | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
1425 | 1436 | | |
1426 | 1437 | | |
1427 | 1438 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| |||
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
302 | | - | |
| 302 | + | |
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
| 346 | + | |
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
468 | | - | |
| 468 | + | |
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
| |||
0 commit comments