Repository navigation
feat(fork-loops): run an agent in a loop until the work is verified done - #121
Merged
Merged
Conversation
…cost cap is set Claude-Session: https://claude.ai/code/session_01Ra4nVsfKdztCCHFzhu1dNn
…irst, publish unverifiable holds, require git exclude, log skipped ticks Claude-Session: https://claude.ai/code/session_01Ra4nVsfKdztCCHFzhu1dNn
…l, hold on unverifiable hosts between iterations Claude-Session: https://claude.ai/code/session_01Ra4nVsfKdztCCHFzhu1dNn
…liveness probe Claude-Session: https://claude.ai/code/session_01Ra4nVsfKdztCCHFzhu1dNn
… relaunch The handle-to-pty lookup answers only for headless ptys, so binding, revealing and relaunching a loop in a renderer tab fell back to the pane resolver.
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
7 of 9 tasks
React Doctor's no-impure-state-updater flagged setSteerText inside the run() callback. run() now reports success and sendSteer clears the draft only when the steer went through.
Re-home the loops seams onto v1.4.230's module splits: the worktree ps listing moved to runtime/workspaces, the mobile row type moved to workspace-list-types (structural list equality now covers the loop summary), and the RPC catalog and skill manifest are regenerated. Loops on ssh: hosts now refuse with SshHostNotServedError, matching the sitter, since upstream retired the desktop SSH git provider and relay exec. Loop agent detection routes by the worktree's resolved host so it stays off the Active Server focus ratchet.
…-host ratchet The loop runner is a fork copy of upstream's precheck-runner.ts, which stays on the same baseline; declared as a fork-loops seam.
The fork does not carry upstream's plain release tags, so fetching v1.4.224 from origin failed the managed-orcad SSH e2e job at setup.
Upstream's census tests require every runtime RPC method to have a host ownership and every SQLite table a WSL-move disposition.
Importing beginLoopsShutdown from registration pulled the whole runtime into main-process-quit, so upstream's quit-veto test timed out loading it with its dependencies mocked.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
You can now tell Orca "keep running this agent until the work is actually done." Orca sends the agent a prompt, waits for it to finish, checks whether it's done (by running a command like
pnpm test, asking an evaluator model, or both), and if not, sends it again. You can also run a prompt on a timer, or feed the agent a queue of prompts one at a time.What Changed
Before, getting an agent to keep going meant sitting next to it and re-prompting by hand. Now there's a Loop entry in the tab bar's + menu and an
orca loopCLI.LOOP_DONEis only a claim. A loop completes when its check command exits 0 and/or its evaluator passes. Evidence from a done signal the agent edited is rejected.orca worktree ps, and a label on mobile worktree rows.Mechanism: a main-process
LoopServiceowns each loop and aLoopDriverruns its iterations against the runtime's terminal API. State lives in SQLite, so a loop keeps running after the CLI returns or its tab closes. Each iteration composes a prompt with a header and a notes file, sends it, watches the agent's status until it settles, then gathers evidence (check output, git diff, usage, evaluator verdict) and decides whether to continue, pause, or complete. Input you type into the agent's pane during an iteration is attributed to you, and a loop won't send over it.All fork code lives in
fork-loops/directories inshared,main,renderer,cli, andmobile. Upstream files carry only declared one-line seams (registration and passthrough), recorded inconfig/fork-ownership.json.Why
The alternatives were a shell
whileloop around the CLI, or an automation that fires on a schedule. Neither knows when the agent has actually finished an iteration, and neither can tell "the agent says it's done" apart from "the tests pass." Owning the loop in the app's main process lets it reuse the hook server's agent status, the existing terminal runtime, and SSH execution, so a remote worktree loops the same way a local one does.Linked Issue
N/A (fork feature)
Visual Proof
[ASK: attach before/after of the + menu, setup dialog, and loop rail]
Testing
Fork-loops unit suites (main and renderer) plus the fork localization catalog test on the remote sandbox: 24 files, 407 tests passing.
pnpm run check:code-quality:changed,pnpm typecheck:node, andpnpm typecheck:webare clean.Platforms: [ASK: which platforms and SSH were exercised manually]
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude (Claude Code).
Review
Agent skill upstream boundary
Notes
unverifiablebetween iterations instead of counting the agent as exited.loops.v1runtime capability, so an older host returnsincompatible_runtime. The new worktree summary field is optional.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)