Skip to content

Move to the agent-tools core: kit session, verdict tool, no limbs - #74

Merged
Octember merged 5 commits into
mainfrom
feat/kit-session-verdict-tool
Sep 8, 2026
Merged

Move to the agent-tools core: kit session, verdict tool, no limbs#74
Octember merged 5 commits into
mainfrom
feat/kit-session-verdict-tool

Conversation

@Octember

@Octember Octember commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Per Noah: rip out the SDK codex runner and replace it with the earshot / agent-tools core, then kill the limbs.

Commit 1: the session and the verdict

  • codex.ts opens a kit AppServerSession: model/effort as per-session flags (they were read and never applied), the kit's 5-minute stall timeout instead of a 20-minute silent hang, scrubbed env.
  • The verdict is a review_verdict tool over ReviewOutput, earshot's verdict shape. The kit validates the arguments mid-turn and hands zod's error back to the model; the tool throws for what a schema can't say (an anchor that isn't a right-side diff line, a convergence verdict carrying findings, a call before the second pass) so the model corrects itself. The model's text is never read; no call is a fail that retries, never a clean.
  • Same two turns; the hand-written second pass is untouched. Drops @openai/codex-sdk.

Commit 2: the limbs

Gone with their only readers: cli.ts and bin/ (provision, setup, upgrade, init, prime, status, review), prime.ts, status.ts and state/status.json, commit-status.ts and the GitHub App minting, review-one.ts, the packs template, the release workflow, clack and picocolors. Rotation moves into the session's onTurnError hook.

src/review-sweep.ts is now one sweep, top to bottom. Deploy is deploy/vm-setup.sh + deploy/push.sh + DEPLOY.md, earshot-style. README, AGENTS.md, ARCHITECTURE.md, and the site match.

GH_HOST stays on the cron line rather than in config.env: under Bun a runtime process.env write does not reach a child spawn unless env is passed, and the kit's exec doesn't pass it.

before after
src lines 2,967 1,232
src files 19 13
runtime deps 4 2

Commits 3 to 5: stupify reviewed this PR and was right three times

The new engine went live on stupify-octember-stupify and reviewed each push of this branch. Each finding was real and is fixed in its own commit:

  1. review_verdict was live for the whole session, so a first-turn call could return a verdict before the second pass ran. Now refused until the second-pass prompt is the running turn.
  2. threadSandbox: 'read-only' owned nothing: the kit's per-turn default is dangerFullAccess. Now turnSandboxPolicy: { type: 'readOnly' }, which is what codex enforces.
  3. The kit's start() rethrows a failed handshake without killing the codex it spawned, and runTurns only enters its try/finally after start(). One stop() in our catch until the kit owns it.

On the fifth head it posted nice, all fixed ✅ and resolved all three threads.

Kit follow-ups (agent-tools, not this PR)

  • exec() should pass env: process.env so a runtime env write reaches children.
  • start() should stop() the child before rethrowing a failed handshake.
  • DEFAULT_TURN_POLICY is full access; consumers that never set turnSandboxPolicy run wide open.

Verified

  • Print-only review through the kit session on the octember VM; isolated dry sweep from a scratch home (config, lock, clone, taste, paged listing, gates).
  • Live on stupify-octember-stupify (backup review-sweep.ts.bak-pre-kit-core): four real reviews of this PR, three findings, one convergence. No codex processes left behind between sweeps.
  • The other five VMs still run the pre-Move to the agent-tools core: kit session, verdict tool, no limbs #74 bundle until merge + deploy/push.sh <vm>. Bevyl's home REVIEW-PROMPT.md says "Output pure JSON only" twice; reword to "submit with review_verdict" when rolling out there.

…ol call.

codex.ts no longer runs the Codex SDK thread and parses its final message
against an outputSchema. It opens a kit AppServerSession (model and effort
as per-session flags, read-only sandbox, the kit's stall and turn timeouts,
scrubbed env) with one tool, review_verdict, over the existing ReviewOutput
schema. The kit validates the shape mid-turn and hands a bad call back to
the model as the tool error; the tool's run throws for what the schema
can't say (an anchor that is not a right-side line this diff touches, a
convergence verdict carrying findings), so the model corrects itself
instead of the runner demoting the finding after the fact. The model's
text is never read. No verdict submitted is a fail, never a clean.

Same two turns as before: the review prompt, then the hand-written second
pass. github.ts loses the demotion path since anchors are checked at
submission; the 422 body-only fallback stays. Drops @openai/codex-sdk and
the failureReason regex; bumps @bevyl-ai/agent-tools 0.3.0 -> 0.13.0.
Comment thread src/sweep/codex.ts Outdated
…status file.

stupify is now the engine and nothing else: src/review-sweep.ts reads top
to bottom as one sweep, src/sweep/* is the domain, and everything generic
(codex session, exe.dev, host primitives) is @bevyl-ai/agent-tools.

Gone, with their only readers: cli.ts and bin/ (provision, setup,
upgrade, init, prime, status, review), prime.ts, status.ts (state/
status.json, read by `stupify status`), commit-status.ts (the GitHub App
JWT minting behind one checkmark), review-one.ts (the on-demand review),
the packs template, the release workflow, and the clack/picocolors deps.
Rotation moves from review-pr.ts into the codex session's onTurnError
hook, so the `raw` field on a limit outcome goes too.

Deploy is two scripts and a runbook, earshot-style: deploy/vm-setup.sh
(codex gateway config + bun, handed to `exe.dev new`) and deploy/push.sh
(build, copy, first push writes config.env and installs the cron with
GH_HOST on the cron line: gh reads it from the environment and a Bun
process can't hand a runtime env write to a child spawn). DEPLOY.md is
the runbook. README, AGENTS.md, ARCHITECTURE.md, and the landing page say
the same thing.

src: 2,967 lines -> 1,226.
@Octember Octember changed the title Drive codex through the kit's app-server session; the verdict is a tool call Move to the agent-tools core: kit session, verdict tool, no limbs Sep 8, 2026
stupify's own review of the first commit: review_verdict was live for the
whole session, so a first-turn call could fill the verdict and be returned
after runTurns without the ownership challenge ever running. The tool now
refuses until the second-pass prompt is the running turn, with an error
that tells the model when to call it.
Comment thread src/sweep/codex.ts Outdated
stupify's second finding on this PR: the kit's runTurns passes no per-turn
sandbox override and its turn default is dangerFullAccess, so the
thread-level 'read-only' string owned nothing. turnSandboxPolicy
{ type: 'readOnly' } is what codex enforces per turn.
Comment thread src/sweep/codex.ts
stupify's third finding: the kit's start() spawns codex and rethrows a
failed handshake without stop(), and runTurns only enters its try/finally
after start() returns. Under a minute cron that is an orphan per failed
sweep. One stop() in our catch until the kit's start() owns it.

@exe-dev-github-integration exe-dev-github-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nice, all fixed ✅

@Octember
Octember merged commit af3b1ef into main Sep 8, 2026
1 check passed
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