fix(daemon): preserve recovered worker registry authority - #1267
Closed
sethkarten wants to merge 15 commits into
Closed
fix(daemon): preserve recovered worker registry authority#1267sethkarten wants to merge 15 commits into
sethkarten wants to merge 15 commits into
Conversation
7 tasks
sethkarten
marked this pull request as ready for review
August 12, 2026 00:55
…ecovered-worker-registry
…ecovered-worker-registry
sethkarten
force-pushed
the
core09-recovered-worker-registry
branch
from
August 12, 2026 18:35
e1fdde9 to
d2c4920
Compare
Contributor
Author
sethkarten
added a commit
that referenced
this pull request
Aug 13, 2026
Reconstruct the unique net delta from PR #1267, excluding propagation merges.
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.
Summary
Validation
node_modules/.bin/biome check packages/coding-agent/src/modes/daemon/daemon-supervisor-ownership.ts packages/coding-agent/src/modes/daemon/daemon-supervisor.ts packages/coding-agent/test/daemon-supervisor-monitor.test.tsnode_modules/.bin/vitest --run packages/coding-agent/test/daemon-supervisor-monitor.test.ts packages/coding-agent/test/daemon-session-list.test.ts packages/coding-agent/test/saved-session-info.test.ts(104 passed)node_modules/.bin/tsgo --noEmitblocked by a pre-existing missinginvokeHostRequestexport inpackages/coding-agent/test/sdk-mcp-boundary.test.ts.Note
Preserve daemon supervisor registry authority across worker spawning
DaemonSupervisornow captures a single registry directory at startup viagetDaemonSupervisorRegistryDir()and stores it assupervisorRegistryDir.DAEMON_SUPERVISOR_REGISTRY_DIR_ENVset tothis.supervisorRegistryDirafter merging all other env vars, preventing workers from overriding the registry path.DAEMON_SUPERVISOR_REGISTRY_DIR_ENVandgetDaemonSupervisorRegistryDirare exported from daemon-supervisor-ownership.ts so the supervisor and tests can import them directly.launchEnvprovides.Macroscope summarized ed2552c.
Final reconciled validation
f9f0d7615e1cca807c4faa49413cc52a9c1f31f5tsgo --noEmit: passgit diff --check: pass; final worktree cleanNote
Medium Risk
Touches daemon ownership, startup fencing, and worker spawn env—core process coordination—but the change is narrow and covered by supervisor monitor tests.
Overview
Fixes lost supervisor registry authority when workers are relaunched from recovery metadata that can carry an untrusted
launchEnv.DaemonSupervisornow captures the registry directory once at construction (getDaemonSupervisorRegistryDir) and uses that same path for startup fencing, ownership acquisition, and every worker spawn. On launch, it setsPRIME_AGENT_INTERNAL_DAEMON_SUPERVISOR_REGISTRY_DIRafter inheritedprocess.envand callerlaunchEnv, so neither can redirect workers to a different registry.daemon-supervisor-ownershipexports the env constant and renames the internal resolver togetDaemonSupervisorRegistryDirfor shared use. Tests assert recovered relaunches still receive the supervisor’s registry dir and do not persist the override in the worker descriptor.Reviewed by Cursor Bugbot for commit ed2552c. Bugbot is set up for automated code reviews on this repo. Configure here.