feat(adapters): cherry-studio chat-client adapter#487
Open
rynfar wants to merge 1 commit into
Open
Conversation
Cherry Studio is a desktop Electron chat client. It's the first non-CLI
client to be onboarded — every existing adapter (OpenCode, Crush, Pi,
ForgeCode, Droid, Claude Code) is for a coding agent with its own MCP
tool runtime, but Cherry Studio is a pure chat UI that needs Claude's
server-side tools (WebSearch / WebFetch) to work natively.
Without an adapter, Cherry Studio falls through to OpenCode (the
default), which blocks WebSearch in favor of OpenCode's MCP equivalent.
The user sees "WebSearch tool not exposed in the session" and web
search is silently broken.
The new cherry-studio adapter:
- Allows WebSearch / WebFetch (verified independently against Max
OAuth: bundled claude binary + WebSearch returns real results).
- Blocks filesystem / shell tools by default. A chat-style LLM
shouldn't enumerate files on the proxy host unsupervised, even on
localhost. Operators who genuinely want filesystem access can use
a coding-agent adapter where tool calls are surveilled.
- Blocks Claude-Code-only orchestration tools (cron, plan/worktree
mode, etc.) — no chat-client equivalent.
- usesPassthrough = false. The SDK runs tools internally and folds
results into the assistant turn — exactly what a chat UI renders.
- supportsThinking = true. Cherry Studio renders thinking blocks
when the user enables them in its UI.
- No subagent routing, no MCP server, no file-change tracking.
Detection: Cherry Studio doesn't send a stable User-Agent (CherryHQ#10209
documents UA being overridden). Routes via:
- x-meridian-agent: cherry-studio (per request — the documented path)
- MERIDIAN_DEFAULT_AGENT=cherry-studio (global default)
Bonus fix: single source of truth for the adapter list. The settings UI
hardcoded ["opencode", "crush", "forgecode", "pi", "droid", "passthrough"]
in two places — both drifted from ADAPTER_MAP. claude-code was registered
for detection but never rendered in the settings UI, so its toggles were
silently inaccessible. ADAPTER_LABELS / ADAPTER_NAMES exports in detect.ts
become the single source; sdkFeatures.ts and settingsPage.ts consume them.
Adding cherry-studio + claude-code to the UI is automatic. Audit test
guards against future drift.
Tests: 21 new in cherry-studio-adapter.test.ts covering identity,
session/CWD, the load-bearing WebSearch/WebFetch unblocking, filesystem
blocking, chat-client behavior toggles, x-meridian-agent header
detection (incl. the cherrystudio alias and case-insensitivity), and
the adapter-list audit.
End-to-end verified by booting a test proxy on :3500 and POSTing
/v1/messages with `x-meridian-agent: cherry-studio` and a "WebSearch
the latest node.js version" prompt. Result: SDK invoked WebSearch,
returned real search result with citation, thinking blocks forwarded.
Full suite 1742/0. Build clean. Typecheck clean.
Note: tested without Cherry Studio itself in the loop — the adapter
correctness, detection, and SDK round-trip are verified server-side,
but Cherry Studio's specific UI rendering of citations/streaming needs
end-user verification. @BenIsLegit can validate before merge.
|
Thanks! I'll try it out today |
Owner
Author
|
Yes this is an issue another user reported im hoping to find some time to
day to tackle this.
…On Fri, May 8, 2026 at 10:02 AM BenIsLegit ***@***.***> wrote:
*BenIsLegit* left a comment (rynfar/meridian#487)
<#487 (comment)>
Realized I had Thinking and Thinking Passthrough disabled. Turned those
on, but it seems to really think it doesn't have web search tools available
now
image.png (view on web)
<https://github.com/user-attachments/assets/11c6ab6a-0365-4248-935a-698a865dfb40>
—
Reply to this email directly, view it on GitHub
<#487 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACWNASVCJFTYLM2Q5RTOQBL4ZYAK7AVCNFSM6AAAAACYSNTR4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DIMBXHA3DGNZYGM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
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.







Closes #481.
Why
Cherry Studio is a desktop chat client that, until this PR, falls through to the OpenCode adapter (the default fallback). OpenCode blocks
WebSearchandWebFetchbecause it has MCP equivalents (websearch_web_search_exa). Cherry Studio has no MCP equivalent and no client-side web access — when blocked, the user sees:and Claude can't search the web. Reported by @BenIsLegit in #481.
What
A new
cherry-studioadapter — the first chat-client adapter (every existing adapter is a CLI coding agent). The chat-client shape is the inverse of the coding-agent shape: web tools enabled, filesystem tools off-by-default, no MCP, no passthrough.WebSearch/WebFetchRead/Write/Bash/ etc.usesPassthroughgetAllowedMcpToolsbuildSdkAgentsDetection
Cherry Studio's User-Agent is overridden (CherryHQ#10209) so auto-detection isn't reliable. Routes via:
x-meridian-agent: cherry-studioheader (per-request — the documented path)MERIDIAN_DEFAULT_AGENT=cherry-studioenv var (global default)Aliases:
cherry-studio,cherrystudio(no hyphen).Bonus fix: single source of truth for the adapter list
While in there I noticed the settings UI hardcoded
["opencode", "crush", "forgecode", "pi", "droid", "passthrough"]in two places — both drifted fromADAPTER_MAP.claude-codewas registered for detection but never rendered in/settings, so its feature toggles were silently inaccessible. NewADAPTER_LABELS/ADAPTER_NAMESexports indetect.tsare the single source;sdkFeatures.tsandsettingsPage.tsconsume them. Addingcherry-studioAND fixing the latentclaude-codegap is automatic. An audit test guards against future drift.Why filesystem tools are blocked by default
A chat-style LLM shouldn't be able to enumerate
~/.sshor read/etc/secretson the proxy host because the user typed "what's in my home directory?" into Cherry Studio. Even on localhost, the user is rarely thinking "this chat sends Read/Bash to the server." Operators who genuinely want filesystem access can use a coding-agent adapter (where tool calls are surveilled by the calling tool) or open a follow-up issue if there's demand for a "trusted chat client" mode with broader access.Tests
21 new tests in
cherry-studio-adapter.test.ts:WebSearch/WebFetchNOT in blocked + incompatible lists (2)usesPassthrough,supportsThinking, etc. (7)x-meridian-agentdetection incl. alias and case-insensitivity (3)ADAPTER_LABELSresolves viaADAPTER_MAP, gets a feature config fromgetAllFeatureConfigs, and includescherry-studio+claude-code(4)Full suite 1742/0. Build clean. Typecheck clean.
End-to-end verification (server-side)
Booted a test proxy on
:3500(separate from prod on:3456, prod undisturbed throughout):Result:
stop_reason: tool_use(initial turn) →WebSearchinvoked with{"query": "latest node.js version 2026"}thinking→tool_use(WebSearch)→thinking→text("**26**\n\nSources:\n- [Node.js 26.0.0 (Current)](https://nodejs.org/en/blog/release/v26.0.0)")WebSearchran, real result returned with citation, thinking blocks forwarded.So the proxy / SDK / Anthropic side of the chain is verified. Cherry Studio's actual UI rendering of those blocks (citation hyperlinks, streaming, thinking display) can only be verified end-user-side.
Verification asks before merge
@BenIsLegit / @rynfar — please:
http://127.0.0.1:3456x-meridian-agent: cherry-studio/settingsunder a "Cherry Studio" sectionIf anything's off, comment on the PR and we'll iterate.
Merge strategy
Squash merge. Single commit by @rynfar.
Out of scope (follow-ups, not blocking this PR)
additionalDirectories).cherry-studio's shape under a different name.