🕯️ feat: Search Text in Attached Workspaces - #15525
Conversation
915f543 to
dccd77e
Compare
dccd77e to
3e362aa
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The new search_workspace handler can emit an unboundedly large tool response string, risking downstream tool-output/message limits without local truncation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a new read-only search_workspace tool for attached BYOM code environments, routing literal text searches through the authenticated Code API workspace-tools endpoint and validating/guarding worker responses before exposing results to the model.
Changes:
- Register
search_workspacealongside attached-workspaceread_file, including historical tool-name retention and code-session awareness. - Add handler plumbing to execute workspace searches via the existing Code API client, with input validation, result-shape validation, and file/filename filtering per match.
- Add focused Jest coverage across the workspace HTTP client, tool registration, handler execution, and server-side Code process wiring.
File summaries
| File | Description |
|---|---|
| packages/api/src/code/workspace.spec.ts | Adds a regression test ensuring bounded/validated search match shapes are rejected before exposure. |
| packages/api/src/agents/tools.ts | Defines search_workspace tool schema and registers it only when attached-workspace tools are enabled. |
| packages/api/src/agents/tools.spec.ts | Extends tool-registration tests to cover search_workspace and historical tool-name inclusion. |
| packages/api/src/agents/handlers.ts | Implements search_workspace tool-call handling, environment gating, filtering, and error suppression. |
| packages/api/src/agents/handlers.spec.ts | Adds handler tests for attached search routing, gating, and per-match filtering behavior. |
| api/server/services/Files/Code/process.spec.js | Adds coverage for forwarding authenticated search requests through the Code process layer. |
| api/server/services/Files/Code/process.js | Implements searchWorkspace forwarding to executeWorkspaceTool with proper headers and request mapping. |
| api/server/services/Endpoints/agents/skillDeps.spec.js | Verifies searchWorkspace is exposed on agent handler deps. |
| api/server/services/Endpoints/agents/skillDeps.js | Wires searchWorkspace into stable skill tool dependencies for agent handlers. |
Review details
- Files reviewed: 9/9 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
3e362aa to
8cada1f
Compare
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b63af9b13
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
5690f9f to
3aa40db
Compare
Summary
I added a first-class, read-only
search_workspacetool for attached BYOM environments. This PR is stacked on #15524 and uses thesearch_textoperation provided by LibreChat-AI/code-interpreter#90.search_workspaceonly when the selected code environment is attached.Change Type
Testing
@librechat/agentsinstall still reports unrelatedRuntimeProviderNameerrors in memory tests.notes.txt:2:23for a literal search.Test Configuration:
http://127.0.0.1:23116/v1127.0.0.1:26384.gitmetadataChecklist