fix(opencode): keep local web UI and Quotio thinking compatible#20894
fix(opencode): keep local web UI and Quotio thinking compatible#20894RaviTharuma wants to merge 2 commits intoanomalyco:devfrom
Conversation
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
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
|
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 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. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
Issue for this PR
Closes #20895
Type of change
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 Anthropicvariant=maxto the highest live-supported effort so Quotio-backed Claude thinking requests stop failing.How did you verify your code works?
bun typecheckinpackages/opencodebun test test/session/llm.test.tsbun test test/session/message-v2.test.tsbun test test/provider/transform.test.tsbun run build --singleopencode run --variant max --thinking -m anthropic/claude-opus "reply with exactly ok"http://127.0.0.1:4096/with a fresh Claude sessionScreenshots / recordings
Web UI verification was done against the live local server at
http://127.0.0.1:4096/; no separate recording attached.Checklist