Skip to content

fix(view): health scan drops the launching agent's session - #18

Open
bens27 wants to merge 3 commits into
pullboard-dev:mainfrom
bens27:fix/view-health-scan-session
Open

bens27 wants to merge 3 commits into
pullboard-dev:mainfrom
bens27:fix/view-health-scan-session

Conversation

@bens27

@bens27 bens27 commented Nov 4, 2026

Copy link
Copy Markdown

Fixes #17.

Problem

pullboard view runs pullboard sentinel run --health-only --json in each project root every ten minutes (src/serve-sentinel.js). The child inherited the view process's environment, including the agent shell markers and session id of whichever agent shell started the view.

After a later session of the same agent ran pullboard takeover on the main checkout, the binding digest changed. Every scheduled scan then computed the old session's digest, bindLocalSession refused it with NOT_YOUR_CHECKOUT, and the scheduler swallowed the error and retried forever. On one board this produced 35 refusals in under a day, no health findings were ever recorded, and pullboard health drafted a board item blaming builders for the blocks.

Fix

  • agent-session.js exports CALLER_SESSION_NAMES and withoutCallerSession(env): the shell markers, session ids and checkout lease token a child must not inherit. The tour already stripped the same set for scripted seats (#952); it now imports the shared definition.
  • serve-sentinel.js spawns the health scan and the canary with withoutCallerSession(process.env), so the child runs as the view with no session digest and never binds the checkout. refreshBoard takes an injectable start so the spawn environment can be tested.

Proof

New test in test/health-sentinel.test.js: binds the fixture's main checkout to a later session, runs the scan under the launcher's session (control: refused NOT_YOUR_CHECKOUT), then checks the environment refreshBoard hands to spawn carries none of the caller's session and that the scan then runs and records health without rebinding the checkout. It fails on the parent commit and passes here.

🤖 Generated with Claude Code

bens27 and others added 3 commits November 4, 2026 10:46
The spawned scan inherited the view's shell markers and session id,
so after pullboard takeover every scan bound the main checkout under
the old session and was refused NOT_YOUR_CHECKOUT, recording no health.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Ben Silverstein <ben@clearmethodstudio.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Ben Silverstein <ben@clearmethodstudio.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Ben Silverstein <ben@clearmethodstudio.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

View's background health scan is refused NOT_YOUR_CHECKOUT after a coordinator takeover

1 participant