Skip to content

feat: add agy runner and devkit_ask bridge tool - #114

Draft
Hieraphant wants to merge 1 commit into
5uck1ess:mainfrom
Hieraphant:feat/agy-runner-devkit-ask
Draft

Hieraphant wants to merge 1 commit into
5uck1ess:mainfrom
Hieraphant:feat/agy-runner-devkit-ask

Conversation

@Hieraphant

Copy link
Copy Markdown

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 mirroring CodexRunner. Binary and argv are env-overridable via AGY_CMD / AGY_ARGS (with a {workdir} token) since agy's headless flags aren't verified yet. Registered in DetectRunners; added to --agent choices.
  • devkit_ask MCP tool (src/mcp/tools.go, src/mcp/server.go): {to: claude|codex|agy, prompt, workdir?} → resolves the peer via FindRunner and returns its output synchronously, bounded by commandTimeout. This is the commutative primitive.
  • Tests: src/runners/agy_test.go (name, argv builder incl. AGY_ARGS/{workdir}, AGY_CMD, Available) and src/mcp/ask_test.go (missing-arg, unknown-peer, unavailable-peer). Hermetic, matching the existing style.

Verification

go build ./..., go vet ./..., and go test ./... all pass. Built devkit-engine, booted it as an MCP server, and confirmed over JSON-RPC that devkit_ask is advertised and its handler returns correctly (unknown peer, not available, missing argument).

Follow-ups (need a host with agy installed)

  • TODO(agy): probe agy --help / agy exec --help / agy models to replace the placeholder argv (or set AGY_ARGS). agy is reachable as a target now; the exact invocation is a documented guess until probed.
  • agy-as-initiator: depends on whether agy can attach an MCP server (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

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

@5uck1ess 5uck1ess left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

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.

2 participants