Refuse to save or resume a work session when the account changed while gathering (CLS-1264) #320
Loading…
Reference in a new issue
No description provided.
Delete branch "cls-1264-work-snapshot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CLS-1264, work-session half (the race noted on #317):
fj work contextandfj work resumenow resolve the account and instance identity before and after their API reads. If it changed, they fail with "the selected account or instance changed while gathering; nothing was saved. Run it again."contextkeeps the old session file;resumeprints nothing.continueis offline and resolves once, so it has no window.Scope: only the work-session path. The wider issue (routing,
Client::connect, browser metadata and mute scope loading config separately in every command) needs one resolved snapshot carried through the client, which touches many files; it stays open on CLS-1264.Failure paths
Known limits
Client::connect's own config load, is not seen. Self-review repeated this Low twice; closing it needs the client to return the identity it connected as.pr_line_comment.rs:65(newer toolchain); CI pins 1.95. 103 gross lines.Automated Codex review (read-only) of head
d24049d827.No new actionable findings against STANDARDS.md.
src/cli/work.rs:537: The invariant is that saved or displayed data belongs to the checked identity. The PR’s accepted “Known limits” remain: an A-to-B-to-A switch or a switch before the client’s separate config load can evade detection in bothcontextandresume. Carrying one resolved identity through client creation and gathering fixes these deferred races.Tests were inspected, not run, per the read-only review constraints.
BLOCKING: 0
Reviewed head
d24049d827at 2026-11-12T01:11:38Z by codex exec (read-only sandbox).