Repository navigation
Conversation
Accounts that link projects/ and sessions/ to one config dir each find the same transcript and the same live record, so resolveHome counted every one of them live and refused ambiguous_home. Where every live copy is one file on disk and every live record one registry file, take that session, filed under the account whose own folders hold it. Two files, two processes, or nothing live still refuses (spec/CONTROL.md section 6.1). Fixes spacesheep-dev#350 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Ilya Fomin <2030645+fominfo@users.noreply.github.com>
micmmakarov
left a comment
There was a problem hiding this comment.
Thanks, Ilya. The resolveHome part is right, but the message still won't reach the Session tab.
Blocking: the inbox lane still sees one live record per linked login
inboxLook calls liveRecord(target, this.deps.claudeDirs()) (packages/cli/src/control/daemon.ts:2848), which searches every account. With sessions/ linked, each login reads the same registry file, so liveRecords returns one row per login and liveRecord returns null. I checked this on the PR head (7d7a6fe) with two linked homes:
resolveHome configDir: own
liveRecords across dirs: [ 'a', 'own' ]
liveRecord across dirs: null
So vetInbox refuses with no_record, and the message falls through to a fork. It gets answered in a copy instead of the live window, and later messages follow that copy. With this PR the message stops being refused but still never reaches the Session tab.
Two ways to fix it:
- Scope the lookup to the account you resolved:
liveRecord(target, place.transcript.configDir). That also keepsrec.configDirequal to the transcript's account, which theother_homecheck needs. - Or drop duplicate rows in
liveRecordsby real path. That also stopscancel()(daemon.ts:2601) from seeing doubled rows; those do no harm there today.
Please add a daemon-level test where a message to linked homes actually goes in place through the inbox. The three new tests only cover resolveHome.
Smaller points
- If every account is a link (all pointing at a shared folder that isn't itself in
claudeDirs), the fallback islive[0], which depends on the order ofclaudeDirs. That matters a little becausemachineClass(configDir)reads that account's ownsettings.json, andsettings.jsonisn't shared. One sentence in §6.1 on this case would help. - If the hand-patched copy on the iPro does reach the Session tab, it probably also patches this lookup. That patch belongs in this PR.
The spec paragraph, the refusal cases, the changeset and the before/after proof are all good.
…lane too The inbox lane looks the live record up across every account, and with sessions/ linked each account read the same registry file, so liveRecord found one row per account and returned null: no_record, and the message went to a fork instead of the live window. liveRecords now keeps one row per real registry file, named for the account the session was resolved to, so a second process in another account still refuses and other_home still compares the right accounts. A daemon test writes through linked homes into the inbox; spec section 6.1 covers the all-links case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Ilya Fomin <2030645+fominfo@users.noreply.github.com>
|
Thanks, that's right. Fixed in fa162ab. The inbox lane. I went with the second option, dropping duplicate rows in The daemon test is in §6.1 now covers the all-links case: it takes the first account in the config-dir list, that account's own The iPro. You guessed right that the hand-patched copy didn't fix this lookup. It only deduped transcripts. The message that got through went by the waiter, because a Checks: biome and typecheck are clean. The full suite has 4,543 passed and 8 failed, the same 8 in |
… branch - Add conformance/control-homes.json covering CONTROL.md §6.1 Homes (single, missing, one-live, ambiguous, linked-to-owner, all-links fallback, cold linked, and linked projects with two live registries), driven by packages/core/test/claude-live-record.test.ts. - Cover the all-links fallback branch in oneThroughLinks and mark the two TOCTOU catch fallbacks in realOf/linkedFolder with v8 ignore so 100% coverage holds. - Compare prefer with path.resolve in liveRecords to match vetInbox, and list sessionpipe alongside sessionpipe-core in the changeset. Signed-off-by: kombuchapunk <35040017+kombuchapunk@users.noreply.github.com>
What
Fixes #350. On a machine whose Claude accounts link
projects/andsessions/to one config dir, every account finds the same transcript and the same live record.resolveHomecounted each of them live and refusedambiguous_home, so no Claude Code session there could be messaged.resolveHomenow handles the case where every live copy resolves to one file on disk and every live record to one registry file. That is one session in one process, so it takes it, filed under the account whose ownprojects/andsessions/hold it rather than links. Two transcripts, two processes, or nothing live is still refused, so the signed-out-account guess §6.1 warns about stays out.spec/CONTROL.md§6.1 says so in a new paragraph.Checklist
git commit -s, the DCO)packages/core/test/claude-live-record.test.ts; glad to add a vector file if you want one for homes.sessionpipe-core, patch)Proof
The new cases, then the first one against the old
resolveHome:Lint and types:
The full suite on macOS (Node 22) after
npm run build: 4,540 passed and 9 failed, incli-main,foldandinstall-layout. The same 8 fail in those files without this change. The 9th was a gemini-cli fold case that ran 79 s, a timeout on this machine.🤖 Generated with Claude Code