Repository navigation
feat: add agy runner and devkit_ask bridge tool - #114
Hieraphant wants to merge 1 commit into
Conversation
Wire Claude, Codex, and agy (Google Antigravity CLI) into a direct,
commutative bridge instead of the parallel fan-out model.
- runners/agy.go: new AgyRunner (stdin-piped one-shot, mirrors CodexRunner)
with AGY_CMD / AGY_ARGS env overrides since agy's headless flags are not
yet verified. Registered in DetectRunners; added to --agent choices.
- mcp: new devkit_ask tool — {to: claude|codex|agy, prompt, workdir?} resolves
the peer via FindRunner and returns its answer synchronously, bounded by
commandTimeout. Any MCP host (Claude, Codex) can ask any peer and block for
the reply.
- Tests: agy_test.go (name, argv builder incl. AGY_ARGS/{workdir}, AGY_CMD,
Available) and ask_test.go (missing-arg, unknown-peer, unavailable-peer).
Note: agy's exact non-interactive argv is a documented TODO(agy) placeholder;
agy is reachable as a target now, and works once the argv is probed or AGY_ARGS
is set. agy-initiated calls depend on agy supporting MCP-client attach (TBD).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W7VdbGfPkkce5UGQqjeSE9
There was a problem hiding this comment.
@Hieraphant Thanks for this — the devkit_ask tool is a clean addition, and the tests fit the existing style well. A few things before merge:
1. The agy argv is unverified. The default agy exec [-C dir] - is copied from the Codex runner and hasn't been run against a real agy. I'd rather not ship a runner that probably fails on first use. Could you run agy --help / agy exec --help on a host that has agy installed and update the default? If that's going to take a while, another option is to split this PR: land devkit_ask for claude and codex now, and add agy in a follow-up once the flags are confirmed.
2. Recursion. If the claude or codex peer that gets launched also has the devkit MCP server loaded, it can call devkit_ask again. Each level gets its own 5-minute timeout, and nothing limits the depth. Something like a DEVKIT_ASK_DEPTH env var that's incremented on each call and rejected past 1 would close this.
3. Permissions / sandbox. The Codex runner runs with --sandbox workspace-write, but the agy runner doesn't set a sandbox or permission mode, so it runs with whatever agy's defaults are. Please match the Codex posture once the real flags are known. workdir is also passed through unchecked. At a minimum it should be verified as an existing directory.
4. Timeout. 5 minutes (commandTimeout) is short for a real claude or codex task. Maybe add an optional timeout argument with a sane cap?
5. Docs. CLAUDE.md needs updating. The runners row still reads {claude,codex,gemini}.go, and the MCP tools row doesn't list devkit_ask.
6. Minor. Please drop the "Generated with Claude Code" line from the PR body.
I'll approve the CI run so we can see the checks. Once the argv question is resolved, either way, I'm happy to merge.
What
Turns devkit into a direct, commutative bridge between the three AI CLIs — Claude, Codex, and agy (Google Antigravity) — instead of the parallel fan-out/consolidate model. Any MCP host can send a prompt to any peer and get its answer synchronously.
Changes
src/runners/agy.go(new):AgyRunner— a stdin-piped one-shot runner mirroringCodexRunner. Binary and argv are env-overridable viaAGY_CMD/AGY_ARGS(with a{workdir}token) since agy's headless flags aren't verified yet. Registered inDetectRunners; added to--agentchoices.devkit_askMCP tool (src/mcp/tools.go,src/mcp/server.go):{to: claude|codex|agy, prompt, workdir?}→ resolves the peer viaFindRunnerand returns its output synchronously, bounded bycommandTimeout. This is the commutative primitive.src/runners/agy_test.go(name, argv builder incl.AGY_ARGS/{workdir},AGY_CMD,Available) andsrc/mcp/ask_test.go(missing-arg, unknown-peer, unavailable-peer). Hermetic, matching the existing style.Verification
go build ./...,go vet ./..., andgo test ./...all pass. Builtdevkit-engine, booted it as an MCP server, and confirmed over JSON-RPC thatdevkit_askis advertised and its handler returns correctly (unknown peer,not available,missing argument).Follow-ups (need a host with agy installed)
TODO(agy): probeagy --help/agy exec --help/agy modelsto replace the placeholder argv (or setAGY_ARGS). agy is reachable as a target now; the exact invocation is a documented guess until probed.agy mcp --help). If not, agy is target-only and Claude/Codex broker for it; Claude↔Codex is already fully commutative.🤖 Generated with Claude Code