Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8e7b90b94b
ℹ️ 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".
| let tool_search_handler = app_tools | ||
| .as_ref() | ||
| .map(|app_tools| Arc::new(ToolSearchHandler::new(app_tools.clone()))); |
There was a problem hiding this comment.
Avoid cloning app tools when tool search is disabled
This eagerly clones the full app_tools map even when config.search_tool is false, but in that configuration no ToolSearch handler is registered from the plan. That introduces avoidable O(n) allocations on every registry build for app-enabled sessions (a regression from the previous branch-local clone), which can add unnecessary latency as the number of app tools grows. Build this handler lazily only when a ToolSearch registration is actually needed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
@codex I believe this is fixed in the latest version of the PR: can you confirm?
There was a problem hiding this comment.
Codex Review: Didn't find any major issues. 🚀
ℹ️ 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".
Why
This is a larger step in the
codex-core->codex-toolsmigration called out inAGENTS.md.codex-rs/core/src/tools/spec.rshad become mostly pure tool-spec assembly plus handler registration. That made it hard to move more of the tool-definition layer intocodex-tools, because the runtime binding and the crate-independent planning logic were still interleaved in one function.Splitting those concerns gives
codex-toolsownership of the declarative registry plan while keepingcodex-coreresponsible for instantiating concrete handlers.What Changed
codex-toolsregistry-plan layer incodex-rs/tools/src/tool_registry_plan.rsandcodex-rs/tools/src/tool_registry_plan_types.rs.codex-tools.codex-rs/core/src/tools/spec.rsas the core-side adapter that maps each planned handler kind to concrete runtime handler instances.spec_tests.rsto import the movedcodex_toolssymbols directly instead of relying on top-levelspec.rsre-exports.This is intended to be a straight refactor with no behavior change and no new test surface.
Verification
cargo test -p codex-toolscargo test -p codex-core tools::spec::testsStack created with Sapling. Best reviewed with ReviewStack.