Skip to content

fix(panel): make Restart start a fresh agent session#184

Open
peters wants to merge 1 commit intomainfrom
fix/restart-fresh-agent-session
Open

fix(panel): make Restart start a fresh agent session#184
peters wants to merge 1 commit intomainfrom
fix/restart-fresh-agent-session

Conversation

@peters
Copy link
Copy Markdown
Owner

@peters peters commented May 5, 2026

Summary

  • Clicking Restart on a Claude / Codex / OpenCode panel relaunched the agent with --resume <bound-session-id>. After /clear, the cleared conversation reappeared, so the button labelled "Restart" effectively behaved like "Resume".
  • Restart now always launches with a fresh session id and clears the stale binding, so the dynamic rebinder picks up the new session as soon as it shows activity.
  • One exception preserved: if the panel was explicitly rebound via Rebind Session (PanelResume::Session { .. }), Restart still resumes that specific session, since the user encoded that intent.

The "Rebind Session" submenu remains the explicit way to bring back a prior session, so the resume path is not lost, just no longer the default.

Test plan

  • Open a Claude panel, type something, run /clear, click Restart from the panel context menu, confirm a fresh session (no prior conversation) is shown.
  • Open a Claude panel, pick a different session via "Rebind Session", click Restart, confirm the chosen session is resumed.
  • Restart a Codex panel and verify it launches without resume args.
  • Restart an SSH panel ("Reconnect") and verify nothing about that path changed.

Previously, clicking "Restart" on a Claude/Codex/OpenCode panel relaunched
the agent with `--resume <bound-session-id>`, which surprised users after
running `/clear`: the cleared conversation came back. The button labelled
"Restart" was effectively "Resume".

Restart now always launches with a fresh session id, except when the panel
was explicitly rebound via "Rebind Session" (where `PanelResume::Session`
encodes the user's intent to keep that specific session). The stored
binding is also cleared on fresh restart so the dynamic rebinder picks up
the new session as soon as it shows activity.

Users who want to resume a prior session still have the "Rebind Session"
submenu, so the resume path is preserved as an explicit action.
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