Repository navigation
fix(daemon): put non-takeover options first in DEVICE_IN_USE hints - #4469
Conversation
Recovery hints told a refused caller to reuse or close the holding session outright. On a shared host another agent followed that and drove a session it did not own. The hints now offer another device and --wait first, and offer reuse or close only if that session is the caller's. The same rule covers the selector-conflict, foreign-workspace, recording and doctor same-device hints. Typed details are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
…sion The same-device doctor check put close --session <other> in its command field, which agents run verbatim. The daemon cannot tell whether that session is the caller's, so the check now omits command and keeps the close only in its conditional hint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Condition the foreign-workspace close on the workspace, since that session is often the caller's own from another folder. Close a recording session after record stop only if it still exists. Shell-quote the session address in the doctor's same-device close suggestion. Extend the ordering test to the foreign-workspace builder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apex SentinelVerdict: Since the last review: 0 new · 0 still open · 1 no longer raised (1 marked fixed) No findings. Reviewed with this repository's own Sentinel configuration ( Feedback goes in the review comment threads, as a reply under the inline comment of a finding: Reply Useful? Reply Comment Earlier reviewsReview of
|
| Where | Finding |
|---|---|
packages/daemon/src/core/session-recovery-hints.test.ts:126 |
400-char cap test only covers the 28-char fixture, so long session names still overflow |
Reviewed with this repository's own Sentinel configuration (9cbbae2c857d).
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 85ab438. The verdict and the full list are in the summary comment.
A 30-character web session name pushed the recording selector-conflict hint to 403 characters, past the 400-character redaction cap. The length test now derives its address from the web session name validator and the implicit workspace addresses session routing builds, and the recording hint is shorter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This PR is ready at eb4f27b: the hints now list other devices and Not blocking, and you can take or leave these: the versioned CLI help at cli-help.ts:313 and device-verification.md:38 still tell agents to reuse or close the holder without the ownership condition, so they should follow the new hint order. The comments at session-recovery-hints.ts:22 and Of the earlier review threads, the foreign-workspace one (discussion) does not apply, because the holder is often your own session from another folder and close stays last and conditional. These are fixed at this commit and can be resolved: foreign-workspace ordering test, recording hint close, doctor shell quoting, and length test. Before merge, wait for the pending jobs to pass. Aligning the help text and the verification doc in the same push would be worth it. |
Summary
The DEVICE_IN_USE hint told a refused caller to rerun with
--session <owner>or toclose --session <owner>. On a shared host, an agent followed that hint and drove another agent's session.The hints now list choosing another device (
agent-device devices) and--wait <ms>first. Reuse or close comes last, and only "if that session is yours". This applies to the open, selector-conflict, and recording-session hints. The foreign-workspace hint keeps its close, conditioned on "if that workspace is yours" (#2580). The doctor same-device check drops its verbatimcommandfield and keeps a shell-quoted, conditional close in its hint. Typed details are unchanged. Every variant fits the 400-character redaction cap.Example:
The holding session may belong to another agent or user. Run agent-device devices and open another device with a device selector. To wait for the device to free up, run the same open with --wait <ms>. Only if that session is yours: reuse --session checkout, or run agent-device close --session checkout first.10 files changed. No linked issue.
Validation
validation: CI
vitest run packages/daemon/src: 3834 passed. The length test derives the longest bounded address (30 characters) from the web name validator and workspace routing. Explicit native names have no length limit.a;b $(x)and emits nocommand.🤖 Generated with Claude Code