Project write and git workspace tools for coding agents#606
Merged
Conversation
AbilityToolProjections only exposed read-only workspace tools (workspace_ls/read/grep/etc.) as model-facing tools, so agents in sandbox and chat runs could never receive file-mutating tools — the model had no write tool to call and would either fail or fabricate edits. Project the mutating workspace tools (workspace_write, workspace_edit, workspace_apply_patch, workspace_delete, and the git add/commit/push and worktree/PR tools), each gated behind requires_opt_in so a read-only task never receives file-mutating tools by default. They surface only when named via allow_only or an allow-mode tool policy. Extends the projection smoke test to assert the write tools project with requires_opt_in set.
Contributor
Homeboy Results —
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
AbilityToolProjections::projected_tools()only exposed read-only workspace tools (workspace_ls,workspace_read,workspace_grep, etc.) as model-facing Data Machine tools. The mutating workspace abilities exist and are registered (datamachine-code/workspace-write,-edit,-apply-patch,-delete, the gitadd/commit/push/etc., worktree, and PR abilities) but were never projected — so a coding agent in sandbox/chat runs never received a write tool. The model had nothing to call and would either fail or fabricate the edit.This projects the mutating workspace tools, each gated behind
requires_opt_inso a read-only task never receives file-mutating tools by default. They surface only when explicitly named viaallow_onlyor an allow-mode tool policy.Why this matters
This is the final runtime gap that prevented WP Codebox coding agents from actually editing files. End-to-end trace:
AbilityToolSource→datamachine_ability_tool_projectionsonly listed read tools, soToolPolicyResolvergathered no write tools and the model was sent none.Changes
workspace_write,workspace_edit,workspace_apply_patch,workspace_delete,workspace_git_status/log/diff/pull/add/commit/push/rebase/reset,workspace_worktree_add,workspace_pr_status/rebasetoprojected_tools().workspace_write()declaration helper setsrequires_opt_in => true.tests/smoke-ability-tool-projections.phpto assert the write tools project withrequires_opt_in.Testing
php -l inc/Tools/AbilityToolProjections.phpphp tests/smoke-ability-tool-projections.php— all new write-tool projection assertions pass (workspace_write/edit/apply_patch/delete/git_add/git_commit/git_push ... requires opt-in).wp_json_encode()fatal when run standalone against a sibling data-machine checkout; this is unrelated to this change and reproduces on cleanmain.AI assistance