Skip to content

fix(restart): preserve displayName across respawn - #61

Merged
myobie merged 1 commit into
mainfrom
fix/restart-preserve-display-name-main
Jul 8, 2026
Merged

fix(restart): preserve displayName across respawn#61
myobie merged 1 commit into
mainfrom
fix/restart-preserve-display-name-main

Conversation

@myobie

@myobie myobie commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

pty restart (and the other restart paths) re-spawned the session daemon from stored metadata but dropped displayName. A restarted session came back reading as its raw id (e.g. claude-203827) instead of its name — breaking session naming and the TUI peek. Tags were already preserved; only the display name was lost.

Fix

Forward meta.displayName at all three restart call sites, matching the existing run -a re-create path (cli.ts ~L1048):

  • cmdRestartpty restart <ref>
  • handleDeadSessionpty attach -r / restart-on-dead prompt
  • interactive doRestart — Enter on a dead session in the picker

Each uses the same guarded spread: ...(meta.displayName ? { displayName: meta.displayName } : {}).

Test

Adds a driven regression test in tests/display-name.test.ts that creates a session with --name "My Service" --tag role=web, restarts it, and asserts both displayName and tags survive. Verified it fails without the fix (expected undefined to be 'My Service') and passes with it.

  • display-name suite: 27/27 green
  • tui suite: 29/29 green
  • Manual end-to-end: restart of id=web1 name='Web Frontend' tag role=web keeps both name and tags, status back to running.

Notes

Independent bugfix targeting main (the bug is present on both main and the held reboot #60 branch). Can be cherry-picked into the reboot cutover as needed.

pty restart / attach-restart / interactive doRestart re-spawned the
daemon from stored metadata but dropped displayName, so a restarted
session read as its raw id (e.g. claude-203827) instead of its name —
breaking naming and the TUI peek. Forward meta.displayName at all three
restart call sites, matching the existing `run -a` re-create path.
Tags were already carried. Adds a driven regression test that fails
without the fix.
@myobie
myobie merged commit d031749 into main Jul 8, 2026
1 check passed
@myobie
myobie deleted the fix/restart-preserve-display-name-main branch July 8, 2026 17:05
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