Skip to content

fix: a peer role survives a changed session id (lets-f8x54) - #191

Merged
restarter merged 9 commits into
mainfrom
lets-f8x54-a-resumed-session-keeps-its-peer-identity-and-a-na
Sep 23, 2026
Merged

restarter merged 9 commits into
mainfrom
lets-f8x54-a-resumed-session-keeps-its-peer-identity-and-a-na

Conversation

@restarter

Copy link
Copy Markdown
Owner

Summary

A LETS session keyed its peer role (.lets/sessions/peers/<session-id>.role) by the Claude Code session id. /clear and an in-session /resume re-mint that id under the same process, so the role was pruned as if the session had exited and the orchestrator or worker went dark until someone re-ran /lets:start. The fix repairs the state whenever it breaks, whatever caused it:

  • Carry the role to the new id. Any lets peers call and the SessionStart hook move a role file whose holder's id was re-minted in the same process (same pid, process started no later than the role was written - the registry's startedAt). A reused pid is still pruned.
  • Restore a lost role from its anchor. A worker from its branch's task:; an orchestrator from a name set with /rename, only when no live session holds it and exactly one dead holder had it. Two live sessions under one name still get name_held / --takeover.
  • A session with no name still sends, labelled <role>/<session6>.
  • Every peer dead end carries a remediation line that /lets:orc and /lets:start print verbatim.

Every role write is decided from disk under peers.lock (found in two Codex review rounds: concurrent reclaim, stale planned move, ties between old roles).

Changes

  • d2aef8b feat: tell a re-minted session id from a reused pid
  • 130b5d4 feat: carry a role file to its session's new id
  • d95106a feat: restore a session's own role from its anchor
  • 9dd4d05 feat: let a session with no name send
  • f536bea feat: give every peer dead end its remedy
  • 7666249 feat: heal the peer role when a session starts
  • 5e86187 docs: document peer identity healing
  • 1e4d311 fix: decide peer role writes under the lock

Verification

  • make test (race), make lint (0 issues), GOOS=windows go vet ./...
  • Live smoke on Claude Code 2.1.280 with the built binary: /clear moved an orchestrator role to the new id; kill -9 + a fresh agent renamed to the same name resolved as self with its scope; an unregistered sender framed as from="peer/<session6>". The hook path is covered by a unit test only (the installed plugin runs the released binary).

Task

lets-f8x54: A resumed session keeps its peer identity, and a nameless sender can still deliver


Generated with LETS plugin

🤖 Generated with Claude Code

restarter and others added 9 commits September 23, 2026 17:59
/clear and an in-session /resume re-mint the session id under the same
process; startedAt tells that apart from a pid reused by a new process.

Task: lets-f8x54

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Any lets peers call now moves a role file whose holder's id was re-minted
in the same process, instead of pruning it as a reused pid.

Task: lets-f8x54

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A session with no role file gets it back on its next lets peers call:
a worker from its branch's task, an orchestrator from a user-set name
with exactly one dead holder. Two live holders still go through name_held.

Task: lets-f8x54

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The sender's name is only a label on a claim; a session with no registry
name frames as <role>/<session6> instead of losing the channel.

Task: lets-f8x54

Co-Authored-By: Claude Opus 5.5 <[email protected]>
role and orchestrator envelopes carry a remediation line with every
reason; the orc skill and /lets:start print it verbatim, so a dead end
never becomes an improvised hand-routed message.

Task: lets-f8x54

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SessionStart on startup, resume and clear carries this session's role to
its new id or rebuilds it from its anchor, best-effort and silent.

Task: lets-f8x54

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Task: lets-f8x54

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Two review rounds found writes decided from a view read before
peers.lock: two sessions could both reclaim one name, a planned move
could overwrite a role written since, and a tie between two old roles
was broken by session-id order or by a later restore. Every write now
recomputes from disk under the lock, a tie restores nothing, and the
unsendable remedy follows the refusal's reason.

Task: lets-f8x54

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@restarter
restarter merged commit 514afff into main Sep 23, 2026
3 checks passed
@restarter
restarter deleted the lets-f8x54-a-resumed-session-keeps-its-peer-identity-and-a-na branch September 23, 2026 17:48
@restarter restarter mentioned this pull request Sep 23, 2026
restarter added a commit that referenced this pull request Sep 23, 2026
Version bump for v0.9.2. `make bump VERSION=0.9.2` edited the
version-source files plus the two shipped tracker adapters, renamed
`[Unreleased]` to `[0.9.2]`, and committed only after `make test`, `make
build` and `verify-versions` passed.

**Rebuilt.** The first cut of this branch was taken at `58e2441`, before
lets-f8x54 landed. Rather than let that fix fall under a fresh empty
`[Unreleased]` and miss the release, the branch was recreated from main
at `514afff` and the bump re-run, then force-pushed. The 0.9.2 section
now carries all 15 entries of this round.

What ships: `--fix` across check / review / handoff (#189), the
implementers run mode and `/lets:execute` picker change (#187), handing
an approved plan to an agent tab (#184), `lets worktree record` and the
vanished-worker fix (#186), the peers reachability batch (#185),
`/lets:orc --yes` (#183), the language-rule split (#188), and a peer
role that survives a changed session id (#191).

Known defects shipping with this release, stated deliberately rather
than discovered later: `/lets:done` still creates a duplicate PR when
one is already open (lets-0g49b); the session boundary still breaks on a
branch reused after its PR merged (lets-2t5ns); worktree provisioning
correctness (lets-41cpf) and parallel implementers (lets-7dwc1) are
unfinished. None is new, and none is made worse here.

After merge: `make release-tag VERSION=0.9.2`, then curated release
notes.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

1 participant