Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): provider failures say why a turn could not start #16303

Mergedsaphid(GitHub profile, opens in a new tab)merged 13 commits intomain fromrefs/pull/16303/headmerged by juliusmarminge View on GitHub

When a provider refuses to start a turn, the banner currently hides known causes behind a generic failure. This keeps the existing category and retry guidance while adding fixed wording for an unreadable attachment or a previous turn that is still running. Adapter details, configuration and private IDs do not become text through this reason mapping.

The optional reason stays inside provider errors. Existing active-turn refusals are marked in Claude, Cursor, shared ACP (Grok/Antigravity), Pi, Muse and OpenCode; attachment-read failures are marked in Claude, Codex, Cursor and ACP. Unknown reasons retain the generic message. Nested categories, Effect causes, special actionable errors, redaction and bounds retain their behavior. No wire or client changes.

Maintainer takeover of @saphid’s #16303. Contributor commits are preserved; main at 8211893622 was merged. The test block was reduced from 97 to 59 lines, and one existing Claude rejection case now checks the resulting diagnostic. Codex error construction follows the other adapter boundaries.

Actual app proof

Same disposable PNG and composer text, Claude selection, 1280×800 Linux web client. After the normal upload was claimed, a filesystem watcher moved the claimed copy away before adapter read. Both errors came through the normal turn path; no failure events or projections were fabricated. The failing turn never reached the native prompt, so this does not verify an account or model response.

Before — actual base 8211893622, generic banner:

Before: unreadable image produces only the generic start failure

After — reviewed head db12cad0a2, fixed reason with guidance:

After: banner says an attachment could not be read and preserves retry guidance

Verification

  • Mapper: main 11 → contributor 14 → rewritten 15 runtime cases (14 declarations). Added coverage is four runtime cases in the existing file; the existing Claude attachment case is strengthened. Three assertion failures against actual main production, followed by 17 focused passes after restoration and rebuild.
  • Seven scoped provider/server typechecks, changed-file lint and formatting pass. Five existing unused-variable warnings remain. Parent independently reran six focused diagnostic/adapter cases successfully.
  • One independent full-diff review round, Codex GPT-6-Sol and Claude Opus 5.5: no blocking findings. Additional reviewer runs passed 455 Claude/Codex adapter tests, 191 other adapter tests and 54 execution-service tests.
  • Hosted CI and configured review status must be evaluated on the published head; no merge performed.

Full verification record.

Limits

The active-turn wording has focused test coverage; an overlapping failure was not forced through the normal UI, which serializes turns. Other native provider accounts, macOS, Windows, iOS, Android, Electron desktop and remote/relay/tunnel clients were not verified. OpenCode2 direct unwrapped failures remain generic; its handoff wrapper can show the reason. Pi/Muse unreadable-image handling is unchanged. Existing explicit-message overrides during session-open/thread-load failures are outside this mapping and this PR.

