Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(claude): a thread with background work no longer refuses messages sent from another client #15473

Closedvitalyiegorov(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/15473/headopened View on GitHub

Problem

Fixes #15471. The mobile app omits fastMode, and the web composer sends fastMode: false. Both mean Normal, but compileClaudeModelSelection compiled them to different queryIdentity values. So a Claude process opened from one client looked reconfigured when a message arrived from the other. While background work ran, the guard from #14726 refused every such message as a "model or setting change", and the thread accepted nothing until the work ended.

Change

apps/server/src/claudeModelOptions.ts: for models that expose fast mode, an unset fastMode now compiles as false, the value the web composer already sends. Both clients produce the same settings and queryIdentity, so the live process is reused. A real switch to Fast or back still changes the identity, so the #14726 guard still protects background work.

The fix is on the server, so it covers mobile, web, desktop, server-sent continuations, and any older client. Models without a fast-mode option are unchanged.

Scope and approval

A focused fix for #15471, which I filed with the run records showing the mismatch. It waits on triage, like any bug PR. It's one line, it introduces no new behaviour, and it changes no contracts. The only observable difference is that Claude now gets an explicit fastMode: false where it used to get nothing. That is what every web send already does.

Verification

  • New test in claudeModelOptions.test.ts: unset and false compile to the same settings and query identity. It fails on main and passes here.
  • Ran vp test run src/claudeModelOptions.test.ts src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts src/textGeneration/ClaudeTextGeneration.test.ts in apps/server: 149 passed. That includes the #14726 test that refuses a real model change while a background subagent runs.
  • apps/server typecheck passes. Lint and fmt pass on the touched files.
  • The bug was confirmed on a real thread: runs 1–16 had no options, and runs 17–19 from web carried fastMode: false and were refused (table in #15471). I didn't rerun that flow on a patched server.

Implemented with Claude Opus 5.5 in T3 Code (Claude Code harness).

🤖 Generated with Claude Code

    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This is a narrowly scoped Claude bug fix that normalizes omitted fast mode to an explicit Normal value, affecting live-process reuse decisions and the settings passed to Claude. Because the server’s effective default for an omitted option changes, the default-handling policy calls for human review.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. Review in Change Stack →

      Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

      🧰 Additional context used
      📚 Code guidelines (1)
      docs/internals/effect-services.md — auto-discovered

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration
      • Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml
      • Review profile: CHILL
      • Plan: Advanced
      • Run ID: 3c9f0161-316f-4719-a1ab-40ffe0aecfcd
      📥 Commits

      Reviewing files that changed from the base of the PR and between 8fb068c4982fc50a2a2f57c3b6fd4731735cf0bf and cea5f98c296e2a8f9a791b3d546f2ccd321ee2e1.

      📒 Files selected for processing (2)
      • apps/server/src/claudeModelOptions.test.ts
      • apps/server/src/claudeModelOptions.ts

      Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


      📝 Walkthrough

      Walkthrough

      For models that support fastMode, compileClaudeModelSelection now uses false when the option is omitted. A test verifies that the omitted and explicit-false selections produce the same query identity.

      Changes

      Claude fast-mode normalization

      Layer / File(s)Summary
      Normalize fast mode and verify query identity
      apps/server/src/claudeModelOptions.ts, apps/server/src/claudeModelOptions.test.ts
      Supported models now resolve an omitted fastMode option to false; unsupported models still resolve it to undefined. The test checks that omitted and explicit false selections produce the same settings and query identity.

      Priority: ➖ Normal

      Estimated code review effort: 2 (Simple) | ~8 minutes

      Change: Bug fix · Severity of issue fixed: Medium

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to cea5f

      For supported models, omitted fast mode now matches explicit false, allowing otherwise matching requests to reuse the live Claude process. No actionable merge-blocking risk remains.

      Architecture Summary

      Architecture risk: 🔵 Low · up to cea5f

      The change affects 1 system.

      Changed systems: apps/server

      Architecture concerns No architecture-level concerns identified.

      Review details

      Systems and components

      • observed — apps/server (service) was modified; 2 changed files map to changed impact.

      Before / after behavior

      • observed — Modified behavior in apps/server/src/claudeModelOptions.test.ts: Adds a test comparing unset fast mode with explicit false: the compiled settings are expected to contain fastMode: false, and both selections are expected to share a query identity.
      • observed — Modified behavior in apps/server/src/claudeModelOptions.ts: For models supporting fastMode, an unset selection now resolves to false instead of remaining undefined; unsupported models still produce undefined.
      🚥 Pre-merge checks | ✅ 5
      ✅ Passed checks (5 passed)
      Check nameStatusExplanation
      Title check✅ PassedThe title describes the primary user-visible change: messages from another client are no longer refused while background work runs. It is specific and concise.
      Description check✅ PassedThe description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the issue, the fix, its scope, and the tests and checks performed, including the real-…
      Linked Issues check✅ PassedIssue #15471 requires omitted fastMode and explicit false to represent the same Normal selection for models that support fast mode. compileClaudeModelSelection now defaults a supported, unset op…
      Out of Scope Changes check✅ PassedThe pull request changes only Claude model selection compilation and its focused test. Both changes directly implement and verify issue #15471. No unrelated changes appear in the whole-pull-request di…
      Docstring Coverage✅ PassedDocstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create a new PR
      • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

      Comment `@coderabbitai help` to get the list of available commands.
    4. On the Macroscope verdict (human review for a default change): that's expected, and here is the change in default for reviewers.

      • Before: an unset fastMode sent Claude no fastMode setting.
      • After: Claude gets fastMode: false.
      • Who sees a difference: only senders that omit the option, which are mobile and server-sent continuations. The web composer already adds fastMode: false to every send (withImplicitFastModeDefault), so this aligns the other paths with the default web users already get.
      • Why the server: an identity-only normalization would leave the two paths sending different settings for the same selection, so a reused process could keep whichever mode it was opened with. Normalizing at compile time gives both one meaning.
      • Fast mode itself: choosing Fast still sends fastMode: true and still changes the query identity, so the #14726 guard still applies.
    5. maria-rcks closed this

Sign in to join this conversation.