Skip to content

feat: configurable web UI title via OPENCODE_WEB_UI_TITLE - #47907

Closed
neumark wants to merge 9 commits into
anomalyco:devfrom
neumark:web-ui-title
Closed

neumark wants to merge 9 commits into
anomalyco:devfrom
neumark:web-ui-title

Conversation

@neumark

@neumark neumark commented Sep 8, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #47906

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds an OPENCODE_WEB_UI_TITLE env var that overrides the <title> of the served web UI, so multiple instances can be told apart in the browser tab strip. Today packages/app/index.html hardcodes <title>OpenCode</title> and every tab looks identical.

The rewrite lives in packages/opencode/src/server/shared/ui.ts and covers both paths that serve HTML: the embedded UI and the proxied dev UI. Details worth reviewing:

  • The title is HTML-escaped, and String.replace is called with a function so $ sequences in a configured title aren't treated as replacement patterns.
  • On the embedded path the response now returns the rewritten HTML. The CSP hash is computed from that same rewritten string, so the theme-preload script hash still matches.
  • Unset or whitespace-only value passes the HTML through untouched.

How did you verify your code works?

Three tests added to packages/opencode/test/server/httpapi-ui.test.ts:

  • embedded override, asserting the escaping and that the CSP hash still matches the preload script
  • proxied override
  • blank value leaves the title unchanged

bun test test/server/httpapi-ui.test.ts in packages/opencode: 15 pass, 0 fail.

Screenshots / recordings

Not applicable, the only visible change is the browser tab text.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code

https://claude.ai/code/session_01SD3x4f2sEBGjdBg7HECpky

…ions to fresh workspaces

Per-tab CoW isolation for agent VMs: when OPENCODE_NEW_SESSION_WORKSPACE is
set to a registered workspace adapter type, POST /session (the exact call a
new browser tab makes) creates a fresh workspace of that type and binds the
session to its directory + workspaceID — every tab gets its own overlayfs
over the shared repos base, while subagents/children (parentID payloads and
internal creates) keep sharing their parent's workspace.

- explicit workspaceID payloads route the session into that workspace's
  directory (parity with the ?workspace= query routing)
- unregistered adapter type (plugin absent, fresh boot) degrades to a
  plain trunk session, never an error
- remote targets are skipped (only local targets make sense as a directory)
- Session.CreateInput gains an optional directory that wins over the routed
  instance directory

Integration tests: httpapi-session-workspace-default.test.ts (trunk default,
fresh-workspace binding, parallel distinctness, parented-creates untouched,
explicit-ID reuse, missing-adapter fallback, subagent-shares-overlay).
…ject resolution dropped them unless their workspace directory happened to be an open project card, so they flickered on the home page only while a session tab kept the card alive
…ord extra.origin at workspace creation, resolve home records/labels/open-flow through it instead of the workspace slug, and stop per-directory context stores from adopting workspace sessions delivered on the origin's event channel (the same session showed under both)
…line, release lineage, build/release process, and the fc-opencode deployment contract
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Configurable web UI title to tell multiple instances apart

2 participants