CL-6365: a deterministic red for the restored-run-comes-back-terminal gap - #105
Closed
TheGreatAxios wants to merge 2 commits into
Closed
CL-6365: a deterministic red for the restored-run-comes-back-terminal gap#105TheGreatAxios wants to merge 2 commits into
TheGreatAxios wants to merge 2 commits into
Conversation
…nt drop The kill window was three seconds after a prompt a small model answers in one. On a fast instance the turn had already completed and parked by the time the sidecar came down, so proof 4 was proving a clean restart, not crash recovery -- and passed. Proof 4 now sends a workload no model finishes inside the window, asserts nothing has answered at the moment of the kill, and asserts the interrupted turn reaches the reader as a partial answer or the product's own undelivered notice rather than vanishing.
Contributor
Author
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.
What this is
CL-6365's reproduction and diagnosis, on a real stack. The relaunch itself is not implemented here — see "What is not done" below.
The correction that mattered
Proof 4 killed the sidecar three seconds after asking the agent to "count slowly from one to twenty". On an instance whose model answers that in about a second, the turn had already finished and the run had parked — so the restart being proved was a clean restart, not a crash. Proof 4 passes that way at this branch's tip, which is why the gap can look closed.
Proof 4 now sends a workload no model finishes inside the window and asserts, at the moment of the kill, that nothing has answered yet. With that, the failure is deterministic.
What the mid-turn kill leaves behind
workflow_run.status = 'failed'in the hub's own database. The SIGTERM drain tears the workflow-process child down mid-step and the terminal event is committed to the durable log before exit.liveness: "ok"~10s after restart.409 workflow_run_terminal; the folded chat run's mail is dequeued and dropped by the supervisor, which readsreadWorkflowRunLifecycleoff the durable log, seesterminal, and rejects permanently.onBodyFailure: "continue"cannot help: the failure is on the top-level run, not on a body occurrence.Why "wake it again" is not the fix by itself
wakeByAddressreturns early for any routable address (CL-6267 handed park-respawn to the sidecar), so a routable-but-dead run is never woken. Restoring the deleted CL-6147 undeploy-then-redeploy branch is necessary but not sufficient:deriveWorkflowRunId(deploymentMailAddress)), so redeploying the same address re-creates the same run id.teardownDeploymentwithreclaimDirs) removes the deployment record and the per-step scratch but not the workflow-run repo holding the run's durable event log. The terminal event survives the redeploy and the next message is rejected identically.So a relaunch must produce a genuinely new run: a fresh run id adopting the room's continuity (the room is data now, nothing is lost), or a destructive teardown that also reclaims the run's durable log. The detection signal is already available to the hub as
workflow_run.status.What is not done
The hub-side detection and the relaunch. This PR lands the red half and the diagnosis; the fix is the next commit on this branch.
Evidence
Scratch database, real signup, real local Ollama, nothing mocked.
Before the harness correction (kill landing after the turn) — all four proofs passed:
After, with the kill provably mid-inference:
Hub database at that moment:
running|2 failed|2 deployed|5.Checks
bun run typecheck: clean.prettier --checkclean on both touched files. (bun run lintreports pre-existing formatting warnings in sevenpackages/onboarding/packages/clitest files that this branch does not touch.)Environment note
The proof's model is named by
E2E_OLLAMA_MODEL, butensureSeededstill pins the seeded agent definition atCATALOG_SEEDS.ollama's curated model (qwen3.8:27b) regardless — env trap 1 in the docs is only half closed. An instance without that model pulled dies at proof 3 with "I can't reach a model right now". Workaround used here:ollama cp <a served model> qwen3.8:27b, thenE2E_OLLAMA_MODEL=qwen3.8:27b.