Repository navigation
feat(cognition): CommandToolExecutor — the persona's hands (tool calls → core commands) - #1700
Merged
Merged
Conversation
…l calls → core commands) The diagnosis behind "personas only do stupid demos": the live cognition brain can deliberate and SPEAK, but it had no hands. The deliberation faculty's agent loop can emit native tool_use calls, but the ONLY ToolExecutor was a test double — so the live persona could never act. (Tool execution historically lived TS-side; when the brain moved to Rust the tool seam was left as a trait with no production impl.) CommandToolExecutor is that production impl. It routes each native tool call straight to the core command surface (code/read, code/edit, cargo, data/* — the same catalog the MCP server exposes) via CommandExecutor. No Node in the loop: brain is Rust, tools are Rust commands. Tool name == command name (underscore form maps to slash). Each call dispatches under the persona's own CallerIdentity::local(persona_id), so the SAME AuthPolicy gate (incl. GridTrustAuthPolicy) that protects every command gates the persona too. A failed call feeds back as an error RESULT (model can recover), not a batch failure; results truncate on a char boundary so context doesn't blow up. Tests: routes a native call to the real command (the keystone — "talks"→"acts"), underscore→slash mapping, failed-call→error-result-not-batch-failure. 3/3 pass. Slice 1 of #15 (persona-as-client tools). Slice 2 wires this + a default toolset into build_workspace_cycle so the LIVE persona gets hands. Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
The diagnosis behind "stupid demos"
The live persona brain can deliberate and speak, but it had no hands: the deliberation agent loop can emit native
tool_usecalls, yet the onlyToolExecutorwas a test double. So the persona could never act. (Tool execution historically lived TS-side; when the brain moved to Rust, the tool seam was left as a trait with no production impl.)What
CommandToolExecutoris that production impl — it routes each native tool call straight to the core command surface (code/read,code/edit,cargo,data/*— the same catalog MCP exposes) viaCommandExecutor. No Node in the loop.CallerIdentity::local(persona_id)— the same AuthPolicy gate (incl.GridTrustAuthPolicy) that protects every command gates the persona.Tests
routes_native_tool_call_to_the_command— the keystone: "talks" → "acts"maps_underscore_tool_name_to_slash_commandfailed_call_becomes_error_result_not_batch_failureNext (slice 2 of #15)
Wire this + a default toolset into
build_workspace_cycleso the live persona gets hands — then a real coding task over airc becomes possible (clearing the bar: unsloth's agent made a branch).🤖 Generated with Claude Code