Skip to content

feat(agent): M5+M6 — coding tools, run command, binary e2e#8

Merged
jaredLunde merged 1 commit into
mainfrom
agent-tools
Jun 30, 2026
Merged

feat(agent): M5+M6 — coding tools, run command, binary e2e#8
jaredLunde merged 1 commit into
mainfrom
agent-tools

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

What — M5 (binary e2e) + M6 (tools + run)

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. (Tool/rpc semantics cross-checked against a local clone of badlogic/pi-mono.)

Tools (crates/agent/src/tools/) — each an agent_core::Tool

  • read (line-numbered, offset/limit), write (creates parent dirs), edit (pi-style edits[] array or single old_string/new_string, exact unique-match), ls (dirs-first).
  • bash via a CommandRunner seam — RealRunner executes; a mock runner asserts the argv. Timeout + head/tail output truncation. This seam is what the Beyond fork/sync/logs tools (M8) will reuse for argv-assertable tests.
  • grep + find: gitignore-aware, built on ripgrep's own crates (ignore, regex, globset) — not shelling out to rg/fd.
  • default_registry() = the 7-tool set (read, write, edit, bash, ls, grep, find).

CLI

beyond-ai-agent run "<task>" builds a GatewayClient + Agent over the tools and streams assistant text + [tool: …] activity to stdout. Config via flags or AI_GATEWAY_URL / AI_AGENT_KEY / AI_AGENT_MODEL.

Proven by

  • 21 agent unit tests (every tool, incl. argv capture, edit ambiguity/array, gitignore-aware grep/find).
  • Binary e2e (tests/run_e2e.rs): runs the actual beyond-ai-agent run binary against a mock model server scripting a two-turn tool round-trip, asserts it performed the read call and fed the file contents back to the model on the 2nd request. No gateway/provider/network beyond loopback.

New deps, all latest: ignore 0.4.26, regex 1.12, globset 0.4.18, tempfile 3 (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

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>
@jaredLunde jaredLunde merged commit 3c68dfb into main Jun 30, 2026
1 check passed
@jaredLunde jaredLunde deleted the agent-tools branch June 30, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant