Title: Port Pi's fork-from-an-earlier-message flow whole by navbytes · Pull Request #2 · navbytes/opencode-plugins · GitHub
Open Graph Title: Port Pi's fork-from-an-earlier-message flow whole by navbytes · Pull Request #2 · navbytes/opencode-plugins
X Title: Port Pi's fork-from-an-earlier-message flow whole by navbytes · Pull Request #2 · navbytes/opencode-plugins
Description: Pressing ⏎ on a row above where you are now opened a yes/no confirm and then, separately, "Summarize the branch you are leaving?". Pi asks one question, and that question is the confirmation. It also summarizes something narrower than we did. Read from Pi's source (interactive-mode.ts#showTreeSelector → agent-session.ts#navigateTree → compaction/branch-summarization.ts) rather than from the docs, so the semantics match rather than the wording. What changed before now dialog on ⏎ yes/no confirm, then a separate summary picker one picker; its title says what ⏎ will do, so the choice is the confirmation esc in the picker jumped anyway, silently without a summary back on the same row, nothing forked cancel the custom prompt silently meant "no summary" back to the three choices (Pi's loop) what gets summarized the whole current session only the turns the move abandons order of operations fork first, then summarize abort stream → draft → move → inject ┌ Fork & prefill this turn? ───────────────────────────────────────────────┐ │ No summary start clean · nothing carried over│ │ Summarize everything below this point carry the 3 turns · ~14k over… │ │ Summarize with a custom prompt the same, with your own focus │ └──────────────────────────────────────────────────────────────────────────┘ A switch to another branch has no picked point, so its middle answer reads "Summarize what you are leaving". jumpSummary: "never", and a jump with nothing below the selected point, degrade to the plain confirm. "Everything below that point" The substantive piece. Pi collects the entries from the old leaf back to the common ancestor with the target and summarizes those; OpenCode has no such tree, since each branch is its own session and session.fork re-ids the copied prefix. So core/tree.ts#spineOf reduces a session to its ordered sessionID:messageID path from the root — an ancestor's copied prefix keeps the ancestor's own ids — and core/actions.ts#abandonedTail takes the deepest entry present in both spines as the common ancestor; everything after it in the current session is the tail. A fork plan cuts the target spine before its boundary, because session.fork copies messages strictly before it. Redoing trunk turn 2 summarizes turns 2–3. Switching from a branch to a sibling summarizes the branch's own turns and not the shared trunk. buildSpineMap is refactored onto spineOf so the walk has one definition. Order of operations Matching navigateTree: abort a streaming reply first (so the summary covers the reply as it actually ended) → draft the summary while nothing has moved yet → fork or switch → inject at the destination, the way Pi attaches its branch_summary entry at the new leaf. Drafting first is what makes esc meaningful: it aborts the helper session's in-flight reply and the whole jump. A summary that fails (rather than being aborted) still lets the move through, with a notice — the alternative is stranding you on the session you asked to leave. summarizeInto splits into draftBranchSummary + injectBranchSummary, and the transcript serialization the merge drafter already uses (core/decision.ts#transcriptText) is reused for it. Tests 11 new unit tests: the tail computation across trunk / branch / sibling / ancestor jumps against the existing fixture, and the dialog copy. A new pty e2e against the real OpenCode 1.18 TUI: all three options on screen in Pi's order, esc forks nothing, exactly one branch.opened{kind:"redo"}, summary.recorded, and the fork's next model request carries the injected summary (a noReply injection only reaches the provider on the following turn). Full unit suite, typecheck and build green. Not verified here: the server half of the e2e suite cannot run in this container — a bare opencode serve in an empty directory with no plugin installed never binds. That half is untouched by this change; worth a local bun run test:e2e before release. Changelog v0.2.2 was already tagged from 960105a, the commit this branch forks from, so its (unreleased) heading was stale. This adds a ## 0.2.3 (unreleased) section above it and dates ## 0.2.2 — 2026-09-03. 🤖 Generated with Claude Code https://claude.ai/code/session_01BrwAnTfTmJSmFwVn3DDFxr Generated by Claude Code
Open Graph Description: Pressing ⏎ on a row above where you are now opened a yes/no confirm and then, separately, "Summarize the branch you are leaving?". Pi asks one question, and that question is the confirmat...
X Description: Pressing ⏎ on a row above where you are now opened a yes/no confirm and then, separately, "Summarize the branch you are leaving?". Pi asks one question, and that question is the c...
Opengraph URL: https://github.com/navbytes/opencode-plugins/pull/2
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:80569a81-bf11-149b-54e5-c7f315bab7c3 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A8A8:BB75:9C8CE8:CF2792:6B01BA3B |
| html-safe-nonce | 5839b847f595488121a3063d7baa5051841d6e1689bbb16d18459d5a651528db |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOEE4OkJCNzU6OUM4Q0U4OkNGMjc5Mjo2QjAxQkEzQiIsInZpc2l0b3JfaWQiOiI0NDYwNTExMzcwNDk2MDMxMjkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1e1432da958e572d5afc80b0528436dc465c85aa9ca7267c0faeba510af8900c |
| hovercard-subject-tag | pull_request:4438561617 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/navbytes/opencode-plugins/pull/2/files |
| twitter:image | https://avatars.githubusercontent.com/u/25281802?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/25281802?s=400&v=4 |
| og:image:alt | Pressing ⏎ on a row above where you are now opened a yes/no confirm and then, separately, "Summarize the branch you are leaving?". Pi asks one question, and that question is the confirmat... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/navbytes/opencode-plugins git https://github.com/navbytes/opencode-plugins.git |
| octolytics-dimension-user_id | 25281802 |
| octolytics-dimension-user_login | navbytes |
| octolytics-dimension-repository_id | 1354341697 |
| octolytics-dimension-repository_nwo | navbytes/opencode-plugins |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1354341697 |
| octolytics-dimension-repository_network_root_nwo | navbytes/opencode-plugins |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width