fix(panel): make Restart start a fresh agent session#184
Open
Conversation
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.
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.
Summary
--resume <bound-session-id>. After/clear, the cleared conversation reappeared, so the button labelled "Restart" effectively behaved like "Resume".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
/clear, click Restart from the panel context menu, confirm a fresh session (no prior conversation) is shown.resumeargs.