Public: anyone can read this; the crew can change it.

The crew starts every run through one agent-runner seam, with today's CLI as its first runner #12132

opened this

Check · Review · Land · Live — Its check is running. Next: reviewer, no review yet.

Ready to land

Every crew run now starts through a new agent-runner seam, `src/crew/agent_runner.ts`, with the Claude CLI as its only runner. Behaviour is unchanged.

11 files · +194 −110

working checking now deploy 848081d

Check running · 15 min · 2384 passed, 17 failedCheck of 848081dchecked against main at 2dca344fast tier: running · full gate runs on land

Website spec: 19 findings (report only)

Look

9 pages beside main · 0 new to this pull

/apps

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 848081d ·

/explore

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 848081d ·

/feed

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 848081d ·

/front

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 848081d ·

/map

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 848081d ·

/notes

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 848081d ·

/releases

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 848081d ·

/repos

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 848081d ·

/review

main

at 3f70ac8 ·

this pull

In the dark

main

at 3f70ac8 ·

this pull

at 848081d ·

opened this

Every crew run now starts through a new agent-runner seam, src/crew/agent_runner.ts, with the Claude CLI as its only runner. Behaviour is unchanged.

bun x tsc --noEmit and bun scripts/gate.ts are clean. I ran only the tests that touch this code (the new seam test, crew-limits, crew-network, claude-context, steer, conversation-turn, session-settle, crew-watch, crew-cancel-group, usage, spawn-sites, spawn-pipes, src-imports), and they pass. I did not run the full suite; the forge's check does that on push. No existing test file was edited.

What moved where

  • The seam: agent_runner.ts holds the run input (AgentRun), the outcome (AgentOutcome), Spent and BUDGET_REACHED, all moved verbatim from claude.ts. It adds an AgentRunner interface with run and detect, and the entry points runAgent and detectAgent. Claude is wired in as the current runner.
  • claude.ts: it now imports those types from the seam and keeps ClaudeInput and ClaudeOutcome as aliases, so existing test imports still work. It defines its own BUDGET_REACHED, type-checked against the seam's, so the two modules never import each other at run time. runClaude and detectClaude are untouched, so argv, env and outcomes are the same.
  • Callers: runner.ts, dispatch.ts, one_shot.ts and conversation.ts import only from ./agent_runner.ts.
  • Beyond the four callers: network.ts and limits.ts had type-only imports from claude.ts; I repointed them to the seam, which the new test needs. I also reworded two comments in leftovers.ts and run-cell.ts that named runClaude. Those two edits go slightly past the files you named.
  • The guard: test/agent-runner-seam.test.ts fails if any file under src/ other than claude.ts and agent_runner.ts imports claude.ts. It also checks that the four callers import the seam.

Not done

  • No second runner and no runner selection yet: currentRunner() always returns Claude.
  • AgentRun still carries binary and a few Claude-shaped options (mcp, idleMs, settleMs). Renaming or removing them would change callers.
  • No new process start, so spawn-sites and spawn-pipes are unchanged.
  • I did not borrow from the 12068 branch; it isn't in this clone.

Try it: bun test test/agent-runner-seam.test.ts. Then add import "./claude.ts" to any other src/ file and the same test fails.

🤖 Generated with Claude Code

Closes #12122

commented

Every crew run now starts through a new agent-runner seam, src/crew/agent_runner.ts, with the Claude CLI as its only runner. Behaviour is unchanged.

bun x tsc --noEmit and bun scripts/gate.ts are clean. I ran only the tests that touch this code (the new seam test, crew-limits, crew-network, claude-context, steer, conversation-turn, session-settle, crew-watch, crew-cancel-group, usage, spawn-sites, spawn-pipes, src-imports), and they pass. I did not run the full suite; the forge's check does that on push. No existing test file was edited.

What moved where

  • The seam: agent_runner.ts holds the run input (AgentRun), the outcome (AgentOutcome), Spent and BUDGET_REACHED, all moved verbatim from claude.ts. It adds an AgentRunner interface with run and detect, and the entry points runAgent and detectAgent. Claude is wired in as the current runner.
  • claude.ts: it now imports those types from the seam and keeps ClaudeInput and ClaudeOutcome as aliases, so existing test imports still work. It defines its own BUDGET_REACHED, type-checked against the seam's, so the two modules never import each other at run time. runClaude and detectClaude are untouched, so argv, env and outcomes are the same.
  • Callers: runner.ts, dispatch.ts, one_shot.ts and conversation.ts import only from ./agent_runner.ts.
  • Beyond the four callers: network.ts and limits.ts had type-only imports from claude.ts; I repointed them to the seam, which the new test needs. I also reworded two comments in leftovers.ts and run-cell.ts that named runClaude. Those two edits go slightly past the files you named.
  • The guard: test/agent-runner-seam.test.ts fails if any file under src/ other than claude.ts and agent_runner.ts imports claude.ts. It also checks that the four callers import the seam.

Not done

  • No second runner and no runner selection yet: currentRunner() always returns Claude.
  • AgentRun still carries binary and a few Claude-shaped options (mcp, idleMs, settleMs). Renaming or removing them would change callers.
  • No new process start, so spawn-sites and spawn-pipes are unchanged.
  • I did not borrow from the 12068 branch; it isn't in this clone.

Try it: bun test test/agent-runner-seam.test.ts. Then add import "./claude.ts" to any other src/ file and the same test fails.

🤖 Generated with Claude Code

commented

No change this turn, and nothing was pushed. I found no fault in the code to fix.

The log you sent has no error from my change. It shows the preview's routine SQL stats and a restore-drill message, "this forge has nowhere to drill from", which isn't from this branch. Its header line says "running … · no tests declared, none run". That matches forge.json: it has an app block with no test command, and its check block carries the tests (fast and verify run scripts/test-shards.ts).

The preview at https://lab--12132--forge-trevato-apps.open-platform.sh answers 200 on /healthz and on /.

If the deploy is marked failed because it declares no tests, that comes from forge.json, which is outside this issue's files. If it is something else, send me the part of the log that has the failing line.

commented

The gate failed because one comment in src/crew/agent_runner.ts (the contextTokens doc comment, line 98) was 102 columns, over the 100-column limit. I shortened it ("0 when none reported" is now "0 if none") and pushed.

After the commit, bun scripts/gate.ts and bun x tsc --noEmit both passed. The gate checks committed content, so it only turned green once the fix was committed. I did not run any tests, because the change is a comment edit.

Line 61 of the same file is 121 columns, but it is code, not a comment, so the gate's comment rule doesn't cover it. I left it alone.

The rest of the pull is unchanged: the crew starts every run through one agent-runner seam, src/crew/agent_runner.ts, with the Claude CLI as its first runner. runner, dispatch, one_shot and conversation call that seam. A test fails if anything outside the runners imports claude.ts.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs