This repository was archived by the owner on Nov 7, 2026. It is now read-only.
Repository navigation
fix(opencode): backport small upstream fixes - #403
Merged
Merged
Conversation
- Keep all four assigned fixes as separate full-SHA cherry-pick -x commits. - Adapt producer-driven regressions at the fork RPC, browser launcher, V2 undo, and Copilot stream/replay boundaries. - Prove each changed behavior with focused red/green runs, then record provenance and compatibility in CHANGESET.md. Claude-Session: unknown
Author
|
Session ID: unknown |
…nomalyco#54936) Co-authored-by: James Long <[email protected]> (cherry picked from commit bbad8f3)
…co#51538) Co-authored-by: rekram1-node <[email protected]> (cherry picked from commit b471c2b)
(cherry picked from commit d68031b)
…yco#54207) (cherry picked from commit b2a3926)
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
Claude-Session: unknown
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Closes swxtchio/swx-opencode#388
Scope
Backport anomalyco#54936, anomalyco#51538, anomalyco#45383, and anomalyco#54207 as four separate full-SHA
git cherry-pick -xcommits. The fork's existing V1/V2 owners are preserved; the upstream-only.changeset/rename-undo.mdis omitted becauseCHANGESET.mdis this fork's release ledger.Donor application and lineage
The refreshed ship base was
1b2e93436a988773e485cc49a924ea9274b6e7f0, equal toorigin/swxtch. Each standalone scratch trial at that base applied cleanly and nonempty; each branch donor commit below retains the full source trailer.bbad8f350f977272faf9d5d9fe652b412a153876: trial changedpackages/opencode/src/util/rpc.ts; branch donor commitae720339651804213f1610553d43d083a4d98f80; trailer(cherry picked from commit bbad8f350f977272faf9d5d9fe652b412a153876).b471c2b4495747353af768fbf2e0790c9d820ce2: trial changedpackages/opencode/src/mcp/browser.tsandpackages/opencode/test/mcp/browser.test.ts; branch donor commit73eb517cbccd495850e89ce583cb70a0db018075; trailer(cherry picked from commit b471c2b4495747353af768fbf2e0790c9d820ce2).d68031bc0d92e7c1bfb7a4ad1e7fa234b1cac756: trial changed.changeset/rename-undo.md,packages/core/src/git.ts,packages/core/test/git.test.ts, andpackages/core/test/session-revert.test.ts; branch donor commit4f77f76fed27869ccd1b8a969f2a0b345fc1031b; trailer(cherry picked from commit d68031bc0d92e7c1bfb7a4ad1e7fa234b1cac756). The upstream changeset note is removed in a compatibility commit; production behavior is complete and SessionV2 test plumbing is adapted.b2a3926e87e35fc7f6308521c4418067cddd5d0e: trial changedpackages/core/src/github-copilot/chat/convert-to-openai-compatible-chat-messages.ts,packages/core/src/github-copilot/chat/openai-compatible-chat-language-model.ts,packages/core/test/github-copilot/convert-to-copilot-messages.test.ts, andpackages/core/test/github-copilot/copilot-chat-model.test.ts; branch donor commitbbed4c571f581965bc4e9168fb76a3abda5593f8; trailer(cherry picked from commit b2a3926e87e35fc7f6308521c4418067cddd5d0e).upstream/devwas pinned at156bb610108c3da91c6963056f439e2acc1614f0; the branch/upstream merge-base remained696f41bc8e7586657375d53390925fc54c25d34cbefore and after the donor sequence. The V1 RPC donor is not an ancestor of thatupstream/devpin (git merge-base --is-ancestorreturned 1). No upstream merge parent or “Upstream syncs” entry was added.Focused behavioral evidence
Initial focused test results were collected on 2026-11-04 at behavior/test head
62112d0575531b9c3c8e3f01e50be2f3a9dc1661with Bun 1.4.2. Commands were run from the named package directory. For each changed behavior, the listed regression passed with the donor behavior restored and failed after that behavior was removed or reverted.RPC — cwd
packages/opencodebun test test/util/rpc.test.ts --test-name-pattern 'settles only the failed synchronous request'— green: 1 pass, 2 filtered, 0 fail. Removing thelistenerror reply made the in-test timeout reportmissing synchronous RPC result; removing client-side rejection made the failed result resolve instead of reject. The successful concurrent request and its event were asserted.bun test test/util/rpc.test.ts --test-name-pattern 'rejects a pending call when its worker handler rejects asynchronously'— green: 1 pass, 2 filtered, 0 fail. Removing thelistenrejection handler failed within the test withmissing asynchronous RPC result.bun test test/util/rpc.test.ts --test-name-pattern 'uses nested cause text when the worker error message is empty'— green: 1 pass, 2 filtered, 0 fail. Removing cause traversal returnedErrorinstead ofnested cause failure.Browser — cwd
packages/opencodebun test test/mcp/browser.test.ts --test-name-pattern 'reports a browser launcher that exited before openUrl returned'— green: 1 pass, 2 filtered, 0 fail. Removing the completed-childexitCodeobservation returned no error instead ofBrowser open failed with exit code 23.bun test test/mcp/browser.test.ts --test-name-pattern 'accepts a browser launcher that exited successfully before openUrl returned'— green: 1 pass, 2 filtered, 0 fail.bun test test/mcp/browser.test.ts --test-name-pattern 'reports a browser launcher that exits after openUrl returns'— green: 1 pass, 2 filtered, 0 fail; the fixture acknowledges the child-ready line, actual production listener registration, child exit release andcloseevent.Rename undo — cwd
packages/corebun test test/git.test.ts --test-name-pattern 'lists both sides of a rename as separate file changes'— green: 1 pass, 4 filtered, 0 fail. Removing--no-renamesomittedold name.txtfrom the productionGit.tree.filesresult.bun test test/session-revert.test.ts --test-name-pattern 'undoes a projected file rename and clears it without losing later edits'— green: 1 pass, 0 fail, 9 assertions. Removing--no-renamesmade the actual SessionV2 stage leave both paths absent; the regression failed because the original path was not restored. The green path also verifies returned added/deleted statuses, contents, clear, and the unrelated later edit.Copilot interleaved reasoning — cwd
packages/corebun test test/github-copilot/copilot-chat-model.test.ts --test-name-pattern 'should accept successive interleaved reasoning_opaque values'— green: 1 pass, 13 filtered, 0 fail. Restoring the old second-value error producedInvalidResponseDataError.bun test test/github-copilot/copilot-chat-model.test.ts --test-name-pattern 'should emit and replay interleaved reasoning in segment order'— green: 1 pass, 13 filtered, 0 fail. Keeping only the first stream opaque failed the second-segment metadata assertion; overwriting reasoning text failed the test-builtreplayPrompt()bridge's converter-result concatenation assertion.bun test test/github-copilot/copilot-chat-model.test.ts --test-name-pattern 'should replay the latest interleaved reasoning_opaque value'— green: 1 pass, 13 filtered, 0 fail. Keeping only the first opaque failed latest finish/replay selection coverage.bun test test/github-copilot/convert-to-copilot-messages.test.ts --test-name-pattern 'should replay interleaved reasoning as concatenated text with the latest reasoning_opaque'— green: 1 pass, 18 filtered, 0 fail. This direct converter regression uses a hand-built assistant prompt; the actual adapter stream parts reach the converter through the test-builtreplayPrompt()bridge incopilot-chat-model.test.ts.Round 1 fix batch 1
The delayed-launcher case was updated in test commit
53699b8bf69fb5a704ee754fbbbbac1eff372c88. The child registers its stdin handler before it emitsready; theopenUrlseam awaits that line before returning. ThenewListenernotification is followed by a microtask check oflistenerCount("exit"), then the fixture releases the child; the child emitsreleasedbefore exiting, and the test waits forclose. Five-secondwithinbounds only guard missing acknowledgments; cleanup releases any still-live child over stdin, awaitsclose, and closes the readline interface. The production 500 ms window was not changed and there are no sleeps. With the production exit-reporting handler replaced by a no-op, all three acknowledgments complete and the test fails because it receivesunexpected-resultrather than the expected browser error. After restoring the handler, the focused case passed in six simultaneous invocations (6/6) under test-process CPU contention.The Copilot ledger entry now says what the test actually proves:
replayPrompt()is a test-built stream-parts-to-assistant-prompt bridge. It exercises the converter on real adapter-emitted values, but does not claim coverage of production history-to-prompt conversion.CHANGESET.mdno longer calls this “producer-to-replay.”bun typecheckpassed frompackages/opencode. The round-1 changeset check reportedok: #403 is recorded.