Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
core/src/tools/spec.rsstill bundled a set of pure local-host tool builders with the orchestration that actually decides when those tools are exposed and which handlers back them. That madecodex-coreresponsible for JSON/tool-shape construction that does not depend on session state, and it kept thecodex-toolsmigration from taking a meaningfully larger bite out ofspec.rs.This PR moves that reusable spec-building layer into
codex-toolswhile leaving feature gating, handler registration, and runtime-coupled descriptions incodex-core.What changed
codex-rs/tools/src/local_tool.rsfor the pure builders forexec_command,write_stdin,shell,shell_command, andrequest_permissionscodex-rs/tools/src/view_image.rsfor theview_imagetool spec and output schema so the extracted modules stay right-sizedcodex-rs/core/src/tools/spec.rsto call those extracted builders instead of constructing these specs inlinerequest_permissionsdescription source incodex-core, withcodex-toolstaking the description as input so the crate boundary does not grow a dependency on handler/runtime codecodex-rs/core/src/tools/spec_tests.rsintocodex-rs/tools/src/local_tool_tests.rsandcodex-rs/tools/src/view_image_tests.rscodex-rs/tools/README.mdto reflect thatcodex-toolsnow owns this local-host spec layerTest plan
CARGO_TARGET_DIR=/tmp/codex-tools-local-host cargo test -p codex-toolsCARGO_TARGET_DIR=/tmp/codex-core-local-tools cargo test -p codex-core --lib tools::spec::just argument-comment-lintReferences