feat(opencode): add --resume session picker#38878
Open
quinnjr wants to merge 1 commit into
Open
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential duplicate found:
No other duplicate PRs were found. PR #26432 and #36774 are related to session picker functionality but address different concerns (root sessions request and crash prevention respectively). |
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.
Issue for this PR
Closes #36134
Refs #18569 — the picker covers the "find and resume an old session" friction there, but resuming by session name (what it literally asks for) is not part of this PR.
Type of change
What does this PR do?
Adds
opencode --resume(andopencode attach --resume): boots the TUI straight into the existing session picker for the current directory. This is option A from the linked issue.Today, resuming anything but the latest session means either
opencode session list+ copy-pasting an opaqueses_...id into-s, or booting the TUI and opening/sessionsby hand. Claude Code (claude --resumeopens its picker) and Codex (codex resumeopens a picker scoped to the cwd,--lastfor most recent) both ship this; not having it is recurring friction for people switching over (both linked issues).Implementation:
--resumeflag on the default command andattach; mutually exclusive with--continue/--session, rejected with--mini(no picker surface there). Headlessrunintentionally untouched, per the issue's scope.--resume(previously--continue-only), then opensDialogSessionList— the same dialog/sessionsuses, directory-scoped; no new UI.--forkstill requires--continue/--session; forking from the picker would need fork-on-select in the dialog and is deliberately out of scope.How did you verify your code works?
test/cli/tui/thread.test.ts), bootstrap blocking/fetch-once forresume(packages/tui/test/cli/cmd/tui/sync-resume.test.tsx), and app-lifecycle tests for picker-opens vs toast-when-empty (packages/tui/test/app-lifecycle.test.tsx). Regenerated theattach --helpsnapshot.bun testfrompackages/opencode(15 pass) andpackages/tui(28 pass);bun typecheckclean in both; repo-wide typecheck also ran green via the pre-commit hook.bun dev --resumein a directory with sessions -> picker opens (below), selecting one resumes it; in a directory with none -> toast.--resume --continue,--resume --mini,--resume --forkall exit 1 with clear errors.bun dev --resumein any directory with sessions.Screenshots / recordings
opencode --resumein a directory with existing sessions:Checklist