Repository navigation
fix(acp): let configured custom models bypass the advertised-choices guard - #18169
Lokkuchakreshkumar wants to merge 1 commit into
Conversation
…guard Custom model ids (e.g. Cline's cline-free/* free tier) are merged into the composer catalog but rejected client-side by validateConfigOptionValue, which allowlists session/set_config_option values against agent-advertised choices only. Thread the instance's customModels through as passthrough values so the agent validates them; the guard still applies to everything else.
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — This is a contained ACP bug fix that lets explicitly configured custom model IDs reach the agent while retaining validation for all other values. Defaults, unrelated ACP callers, schemas, deployment settings, and static-analysis configuration remain unchanged. Notes:
You can add or adjust custom eligibility rules. Learn more. |
Dismissing prior approval to re-evaluate 8a16706
|
Note 🤖 Claude Opus 5.5 responding on behalf of Theo Closing because this PR states that Muse Spark wrote code in it:
We do not accept code written by Gemini models or by Muse models other than Muse Wonder Full. See Models we do not accept. To have this considered again, open a new PR with the code written by a different model and link this one. |
Problem
A model id configured via a provider instance's
customModelsis merged into the composer catalog (modelsFromDiscovery→providerModelsFromSettings), so it is selectable — but any run with it dies as a genericprovider-session-open-failure. Concretely: Cline's free tier (cline-free/*, the only working route for $0-balance accounts) is missing from the agent's discovery, can be added as a custom model, and the samecline --acpbinary accepts it — yet T3 never sends it. Fixes #18164 (maintainer-triaged; direction confirmed in the reply there).Change
packages/provider-acp/src/server/runtimeModel.ts: new pure helperisAllowedSessionConfigOptionValue— a value passes when it is either agent-advertised or in the instance's passthrough set.packages/provider-acp/src/server/AcpSessionRuntime.ts: new optionalAcpSessionRuntimeOptions.passthroughConfigValues;validateConfigOptionValueconsults it before the advertised-choices allowlist. Type/boolean checks are unchanged, and the-32602error is unchanged for everything else.packages/provider-acp-registry/src/server/adapter.ts:makeAcpRegistryRuntimepasses the instance's normalizedcustomModelsslugs as the passthrough set. No agent-specific branches (per the file's rule); otherlayer()callers (grok, probe, auth, Antigravity) are unaffected since the field is optional.packages/provider-acp/src/server/runtimeModel.test.ts: 3 unit tests for the helper (advertised passes, unadvertised rejected, custom id passes while other unknown ids still rejected).Net effect:
configureSession→runtime.setModel→session/set_config_optionnow reaches the agent for configured custom ids, and the agent validates them. Agents that reject unknown ids behave exactly as before (the error just comes from the agent instead of the client guard).Scope and approval
Scope is the one defect in #18164; the maintainer reply there confirms the bug in code and the fix direction ("skip or widen the advertised-choices check in validateConfigOptionValue ... for configured customModels"). No product defaults change: with empty
customModelsthe behavior is byte-for-byte identical (empty passthrough set). The Cursor case (#13267, customs hidden at catalog level) is untouched — hiding happens before this check, and a manually configured id there would now be sent to the agent, which rejects out-of-catalog ids itself.Verification
session/set_modelandsession/set_config_option { configId: "model", value: "cline-free/muse-spark-1.3-contributor" }both succeed (currentValueupdated), and a follow-upsession/prompt "hi"completes withstopReason: end_turn— no billing error. This establishes the agent side accepts exactly what T3 was refusing to send.tsc --noEmitclean for@t3tools/provider-acpand@t3tools/provider-acp-registry.vp test runfor@t3tools/provider-acp: 8 files / 112 tests pass (incl. 3 new);@t3tools/provider-acp-registry: 65 tests pass.vp fmt --checkclean on all four touched files.-32602text instead of the opaque open failure) is intentionally left out to keep this to one problem.Built with Muse Spark 1.3 via the T3 Code OpenCode harness.