Skip to content

fix: recover Copilot conversations reliably after reboot - #1

Merged
millwright-software merged 1 commit into
millwright-software:mainfrom
er0826-dex:fix/copilot-reboot-recovery
Oct 22, 2026
Merged

millwright-software merged 1 commit into
millwright-software:mainfrom
er0826-dex:fix/copilot-reboot-recovery

Conversation

@er0826-dex

Copy link
Copy Markdown
Contributor

Summary

  • Replace context-relative copilot --continue restarts with persisted conversation UUIDs.
  • Recover older entries through a searchable conversation picker (Shift+R, or Enter when tmux is gone); save the selected binding before launching.
  • Assign IDs before new managed launches, including a persisted pending-first-launch state so interruption before launch does not strand an entry.
  • Handle live-pane respawn and post-reboot tmux recreation, persisting the new tmux name even across storage reloads.
  • Add CLI binding via session set <entry> copilot-session-id <uuid>, regression coverage, and recovery documentation.

Validation

  • go test -race -count=1 ./... passed with isolated HOME and tmux state.
  • go vet ./... and go build ./cmd/agent-desk passed.
  • Changed-code golangci-lint run --new-from-rev=HEAD passed before committing. Repository-wide lint still reports pre-existing errcheck/staticcheck/unused findings; unrelated code was left unchanged.
  • Isolated real-tmux smoke test exercised first launch, loss of tmux, explicit legacy binding, the actual Shift+R picker, and a second loss/recovery of the selected conversation. A fake Copilot executable verified exact arguments without making AI requests.

Boundaries

  • Standard managed launches require Copilot support for --session-id (checked before first launch).
  • Custom commands are preserved on launch; recovery refuses to silently discard their flags. Wrappers must include {command}.
  • Interactive conversation switches inside Copilot require explicit rebinding; directory recency is never treated as ownership.
  • No Copilot history, activity flags, or lock files are deleted.

Installed locally for verification; ready for upstream review and merge.

Persist explicit conversation identities, recover legacy entries through a picker, and distinguish pending first launches from existing history. Resume by UUID rather than context-relative recency.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@millwright-software
millwright-software merged commit 5b5d10f into millwright-software:main Oct 22, 2026
1 check passed
@er0826-dex

Copy link
Copy Markdown
Contributor Author

Follow-up fix in 3085707 addresses an uncovered legacy-data case: saved entries may have command copilot but tool claude or shell. Those labels bypassed the initial recovery path. Storage now recognizes the launch executable, and runtime detection no longer treats a Claude model inside Copilot as the Claude Code CLI.

Added regression coverage for both legacy labels, persisted normalization, command/model discrimination, and pinned detection after reload. Updated the isolated real-tmux smoke fixtures to use those mislabeled records and a Claude banner; picker recovery and repeated process-loss recovery pass. Affected-package race tests, build, vet and changed-code lint pass.

millwright-software added a commit that referenced this pull request Oct 26, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
millwright-software added a commit that referenced this pull request Nov 12, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants