build(opencode): shrink single-file executable size#22362
Merged
Hona merged 6 commits intoanomalyco:devfrom Apr 14, 2026
Merged
build(opencode): shrink single-file executable size#22362Hona merged 6 commits intoanomalyco:devfrom
Hona merged 6 commits intoanomalyco:devfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a compatibility shim for GitHub Copilot (and similar OpenAI-compatible gateways) so compaction/requests with prior tool-call history don’t fail when no active tools are enabled, plus a targeted regression test and build output-size optimizations for Bun standalone binaries.
Changes:
- Inject a stub
_nooptool when sending requests to LiteLLM proxies or@ai-sdk/github-copilotand the message history contains tool calls but the active tool set is empty. - Add a session LLM test that exercises the GitHub Copilot request shape for the above compatibility path.
- Enable
format: "esm",minify: true, andsplitting: truein the Bun standalone build to reduce single-file binary size.
Reviewed changes
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/opencode/src/session/llm.ts | Extends existing “dummy tool injection” compatibility behavior to also cover GitHub Copilot’s OpenAI-compatible gateway. |
| packages/opencode/test/session/llm.test.ts | Adds a regression test ensuring _noop is included in the outgoing request tools when history contains tool calls and active tools are empty. |
| packages/opencode/script/build.ts | Turns on ESM output, minification, and splitting for Bun compile builds to reduce binary size. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mrsimpson
pushed a commit
to mrsimpson/opencode
that referenced
this pull request
Apr 14, 2026
xywsxp
pushed a commit
to xywsxp/opencode
that referenced
this pull request
Apr 24, 2026
dgokeeffe
pushed a commit
to dgokeeffe/opencode-databricks
that referenced
this pull request
May 6, 2026
This was referenced May 6, 2026
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
splittingandminifyin the opencode build script--skip-embed-web-uibuild we measuredTesting