fix(orchestration): record durable worker handles + correct in-session SendMessage revival - #2
Merged
Merged
Conversation
…n SendMessage revival Two coupled defects broke autopilot worker resume: the LEAD recorded a fabricated `name` instead of the durable `agentId`+`transcript` the Agent tool returns (so collectStageWorkers silently dropped the worker, forcing a cold reconstruction), and the generated playbook wrongly claimed a completed Agent-tool subagent is name-addressable within the same session. Capture durable handles on dispatch, surface non-fatal resume warnings for name-only worker records and duplicate JSON keys, and rewrite the revival paths to be agentId-first with transcript warm-seed fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
DumoeDss
added a commit
that referenced
this pull request
Jul 28, 2026
…oject identity, ENOENT-discriminate reads (PR#88 B5/B6/M3/M4) B5: commitStoreRegistration serialized via a per-root owner-aware lock; cleanup re-verifies metadata id+uid before delete (defense-in-depth; v1 undefined-uid handled). B6: clearProjectOwnership + migrate-membership acquire the per-record membership lock and re-read+merge roles so a concurrent add-project survives; per-record locking, no deadlock. M3: normalizeProjectIdentity (sameProjectIdentity helper) at all audited project-ID comparison sites in context.ts + execution-binding.ts. M4: readRecordFile + listStoreProjectRecords ENOENT-discriminate (StoreError on EACCES/EIO/EBUSY, not silent absent). Tests: 102 pass / 1 POSIX-skip; B5/B6/M3/M4 deterministically red on pre-fix. tsc+lint clean. en/ja locales carry child #2's deferred mutationDegraded + #4's new error codes. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DumoeDss
added a commit
that referenced
this pull request
Jul 28, 2026
… wrapping, test fixes Resolves the 6 remaining CI failures on PR #88 head (e3532d0): - #2 audits-api socket hang: rejectImport uses socket.end() (FIN) + destroy fallback, not req.destroy() (RST) - #4 B3 race loser: snapshot fs.existsSync before probe; absent-at-start + later-refused = obtain-failed (lost race) - #5 token-audit: read() wraps all errors as AuditServiceError (was ELOOP on Linux symlinks) - #1 pin RASEN_AGENT_RUNTIME per-test (dispatchMode assertion) - #3 bootstrap-obtain registry cleanup via updateStoreRegistryState (was regex corrupting the entry) - #6 board-page waitForState polling helper (fresh act() per poll) M1: lost-race diagnostic split (retry, not relocate). T2: theoretical TOCTOU accepted-known. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DumoeDss
added a commit
that referenced
this pull request
Jul 28, 2026
…robe + merge reconciliation 3 remaining CI failures on d49205b fixed: - #1 pipeline-store-root-selection (persistent, failed 3x): validatePipelineByName passed no probeCodex to validatePipelineForExecution, so it probed the REAL codex binary. CI has no codex installed -> any pipeline with a codex role reported pipeline_runtime_unavailable. The prior host-runtime pin was insufficient because exec-bridge (claude host) ALSO probes codex. Fix: probeCodex: () => true -- validate is structural integrity; codex binary presence is a pre-execution concern (pipeline run preflight). Unsupported dispatch routes still fail. - #2 command-registry (merge-introduced): the merged `update` command exposes --force/--all-projects/--only-this but COMMAND_REGISTRY only listed --force. Added the two dropped flags to the completion registry. - #3 identity-boundaries (merge-introduced): project-home.ts AI_TOOLS.find (t => t.value === toolId) reads a TOOL id, not a store pointer alias; the guard scanned it because the file imports STORE_POINTER vocab. Added to INNOCENT_VALUE_RECEIVERS (matches init.ts::t precedent). Verified locally (fresh build): the 3 files + doctor/project-registry/validate/update regression all green; tsc + lint clean. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DumoeDss
added a commit
that referenced
this pull request
Aug 9, 2026
…p+archive Captures the ECP-7 close-out state at LEAD context ~95%: 5 children terminal (foundation/prepare-unavailability/cutover/closure/host); executor verified-CLEAN (round-1 + LEAD 7.1 additivity/Record-no-mutation checks + projection clean) at 35/39, 4 ECP-8-deferred tasks gating archive. Resume: ledger-reconcile + ship+archive executor -> policy-parity -> operator items (self-hosting toy-change, ECP-8 macOS). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Why
A real autopilot run failed to resume its workers because of two coupled defects in the orchestration-worker-lifecycle area.
namefield instead of the durableagentId+transcriptthe Agent tool actually returned, socollectStageWorkerssilently dropped the record — the worker became invisible torasen pipeline resume, forcing a cold reconstruction and losing the warm-seed path.SendMessage-ing a completed worker within a live session revives it (by name) — but the transcript proves a completed Agent-tool subagent is NOT reliably name-addressable even ~27 messages later in the same un-compacted session (the harness replied "No agent named 'implementer' is currently addressable … use the agent ID"). The playbook's revival claim is wrong, and the run-state gap that made the failure silent had no validation to catch it.What Changes
agentId+transcriptfrom the Agent (Task) tool's spawn RESULT and write them into the stage'sworkerrecord (Claude), orthreadId+transcript/turnId(Codex) — never a made-upname. TheWorkerschema fields stay optional and.passthrough()so archivedauto-run.jsonstill parses.rasen pipeline resumesurfaces a non-fatal warning (json + text) for every stage whoseworkerrecord lacks any durable handle (agentId/transcript/threadId) — i.e. a name-only or role-only record — naming the offending stage and the non-durable keys present. A new duplicate-key detector likewise warns (non-fatal) whenauto-run.jsoncarries duplicate JSON keys, whichJSON.parsesilently collapses.nameis a non-durable dispatch label, NOT a resume handle; a completed Agent-tool subagent may be unreachable even within the same session; fall back to the transcript warm-seed (Tier-B) whenagentIdis absent or does not resolve. Code comments inrun-state.ts(~L34–43) andpipeline.ts(~L423–425) aligned with this reality.collectStageWorkerssilent drop → caught by the resume warning; the unknownnamefield → flagged by name in the warning (passthrough preserved); Tier-A honesty → Step A text and theclaude-settings.tsheader comment stop overclaiming re-addressability.run-state.test.ts(worker-handle validation helper, duplicate-key detector,collectStageWorkersbehavior unchanged for durable handles) andpipeline.test.ts(resume warns on a name-only worker and on duplicate keys, in json + text; a durable-handle worker warns nothing).No breaking CLI changes. No new required schema fields. Archived run-state continues to parse.
Impact
src/core/templates/workflows/_orchestration.ts): Step A (tier honesty), Step B (captureagentId+transcriptfrom the spawn result), Step F.1 (agentId-first revival + the "same mechanism" note), Step H.4a(b)/H.4b (agentId-first revival). Embeds viaORCHESTRATION_PLAYBOOKintoauto.ts,review-cycle.ts,goal-command.ts— their parity hashes intest/core/templates/skill-templates-parity.test.tsmove.src/core/templates/workflows/auto.ts: the Resume-section comment that restated the (wrong) within-session revival claim is aligned.src/core/pipeline-registry/run-state.ts: doc comment (~L34–43) aligned; new non-fatal helpers — a duplicate-key detector over the raw JSON text and a worker-handle-validation helper.RunStateWorkerSchemastays optional +.passthrough().src/commands/pipeline.ts:resumesurfacesworkerHandleWarnings+ duplicate-key warnings (json + text); the "dead SendMessage handles" comment (~L423–425) is aligned.src/core/claude-settings.ts: header doc comment (~L1–9) stops overclaiming Tier-A re-review guarantees.test/core/pipeline-registry/run-state.test.ts,test/commands/pipeline.test.ts, and the parity hash list intest/core/templates/skill-templates-parity.test.ts.No runtime
tierdetection is added (tier is LEAD-self-reported from the playbook); adding a runtime env-probe is explicitly out of scope. Noauto-run.jsonis written or edited by this change.Test plan
npx tsc --noEmitexit 0pnpm lint0 errorspnpm test2526 passed / 0 failedpnpm run buildoktest/commands/pipeline.test.ts46 passed / 0 failed (re-review)rasen validateclean;isComplete: true🤖 Generated with Claude Code