Skip to content

fix(opencode): keep local web UI and Quotio thinking compatible#20894

Open
RaviTharuma wants to merge 2 commits intoanomalyco:devfrom
RaviTharuma:fix/quotio-web-ui-thinking
Open

fix(opencode): keep local web UI and Quotio thinking compatible#20894
RaviTharuma wants to merge 2 commits intoanomalyco:devfrom
RaviTharuma:fix/quotio-web-ui-thinking

Conversation

@RaviTharuma
Copy link
Copy Markdown

@RaviTharuma RaviTharuma commented Apr 3, 2026

Issue for this PR

Closes #20895

Type of change

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

What does this PR do?

This keeps the local web UI in sync with a locally built backend instead of always proxying app.opencode.ai, which was causing frontend/backend drift on preview binaries. On top of that it hardens Gemini schema sanitization for large MCP tool payloads, sanitizes malformed unicode before provider handoff, and clamps Anthropic variant=max to the highest live-supported effort so Quotio-backed Claude thinking requests stop failing.

How did you verify your code works?

  • ran bun typecheck in packages/opencode
  • ran bun test test/session/llm.test.ts
  • ran bun test test/session/message-v2.test.ts
  • ran bun test test/provider/transform.test.ts
  • ran bun run build --single
  • ran opencode run --variant max --thinking -m anthropic/claude-opus "reply with exactly ok"
  • verified the live web UI on http://127.0.0.1:4096/ with a fresh Claude session

Screenshots / recordings

Web UI verification was done against the live local server at http://127.0.0.1:4096/; no separate recording attached.

Checklist

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

Serve the local app dist when it is present so preview binaries stop mixing a patched backend with the hosted web client. At the same time, harden message and schema transforms for Quotio-routed Gemini and Claude traffic, sanitize malformed unicode before provider handoff, and clamp Anthropic max-effort requests to the highest supported live value instead of failing at runtime.

Constraint: Quotio/OpenAI-compatible Gemini rejects several large MCP schema shapes and Anthropic via Quotio rejects adaptive effort="max" on the affected path

Rejected: Disabling thinking or MCP tools | user explicitly required full functionality

Rejected: Editing Quotio config again | local runtime should be fixed in OpenCode instead

Confidence: high

Scope-risk: moderate

Reversibility: clean

Directive: Keep web preview assets and backend behavior from the same build; do not reintroduce hosted UI proxying when local dist is available

Related: anomalyco#20890

Related: anomalyco#20891

Tested: bun typecheck (packages/opencode)

Tested: bun test test/session/llm.test.ts

Tested: bun test test/provider/transform.test.ts

Tested: bun run build --single

Tested: opencode run --variant max --thinking -m anthropic/claude-opus "reply with exactly ok"

Tested: Live web UI request on http://127.0.0.1:4096 returning ok in a fresh session
The upstream test harness evolved while the fix branch was rebased. This follow-up aligns the capture helper with the rawBody field and marks the new unicode regression test async so the branch stays green on current dev without changing runtime behavior.

Constraint: Avoid amending the already-created feature commit; keep the rebase repair isolated

Rejected: Fold into the previous commit via amend | not explicitly requested

Confidence: high

Scope-risk: narrow

Reversibility: clean

Directive: Keep branch-local verification helpers in sync with upstream test harness shape when rebasing long-lived fixes

Tested: bun typecheck (packages/opencode)

Tested: bun test test/session/llm.test.ts

Tested: bun test test/session/message-v2.test.ts

Tested: bun test test/provider/transform.test.ts
@github-actions github-actions bot added needs:title needs:compliance This means the issue will auto-close after 2 hours. labels Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Hey! Your PR title Fix local web UI drift and Quotio Claude/Gemini compatibility doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

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

Based on my search, I found one potentially related PR:

This PR addresses hardening embedded web UI serving, which relates to the "serve local packages/app/dist assets from the embedded instance router" change in the current PR #20894.

All other search results either returned only the current PR #20894 itself (which should not be counted as a duplicate of itself) or returned historical Gemini/schema sanitization fixes that are related but not duplicates of the specific combination of changes in this PR.

@RaviTharuma RaviTharuma changed the title Fix local web UI drift and Quotio Claude/Gemini compatibility fix(opencode): keep local web UI and Quotio thinking compatible Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 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 github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local web UI can drift from the local backend and break Quotio thinking flows

1 participant