-
Notifications
You must be signed in to change notification settings - Fork 89
dispatch-from-rescue: surface salvageRef and add rescueFromRunId to POST /runs #1241
Copy link
Copy link
Open
Labels
area/runsRun lifecycle, events, streaming (src/runs/)Run lifecycle, events, streaming (src/runs/)area/serverHTTP API surface (src/server/, ROUTE_TABLE, handlers)HTTP API surface (src/server/, ROUTE_TABLE, handlers)area/uiReact/Vite SPA (src/ui/, @os-eco/warren-ui)React/Vite SPA (src/ui/, @os-eco/warren-ui)effort/medium1-3 days of focused work1-3 days of focused workgood first challengeLarger contributor-ready project: scoped, self-contained, gate-verifiedLarger contributor-ready project: scoped, self-contained, gate-verifiedhelp wantedMaintainers welcome external contributions hereMaintainers welcome external contributions herepriority/P3Low: nice-to-have; pick up when capacity allowsLow: nice-to-have; pick up when capacity allowstype/featureNew user-facing capabilityNew user-facing capability
Description
Activity
Metadata
Metadata
Assignees
Labels
area/runsRun lifecycle, events, streaming (src/runs/)Run lifecycle, events, streaming (src/runs/)area/serverHTTP API surface (src/server/, ROUTE_TABLE, handlers)HTTP API surface (src/server/, ROUTE_TABLE, handlers)area/uiReact/Vite SPA (src/ui/, @os-eco/warren-ui)React/Vite SPA (src/ui/, @os-eco/warren-ui)effort/medium1-3 days of focused work1-3 days of focused workgood first challengeLarger contributor-ready project: scoped, self-contained, gate-verifiedLarger contributor-ready project: scoped, self-contained, gate-verifiedhelp wantedMaintainers welcome external contributions hereMaintainers welcome external contributions herepriority/P3Low: nice-to-have; pick up when capacity allowsLow: nice-to-have; pick up when capacity allowstype/featureNew user-facing capabilityNew user-facing capability
The gap
When a run's work is rescued to a
warren/rescue/<runId>branch after the agent failed to land it, nothing tells the operator the rescue exists and nothing lets them dispatch a follow-up run from it. Today the recovery is a hand sequence: find the run id, guess the branch name, fetch it, check it out, dispatch a new run, and paste the original prompt.What exists:
src/runtime/salvage.ts:41-44definesRESCUE_BRANCH_PREFIX = "warren/rescue/"andrescueBranchFor(runId). The reap path stampssalvageRefandsalvagePathonto the run row (src/runs/reap/run.ts:298-311, and the pod-posted arm at:262-268).src/ui/src/api/types.ts:178-180).What does not:
src/ui/src/pages/and no command undersrc/cli/commands/renderssalvageReforsalvagePath(the only hits arenullvalues in test fixtures).POST /runs(src/server/handlers/runs/dispatch.ts:98-130) acceptscontinueFromRunId,cloneFromRunId, andexistingBranch, but has no field that resolves a rescue.Since PR #1166 an operator who knows the branch name can dispatch with
existingBranch: "warren/rescue/<runId>", becauseresolveExistingBranch(src/runs/spawn/continuation.ts:36-52) checks the branch on the remote and starts the workspace there. Nothing suggests this, and nothing derives the name for them.What to build
src/ui/src/pages/run-detail/) and inwarren showpretty output, whensalvageRefis set, show the ref and the bundle path, with a one-line "re-dispatch from this rescue" hint that names the command below. Follow the existing field-rendering helpers inrun-detail-format.ts.rescueFromRunIdonPOST /runs. Add it besidecontinueFromRunIdindispatch.ts:98-130. Resolve the source run, refuse with 400 when it has nosalvageRef, and otherwise setexistingBranchto that ref and fill agent, project, prompt, provider, model, and cost cap from the source run the wayresolveCloneDefaultsdoes forcloneFromRunId. RecordparentRunIdon the new run so the lineage is visible. Expose it aswarren run --rescue-from <runId>and as a button next to the surfaced ref.bun run gen:docs,bun run gen:openapi, andbun run gen:cli-ref.An automatic retry at reap time after
dropped_commit, modelled onsrc/runs/retry/infra-lost-retry.ts, is a possible third step. It is a policy decision and is out of scope here.Scope
Out of scope: the automatic retry above, and any change to how the rescue branch is created.
Tests:
src/server/handlers/runs.dispatch.test.ts(the new field, the 400 on a run with no rescue, and mutual exclusion withcontinueFromRunIdandexistingBranch),src/runs/spawn/existing-branch.test.ts,src/runs/spawn/continuation.test.ts, the run-detail format tests, andsrc/cli/commands/show.test.tsandrun.test.tsfor the new output and flag. The fake forge used by the handler tests stands in for the remote.Getting started
AGENTS.mdcovers setup and conventions, including the single-implementation rule (the resolution logic lives insrc/runs/, and the handler, CLI, and UI consume it). Everything here is testable in-process with no cluster and no credentials. Runbun run check:allbefore pushing, andbun run build:uifor the UI half. Warnings count as failures.Tracked internally as
warren-1db0.