Skip to content

feat(app): embed web ui in binary#12829

Closed
BlankParticle wants to merge 2 commits intoanomalyco:devfrom
BlankParticle:feat/embdeded-webui
Closed

feat(app): embed web ui in binary#12829
BlankParticle wants to merge 2 commits intoanomalyco:devfrom
BlankParticle:feat/embdeded-webui

Conversation

@BlankParticle
Copy link
Copy Markdown
Contributor

@BlankParticle BlankParticle commented Feb 9, 2026

What does this PR do?

While building opencode binary, also build the web ui and bundle it with the binary to keep the web ui in sync
also very useful in air gapped systems
extra flag to disable and use hosted version if needed

How did you verify your code works?

Tested web/serve with opencode and checked headers

fixes #8549
fixes #6352
fixes #12445
fixes #12083

and countless related issues

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 9, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@BlankParticle BlankParticle force-pushed the feat/embdeded-webui branch 3 times, most recently from a18c3ed to fb3dd29 Compare February 14, 2026 18:40
@BlankParticle BlankParticle changed the title feat(app): embed web ui in binary with flags to use proxy feat(app): embed web ui in binary Feb 14, 2026
@AyRickk
Copy link
Copy Markdown

AyRickk commented Feb 26, 2026

Any news on this PR ? I'm interested in this feature

@BlankParticle
Copy link
Copy Markdown
Contributor Author

BlankParticle commented Feb 26, 2026

Any news on this PR ? I'm interested in this feature

I will ping maintainers on this, they said they were interested in doing this themselves

@Chetic
Copy link
Copy Markdown

Chetic commented Feb 27, 2026

Since I'm also very interested in this PR I've tested these changes in a fully air-gapped Docker container (--network none). The container builds the binary from the PR branch, starts opencode serve, and runs Playwright tests against it with a real Chromium browser.

Against v1.2.15 (before this PR), two tests fail:

Test Why it fails
Web GUI index page loads Page title is empty — proxy to app.opencode.ai can't connect
SPA routing serves index.html for deep paths Same proxy issue — /some/deep/path returns empty page

Against this PR branch, both pass.

  • / serves a real page — Chromium navigates to the root URL and the page has the "OpenCode" title, meaning index.html is served from the embedded assets instead of proxying to an unreachable external host.
  • Deep paths return the SPA shell — Navigating to /some/deep/path no longer returns an empty page. The server falls back to index.html so client-side routing works, which is the expected behavior for a single-page app.

We also verified that all JS/CSS/font assets referenced by index.html load successfully — no failed local requests in Chromium while the page renders.

@farkas93
Copy link
Copy Markdown

farkas93 commented Mar 26, 2026

Honestly, this should be the default and the way it is done now with the CDN should get a disclaimer and an explanation for when and how that is useful? It just destroyed quite some trust towards this project realizing that the team went an extra mile to separate the webUI from the server, only to take away control from the user on what webUI code they are running.

@thdxr
Copy link
Copy Markdown
Member

thdxr commented Mar 26, 2026

had to make some changes to this PR and had to move it to a new branch so closing this for now

@thdxr thdxr closed this Mar 26, 2026
@BlankParticle BlankParticle deleted the feat/embdeded-webui branch March 26, 2026 14:36
@BlankParticle
Copy link
Copy Markdown
Contributor Author

had to make some changes to this PR and had to move it to a new branch so closing this for now

no worries, nice to see this getting shipped at last, I almost gave up on this lol

@farkas93
Copy link
Copy Markdown

could someone link the branch where this feature was moved pls?

@capi
Copy link
Copy Markdown

capi commented Mar 28, 2026

@farkas93 As far as I understood #19217 (comment), this is now part of 1.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment