Make agent tool handling schema-driven and recoverable #72
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Make DS4Server tool use reliable for local coding models through Rust-native executable schemas, precise failure feedback, and targeted loop recovery. Tool metadata must have one source of truth shared by prompt rendering and runtime validation.
Plan
list.pathand job-versus-pid lookup.Boundaries
Acceptance criteria
cargo fmt --all -- --check, Clippy with-D warnings,make bundle, andcargo test --all-featurespass.Implemented in
f12aafc. Tool names, descriptions, parameter kinds/bounds/enums/cross-field rules, schema generation, and execution dispatch now share one Rust ToolSpec catalog, including the Dev Brain tools. Runtime validation runs before approval or execution, rejects undeclared/missing/wrong/quoted/out-of-range arguments without coercion, and returns stable tool/code/field/expected/received failures. list.path is optional and bash_status/bash_stop accept either job or pid. DeepSeek DSML and GLM adapters preserve declared integer/boolean primitives, malformed transport and unknown/denied/execution/timeout outcomes remain distinct, recovery guidance lives with each tool, and per-session canonical repeat notices fire at 3/5/8 and reset on direct user input. Added isolated coverage for schema/runtime agreement, no-side-effect invalid writes followed by a successful correction, parser typing and malformed syntax, every validation class, policy denial, real execution errors/timeouts, and canonical repeat/reset behavior. Verification: cargo fmt --all -- --check; cargo clippy --all-targets --all-features -- -D warnings; make bundle; cargo test --all-features (176 passed, 14 hardware/browser fixtures ignored).