Skip to content

fix(sessions): say which guard refused a session store switch - #6433

Open
Hmbown wants to merge 1 commit into
mainfrom
fix/session-store-refusal-reason
Open

Hmbown wants to merge 1 commit into
mainfrom
fix/session-store-refusal-reason

Conversation

@Hmbown

@Hmbown Hmbown commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Refs #6418. A refused session switch always said the saved Runtime
store "belongs to a different host", whatever the actual guard was.
When another running Codewhale process holds the store, the suggested
codewhale resume meets the same holder, so the advice was wrong.

RuntimeStoreBinding::adoption_refusal returns the first guard that did
not provably hold (unconfined, not a directory, held by a live process,
durable work in a named directory, scope-pinned automation). It fails
closed and never widens what is adoptable. The switch path now names
the reason, and a live holder gets the step that actually frees the
store. has_no_durable_work lost its last production consumer, so its
two test assertions move to adoption_refusal and the helper is removed
instead of suppressed.

Mined from the unreviewed 0.10.1 WIP branch (runtime_threads.rs and its
adoption_refusal test module); the UI consumer migration is new.

Evidence: 17 passed, 0 failed (13,233 skipped) across
runtime_store_binding, adoption_refusal and adoptable selections. TUI
all-target/all-feature Clippy with CI flags and fmt passed; dead-code
budget stays at 279. This is a diagnostic, not a fix for the #6418
reporter's store; that still needs their store/binding evidence.

🤖 Generated with Claude Code

Refs #6418. A refused session switch always said the saved Runtime
store "belongs to a different host", whatever the actual guard was.
When another running Codewhale process holds the store, the suggested
`codewhale resume` meets the same holder, so the advice was wrong.

RuntimeStoreBinding::adoption_refusal returns the first guard that did
not provably hold (unconfined, not a directory, held by a live process,
durable work in a named directory, scope-pinned automation). It fails
closed and never widens what is adoptable. The switch path now names
the reason, and a live holder gets the step that actually frees the
store. has_no_durable_work lost its last production consumer, so its
two test assertions move to adoption_refusal and the helper is removed
instead of suppressed.

Mined from the unreviewed 0.10.1 WIP branch (runtime_threads.rs and its
adoption_refusal test module); the UI consumer migration is new.

Evidence: 17 passed, 0 failed (13,233 skipped) across
runtime_store_binding, adoption_refusal and adoptable selections. TUI
all-target/all-feature Clippy with CI flags and fmt passed; dead-code
budget stays at 279. This is a diagnostic, not a fix for the #6418
reporter's store; that still needs their store/binding evidence.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 23, 2026 15:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

2 participants