Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(acp): custom models now reach the agent instead of failing to open #19313

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/19313/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

A 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.ts against the mock ACP agent: a configured custom model is sent with session/set_config_option, and an unconfigured unknown id is still rejected. It fails on main with the same -32602 error 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 with ProviderAdapterOpenSessionError / -32602. With it, the session opened. I did not commit this edit.
  • Typecheck for provider-acp, provider-acp-registry, and apps/server. Lint and format on the changed files. provider-acp-registry tests (65/65), ACP adapter tests (123/123), and AcpJsonRpcConnection.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

    2. juliusmarminge added labelsmacroscope-review

    3. Approvability

      Verdict: Approved at b15b74f

      Macroscope'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).
    4. Review in Change Stack →

      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.ts
      • packages/provider-acp-registry/src/server/adapter.ts
      • packages/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.ts
      AcpSessionRuntimeOptions adds customModels. 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.ts
      The 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: Passed 4
      Passed Passed checks: 4 passed
      Check nameStatusExplanation
      Title checkPassedThe title clearly and concisely describes the primary fix: allowing custom ACP models to reach the agent instead of failing during session opening.
      Description checkPassedThe 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 checkPassedIssue [#18164] requires configured Cline ACP custom model IDs to reach the agent while unconfigured IDs remain rejected. The registry adapter reads customModels with readCustomModelEntries, which …
      Out of Scope Changes checkPassedThe 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
      Comment `@coderabbitai help` to get the list of available commands.
    5. Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire5.0 KiB4.9 KiB−23 B (−0.5%)6.8 KiB✅
      CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      CodexLive turn WebSocket wire1.2 KiB1.2 KiB−23 B (−1.9%)2.0 KiB✅
      CodexLive turn WebSocket decoded20.9 KiB20.8 KiB−41 B (−0.2%)29.3 KiB✅
      CodexLive turn messages21−1 (−50.0%)8✅
      ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
      ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
      ClaudeLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
      ClaudeLive turn WebSocket decoded21.2 KiB21.2 KiB0 B (0.0%)29.3 KiB✅
      ClaudeLive turn messages220 (0.0%)8✅

      Baseline: 173a970 · PR result: b15b74f · Source CI: success

      Scenario 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.

Sign in to join this conversation.