Models/harness: Codex GPT-6-Astra (tests), GPT-6.1-Sol (implementation and integration), GPT-6-Sol and Claude Opus 5.5 (independent reviews), through T3 Code.

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

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at db12cad

      Macroscope's review found this PR approvable — This is a contained diagnostic fix: existing provider failures retain their categories and guidance while selected attachment and active-turn failures gain fixed explanations without exposing provider details. Adapter annotations, internal optional typing, and focused tests account for the full runtime impact.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      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: Advanced
      • Run ID: 971217e5-1086-40ce-af36-5527ff6aeb0f
      📥 Commits

      Reviewing files that changed from the base of the PR and between 5a5e2700fcdd7314c697fc39686a9dfba6fe4dd8 and ff1bfc7b522d94f0c03a05eeb0d8a11a89bfede5.

      📒 Files selected for processing: 11
      • apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts
      • apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
      • packages/provider-acp/src/server/adapter.ts
      • packages/provider-core/src/server/ProviderAdapter.ts
      • packages/provider-core/src/server/failure.test.ts
      • packages/provider-core/src/server/failure.ts
      • packages/provider-cursor/src/server/adapter.ts
      • packages/provider-muse/src/server/adapter.ts
      • packages/provider-opencode/src/server/adapter.ts
      • packages/provider-opencode/src/server/v2/adapter.ts
      • packages/provider-pi/src/server/adapter.ts

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

      📝 Walkthrough

      Provider protocol errors now support typed reasons for unreadable attachments and active-turn conflicts. Provider adapters attach those reasons, and failure reporting uses recognized reasons in category-specific summaries while retaining safe generic messages for unrecognized inputs.

      Changes: Provider failure reasons

      Layer / File(s)Summary
      Typed reasons in provider errors
      packages/provider-core/src/server/ProviderAdapter.ts, apps/server/src/orchestration-v2/Adapters/*, packages/provider-{acp,cursor,muse,opencode,pi}/src/server/adapter.ts, packages/provider-opencode/src/server/v2/adapter.ts
      The protocol error schema adds previous_turn_active and attachment_unreadable. Provider adapters attach these reasons to active-turn conflicts and attachment-read failures where applicable.
      Failure summaries and validation
      packages/provider-core/src/server/failure.ts, packages/provider-core/src/server/failure.test.ts
      Failure reporting maps recognized error categories and reasons to summaries. Tests cover nested categories, safe reason output, and unrecognized categories and reasons.

      Priority: ⬇️ Low

      Estimated code review effort: 3 (Moderate) | ~20 minutes

      Change: Bug fix

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to ff1bf

      This change makes provider turn-start failure messages more specific for unreadable attachments and active-turn conflicts. Unrecognized inputs fall back to the generic message. No actionable merge-blocking risk was found.

      Security architecture risk: ⚪ Minimal · up to ff1bf

      The new reason-specific messages use predefined wording rather than raw provider details. The change does not alter access controls or turn execution.

      Retained concerns No architecture-level concerns identified.

      Security review details

      Security Blast Radius

      • inferred — The introduced behavior affects shared failure presentation across provider adapters. The new reason field selects between two fixed descriptions; it does not grant additional file, tool, credential, or execution authority.

      Trust Boundaries and Controls

      • observed — The new category/reason formatting branch does not interpolate protocol detail, payload, or message. Both category and reason selection use own-property checks against fixed maps, so arbitrary strings and prototype keys cannot select new summary text.

      Resilience and Maintainability Implications

      • observed — Cause inspection retains cycle detection, a sixteen-step traversal limit, and exception handling. Output still passes through redaction, control-character handling, and length bounds, preserving existing containment around malformed provider failures.
      Pre-merge checks: Passed 4
      Check nameStatusExplanation
      Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
      Title checkPassedThe title clearly and concisely describes the main change: provider failures now explain why a turn could not start.
      Description checkPassedThe description explains the problem, implementation, scope, approval context, verification results, evidence, and known limits. It provides substantially all required information, although it does no…
      Full details: Description check

      Explanation

      The description explains the problem, implementation, scope, approval context, verification results, evidence, and known limits. It provides substantially all required information, although it does not use the template headings consistently.

      ✨ 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. Review requested

      Date (UTC)ReviewerWhere
      2026-10-06JuliusDiscord DM
      Logged so this PR shows when a maintainer was asked to review it.
    5. juliusmarminge added labelsmacroscope-review

    6. juliusmarminge assignedjuliusmarminge

    7. Taking over this one as maintainer. I’ll preserve your commits and push here, merge current main, reduce the tests to the essential diagnostic behavior, and rebuild the typed-reason handling to current conventions. I’ll verify the actual banner with isolated state, refresh the proof and run independent full-PR reviews before publication. Credit stays with @saphid.

    8. juliusmarminge merged this300a356

    9. juliusmarminge closed this

Sign in to join this conversation.