Skip to content

refactor(server): share Claude result status and error mapping - #10296

Merged
t3dotgg merged 1 commit into
mainfrom
t3code/debt-gzuf-2-claude-result
Sep 6, 2026
Merged

refactor(server): share Claude result status and error mapping#10296
t3dotgg merged 1 commit into
mainfrom
t3code/debt-gzuf-2-claude-result

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Sep 6, 2026

Copy link
Copy Markdown
Member

Claude turn status and error text use separate lists of terminal failure reasons. A new reason can update one list and leave the other wrong.

Use one result mapper for both values. Keep existing error priority, success-tagged failures, overloads, interruption, cancellation, and unknown CLI reasons.

All 95 Claude adapter tests passed, including two new unknown-reason cases. Server typecheck and scoped lint passed. Independent source review found no behavior changes.

Created in Codex.

Note

Unify Claude result status and error mapping in resultOutcome

  • Replaces separate result-level status and user-facing error helpers with a single resultOutcome helper in ClaudeAdapter.ts that derives turn status and error text together
  • Removes the FAILED_TERMINAL_REASONS constant; its reason list now lives in the terminalResultError switch
  • Recognized structured terminal reasons mark the turn as failed regardless of result subtype, while success-tagged results with unknown terminal reasons stay completed
  • Adds a parameterized test covering success and error subtypes with unknown terminal reasons in ClaudeAdapter.test.ts
  • Risk: handleResultMessage now routes all result outcomes through resultOutcome; any terminal reason not in the terminalResultError switch will no longer be treated as a failure on success-tagged results

Macroscope summarized 489846c.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 6, 2026
@macroscopeapp

macroscopeapp Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 329fb04

Macroscope's review found this PR approvable — This is a small, self-contained refactor that unifies existing Claude result status and error mapping without changing the established outcomes. The added tests cover forward compatibility with unknown terminal reasons, and no product defaults or static-analysis suppressions are affected.

No code changes detected at 489846c. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 13.6 KiB +65 B (+0.5%) 15.1 KiB
Codex Thread snapshot wire 7.0 KiB 7.0 KiB −5 B (−0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.5 KiB 6.6 KiB +70 B (+1.1%) 7.8 KiB
Codex Live turn WebSocket decoded 57.0 KiB 57.1 KiB +88 B (+0.2%) 66.4 KiB
Codex Live turn messages 8 10 +2 (+25.0%) 21
Claude Total thread wire 13.6 KiB 13.5 KiB −42 B (−0.3%) 15.1 KiB
Claude Thread snapshot wire 7.0 KiB 7.0 KiB −1 B (−0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.6 KiB 6.5 KiB −41 B (−0.6%) 7.8 KiB
Claude Live turn WebSocket decoded 57.9 KiB 57.8 KiB −88 B (−0.1%) 66.4 KiB
Claude Live turn messages 10 8 −2 (−20.0%) 21

Baseline: 7544d3d · PR result: 489846c · 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: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-2-claude-result branch from 329fb04 to 489846c Compare September 6, 2026 09:12
@cursor

cursor Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@t3dotgg
t3dotgg merged commit 4c7cd17 into main Sep 6, 2026
25 checks passed
@t3dotgg
t3dotgg deleted the t3code/debt-gzuf-2-claude-result branch September 6, 2026 09:15
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Sep 6, 2026
## What's Changed
* feat(usage): pool subscription limits per provider across accounts and environments by @juliusmarminge in pingdotgg/t3code#10300
* chore(web): remove usage limits demo fixtures by @juliusmarminge in pingdotgg/t3code#10330
* fix(web): expose error disclosure state by @saphid in pingdotgg/t3code#10125
* fix(web): name the editor picker accurately by @saphid in pingdotgg/t3code#10124
* fix(web): make task row states readable by @saphid in pingdotgg/t3code#10128
* fix(web): explain hosted connection prerequisites by @saphid in pingdotgg/t3code#10129
* fix(web): name combobox chip removal targets by @saphid in pingdotgg/t3code#10127
* fix(marketing): present the Git workflow as an illustration by @saphid in pingdotgg/t3code#10130
* feat(mobile): pool usage limits across selected environments by @juliusmarminge in pingdotgg/t3code#10334
* fix(release): space automatic nightlies at least six hours apart by @t3dotgg in pingdotgg/t3code#10272
* refactor(web): share bulk thread deletion between sidebars by @t3dotgg in pingdotgg/t3code#10106
* refactor(client): share tool outcome rules by @t3dotgg in pingdotgg/t3code#10122
* refactor(server): share Claude result status and error mapping by @t3dotgg in pingdotgg/t3code#10296
* fix(server): settle inactive threads without a PR lookup by @t3dotgg in pingdotgg/t3code#10103
* fix(ssh): report remote stop failures without losing ownership by @t3dotgg in pingdotgg/t3code#10105
* perf(server): stop scanning old OpenCode parts by @t3dotgg in pingdotgg/t3code#10116
* perf(server): avoid full thread reads on turn start by @t3dotgg in pingdotgg/t3code#10108
* perf(web): skip checkpoint map rebuilds while streaming by @t3dotgg in pingdotgg/t3code#10118
* perf(server): skip plan bodies in thread summaries by @t3dotgg in pingdotgg/t3code#10341
* fix(server): skip disabled provider instances for text generation fallback by @t3dotgg in pingdotgg/t3code#10346
* fix(server): capture checkpoints before refreshing PR status by @t3dotgg in pingdotgg/t3code#10347
* fix(web): keep manual panel choices during a turn by @t3dotgg in pingdotgg/t3code#10113
* fix(threads): keep completed requests closed across clients by @t3dotgg in pingdotgg/t3code#10123
* perf(server): finish runtime messages without full thread reads by @t3dotgg in pingdotgg/t3code#10120
* refactor(server): let adapters declare context compaction by @t3dotgg in pingdotgg/t3code#10112
* fix(server): link thread PRs without an open client by @t3dotgg in pingdotgg/t3code#10101


**Full Changelog**: pingdotgg/t3code@v0.0.39-nightly.20260906.1293...v0.0.39-nightly.20260906.1303

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.39-nightly.20260906.1303
vitalyiegorov added a commit to vitalyiegorov/t3code that referenced this pull request Sep 6, 2026
Thread the failure hint through resultOutcome, which main introduced in
pingdotgg#10296, instead of the removed resultUserFacingError/turnStatusFromResult pair.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant