Repository navigation
New agents never start on first boot: --resume <name> opens a picker, and the session is never named (#23) - #55
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
boot-agents.sh and workspace.sh ran `claude --resume <name> || claude`. On a new agent --resume <name> opens a picker instead of failing, so the fallback never ran and the session was never named. Both now pin the session id in <agent home>/.session-id, launch a first boot with --session-id <id> -n <name>, resume by id afterwards, start fresh when the pinned transcript is gone or empty, and migrate a hand-named session once. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
Owner
Author
|
Review leg: Aggy (AI review agent). Verdict: ready to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Simon · project thread
Closes #23
Before:
boot-agents.shandworkspace.shlaunched a claude agent withclaude --resume <name> || claude. On a brand new agent--resume <name>doesnot fail, it opens an interactive "No sessions match" picker and waits, so the
|| claudefallback never ran and a headless boot sat at the picker. A sessionstarted any other way carried no name until someone typed
/rename <name>init, and every later resume depended on that name.
After: each claude agent's session is pinned by id in
<agent home>/.session-id. A first boot mints a UUID, writes it, and launchesclaude --session-id <id> -n <name>; later boots launchclaude --resume <id> -n <name>. The name is on the prompt border from thefirst boot, so there is no
/renamestep and no picker. A pinned session whosetranscript is missing, or holds no messages, starts a fresh named session under
a new id rather than leaving a dead pane. An agent that predates the pin but has
a session someone named by hand is found by that name and pinned once, so it
resumes its conversation instead of starting over.
How: the logic lives in one new sourced file,
packages/base/bin/claude-session.sh,so the two launchers cannot drift.
workspace.shcarried the identical launchline and the same bug, so it is fixed here too. Nothing about the codex runtime
changes.
boot-agents.test.shgains seven cases: first boot, relaunch, missingtranscript, metadata-only transcript, corrupt pin, migration, and the
transcript-directory derivation. The base README and the pane sample in
INSTALL.md are updated.
SPEC: .specs/23-first-boot-agents-bv0u0h/SPEC.md
Test plan:
boot-agents.test.shpasses 45 of 45, and the four paths above werealso checked live against Claude Code 2.1.292 in tmux with a scratch
AGENTS_HOMEandCLAUDE_CONFIG_DIR.typecheck,check:boundaries,check:leaks,check:licence,check:lib-version,check:dashesand thedeck test suite pass. Four base tests fail identically on
mainin the sameenvironment and are not from this change: the
create-agent.test.ts"CANNOT VERIFY when there is no runtime on PATH" case (a real claude is on
PATH there), and the
inbox.test.sh,inbox-push.test.shandpane-idle.test.shsuites.Known limitation, carried over: a pinned session that
--resumerejects forsome other reason (a corrupt transcript, a CLI version mismatch) still leaves a
shell in the pane. Codex has a verify-and-fall-back step for this; claude does
not. It is in the SPEC's Follow-ups rather than widened into this change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01V7UNCAsTAEN8Lq3qXWMLat
Generated by Claude Code