feat(agent): M5+M6 — coding tools, run command, binary e2e#8
Merged
Conversation
Replicates pi's coding-agent tool set in Rust and wires the one-shot `run` command, verified by driving the real binary end to end. Tools (crates/agent/src/tools/), each an agent_core::Tool: - read (line-numbered, offset/limit), write (creates parents), edit (pi-style `edits[]` array OR single old/new, unique-match), ls. - bash via a CommandRunner seam (RealRunner; mock runner asserts argv) with timeout + output truncation. The seam is reused by the Beyond tools (M8). - grep + find: gitignore-aware, built on ripgrep's own crates (ignore, regex, globset) rather than shelling out to rg/fd. - default_registry() = the 7-tool set the agent advertises. CLI: `beyond-ai-agent run "<task>"` builds a GatewayClient + Agent over the tool set, streams assistant text + tool activity to stdout. Config via flags or AI_GATEWAY_URL / AI_AGENT_KEY / AI_AGENT_MODEL. Proven: 21 agent unit tests + a binary e2e (tests/run_e2e.rs) that runs the actual `beyond-ai-agent run` against a mock model server scripting a two-turn tool round-trip, and asserts the file contents were fed back to the model on the 2nd request. No gateway/provider/network beyond loopback. New deps (all latest): ignore 0.4, regex 1, globset 0.4, tempfile 3 (dev). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 30, 2026
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.
What — M5 (binary e2e) + M6 (tools + run)
Replicates pi's coding-agent tool set in Rust and wires the one-shot
runcommand, verified by driving the real binary end to end. (Tool/rpc semantics cross-checked against a local clone ofbadlogic/pi-mono.)Tools (
crates/agent/src/tools/) — each anagent_core::Tooloffset/limit), write (creates parent dirs), edit (pi-styleedits[]array or singleold_string/new_string, exact unique-match), ls (dirs-first).CommandRunnerseam —RealRunnerexecutes; a mock runner asserts the argv. Timeout + head/tail output truncation. This seam is what the Beyondfork/sync/logstools (M8) will reuse for argv-assertable tests.ignore,regex,globset) — not shelling out torg/fd.default_registry()= the 7-tool set (read, write, edit, bash, ls, grep, find).CLI
beyond-ai-agent run "<task>"builds aGatewayClient+Agentover the tools and streams assistant text +[tool: …]activity to stdout. Config via flags orAI_GATEWAY_URL/AI_AGENT_KEY/AI_AGENT_MODEL.Proven by
tests/run_e2e.rs): runs the actualbeyond-ai-agent runbinary against a mock model server scripting a two-turn tool round-trip, asserts it performed thereadcall and fed the file contents back to the model on the 2nd request. No gateway/provider/network beyond loopback.New deps, all latest:
ignore0.4.26,regex1.12,globset0.4.18,tempfile3 (dev).Series: M1 #5, M2 #6, M3+M4 #7 merged. Next: M7 headless
serve(pi rpc / opencode-ACP-shaped control protocol), then M8 Beyond tools + full gateway e2e.🤖 Generated with Claude Code