fix(run): plumb the recorded prompt back into live runs, fix lane routing when the cwd doesn't match the selected lane

- pty-run.js's publicRun() now reads promptPreview back from the
  dashboard_runs row it already wrote at spawn time (was persisted,
  never read back) — RunHandle carries it through to the client.
- Workspace.tsx's onStartFromSetup no longer trusts RunSetup's
  always-populated laneId prop to decide whether a new lane needs
  ensuring — it re-resolves the target lane from the cwd the user
  actually typed, so starting a run with a different cwd than the
  currently-selected lane correctly ensures/creates the right lane
  instead of silently starting in the wrong one.

Fixes findings from the Task 8+9+10 review that a prior fix attempt
left unresolved (2f39f4e's --no-verify commit, and an incomplete
diagnosis of the lane-routing bug as a test-harness artifact).
This commit is contained in:
2026-08-12 13:18:04 +07:00
parent 2f39f4ec98
commit b951f64321
7 changed files with 724 additions and 25 deletions
+1 -1
View File
@@ -125,7 +125,7 @@ export function ActiveRunsSwitcher({
cwd: r.cwd || "",
model: r.model,
status: r.status,
promptPreview: "",
promptPreview: r.promptPreview || "",
startedAt: r.startedAt ? new Date(r.startedAt).getTime() : 0,
endedAt: null,
isLive: r.status === "running",
@@ -33,6 +33,7 @@ const activeRuns = {
model: "claude-opus-5",
status: "running",
startedAt: "2000-01-01T00:50:00Z",
promptPreview: "the live prompt",
endedAt: null,
},
],