fix(acp): custom models now reach the agent instead of failing to open #19313
main fromrefs/pull/19313/head·merged by t3dotgg(GitHub profile, opens in a new tab) View on GitHubA model added to an ACP agent's custom models showed up in the composer, but every run with it failed as a generic provider-session-open-failure. The session runtime only accepted model ids the agent advertised, so it rejected the custom id with -32602 before sending anything. Cline's free tier (cline-free/*) is the real case: the agent does not advertise it, but cline --acp accepts it.
Fix#
- The ACP registry adapter passes the instance's configured custom model slugs to the session runtime, using the same trimmed slugs the composer catalog shows.
- The runtime accepts those values for the model config option only, and lets the agent validate them. Everything else keeps the existing guard.
- No agent-specific branches. Other runtime users (Grok, Antigravity, Cursor, probe, auth) do not pass custom models, so their behavior is unchanged.
Proof#
- New test in
AcpJsonRpcConnection.test.tsagainst the mock ACP agent: a configured custom model is sent withsession/set_config_option, and an unconfigured unknown id is still rejected. It fails onmainwith the same-32602error as the issue and passes with the fix. - Registry path: I temporarily set
customModels: [" cline-free/custom-model "]in the real-process registry adapter test and opened a session with that model. Without the adapter change it failed withProviderAdapterOpenSessionError/-32602. With it, the session opened. I did not commit this edit. - Typecheck for
provider-acp,provider-acp-registry, andapps/server. Lint and format on the changed files.provider-acp-registrytests (65/65), ACP adapter tests (123/123), andAcpJsonRpcConnection.test.ts(44/44) pass. - Reviewed with sol-loop: 1 round with GPT-6.1 Sol, approved with no findings.
Fixes #18164
Credit to #18169 for the diagnosis and the Cline probe that showed the agent accepts these ids.
Model and harness: Claude Opus 5.5 in Claude Code via T3 Code.
🤖 Generated with Claude Code
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:S
juliusmarminge added labelsmacroscope-review
Approvability#
Verdict: Approved at
b15b74fMacroscope's review found this PR approvable — This is a small, self-contained fix that passes already-configured custom model slugs to ACP sessions and preserves rejection of unconfigured values and existing callers. The focused test covers both the newly enabled path and the existing validation guard.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Team
- Run ID:
086ea7a2-9f91-41c0-8dd1-f62a76ab7cad
📥 Commits
-
Reviewing files that changed from the base of the PR and between 173a97097659be5f77ab2c05cf5dfe84be3eb094 and b15b74fb99e9446dadb915780176298a0105db64.
📒 Files selected for processing: 3
-
apps/server/src/provider/acp/AcpJsonRpcConnection.test.tspackages/provider-acp-registry/src/server/adapter.tspackages/provider-acp/src/server/AcpSessionRuntime.ts
Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 10 reviews per hour.
-
📝 Walkthrough
-
The ACP registry adapter now passes configured custom model IDs to the session runtime. The runtime accepts those IDs for model configuration even when the agent does not advertise them. A test checks that configured models are sent and unconfigured models are rejected.
Changes: ACP custom model configuration
Layer / File(s) Summary Runtime model validation
packages/provider-acp/src/server/AcpSessionRuntime.tsAcpSessionRuntimeOptionsaddscustomModels. Model validation accepts a configured ID for a model option when that ID is absent from the agent-advertised values. Other unadvertised values remain rejected with-32602.Registry wiring and validation test
packages/provider-acp-registry/src/server/adapter.ts,apps/server/src/provider/acp/AcpJsonRpcConnection.test.tsThe adapter passes configured custom model slugs to the runtime. The test verifies that a configured custom model is sent and an unconfigured model is not sent. Priority: ➖ Normal
Estimated code review effort: 2 (Simple) | ~15 minutes
Change: Bug fix · Severity of issue fixed: Medium
Suggested reviewers:
juliusmarminge
Merge Risk: ⚪ Minimal · up to
b15b7-
Configured custom model IDs now reach the agent, as the linked issue requests, while unconfigured IDs are still rejected. No merge-blocking risk was identified.
Pre-merge checks:
4-
Passed checks: 4 passed-
Check name Status Explanation Title check The title clearly and concisely describes the primary fix: allowing custom ACP models to reach the agent instead of failing during session opening. Description check The description explains the problem, expected behavior, implementation across components, focused scope, linked issue, and verification results. The Fix and Proof headings provide the required Change… Linked Issues check Issue [ #18164] requires configured Cline ACP custom model IDs to reach the agent while unconfigured IDs remain rejected. The registry adapter readscustomModelswithreadCustomModelEntries, which …Out of Scope Changes check The changes stay within the linked issue scope. They modify the ACP registry adapter, add the narrowly scoped runtime exception, and add coverage for configured and unconfigured model IDs. Other ACP r…
-
✨ Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
Thread transfer impact#
✅ Thread transfer remains within every enforced ceiling.
Provider Metric Main baseline This PR Impact PR ceiling Codex Total thread wire 5.0 KiB 4.9 KiB −23 B (−0.5%) 6.8 KiB ✅ Codex Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Codex Live turn WebSocket wire 1.2 KiB 1.2 KiB −23 B (−1.9%) 2.0 KiB ✅ Codex Live turn WebSocket decoded 20.9 KiB 20.8 KiB −41 B (−0.2%) 29.3 KiB ✅ Codex Live turn messages 2 1 −1 (−50.0%) 8 ✅ Claude Total thread wire 5.0 KiB 5.0 KiB 0 B (0.0%) 6.8 KiB ✅ Claude Thread snapshot wire 3.8 KiB 3.8 KiB 0 B (0.0%) 4.9 KiB ✅ Claude Live turn WebSocket wire 1.2 KiB 1.2 KiB 0 B (0.0%) 2.0 KiB ✅ Claude Live turn WebSocket decoded 21.2 KiB 21.2 KiB 0 B (0.0%) 29.3 KiB ✅ Claude Live turn messages 2 2 0 (0.0%) 8 ✅ Baseline:
173a970· PR result:b15b74f· Source CI: successScenario and decoded snapshot size
10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
- Codex decoded thread snapshot: 108.5 KiB
- Claude decoded thread snapshot: 108.8 KiB
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.
t3dotgg(GitHub profile, opens in a new tab) closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes