Skip to content

fix(threads): keep completed requests closed across clients - #10123

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

fix(threads): keep completed requests closed across clients#10123
t3dotgg merged 1 commit into
mainfrom
t3code/debt-gzuf-2-activity-lifecycle

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Sep 5, 2026

Copy link
Copy Markdown
Member

Web and mobile each had their own reducer for pending approvals and questions. The mobile copy lacked two of the stale-request failure fragments web matches and did not map dynamic_tool_call approvals, so a request could stay open on one client after another client answered it.

The fix moves the reducer into packages/client-runtime as derivePendingRequests. It keys on request ID, treats a resolved or stale-failed request as final even when activities arrive out of order, and is used by web, desktop, and mobile. Tests for the reducer move with it.

Removed from the original version: the typed reason field on respond.failed payloads, the ProviderAdapterRequestNotFoundError across the six adapters, the decider invariant, the projector retention change, and the snapshot query changes. Those touched server orchestration and contracts for a client-side bug, and the client already closes requests from the existing failure text. The server is unchanged.

Reworked by Claude Fable 5.1 in Claude Code.

Note

Keep completed requests closed across clients with shared derivePendingRequests reducer

  • Moves pending approval and user-input derivation out of session-logic.ts and threadActivity.ts into a single shared reducer in pendingRequests.ts, exported via the new ./pending-requests subpath.
  • The reducer tracks closed request-ID sets so that a reordered or replayed request activity cannot reopen a request after its terminal event; non-stale response failures no longer close a request.
  • Adds shared parseQuestions and isStaleRequestFailure utilities; malformed question/option entries are discarded and native answer keys are preserved without trimming.
  • Moves platform-local test suites into pendingRequests.test.ts with added parameterized coverage for terminal-event ordering.
  • Behavioral Change: web and mobile hooks now call derivePendingRequests once instead of separate approval/user-input derivation functions; consumers must destructure { approvals, userInputs } from the new result shape.

Macroscope summarized 7741079.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 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.6 KiB 13.6 KiB +23 B (+0.2%) 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 +18 B (+0.3%) 7.8 KiB
Codex Live turn WebSocket decoded 57.1 KiB 57.1 KiB 0 B (0.0%) 66.4 KiB
Codex Live turn messages 10 10 0 (0.0%) 21
Claude Total thread wire 13.5 KiB 13.6 KiB +35 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.5 KiB 6.5 KiB +36 B (+0.5%) 7.8 KiB
Claude Live turn WebSocket decoded 57.8 KiB 57.8 KiB +44 B (+0.1%) 66.4 KiB
Claude Live turn messages 8 9 +1 (+12.5%) 21

Baseline: eb8ed80 · PR result: 7741079 · 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.

@macroscopeapp

macroscopeapp Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 7741079

Macroscope's review found this PR approvable — This is a focused fix to pending approval and user-input lifecycle handling across web and mobile, with the shared reducer and its ordering behavior covered by dedicated tests. The change preserves existing interfaces and data while avoiding schema, deployment, security, billing, and configuration impact.

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

Comment thread apps/server/src/provider/Errors.ts Outdated
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-2-activity-lifecycle branch from 93417f7 to 6a92a4b Compare September 6, 2026 04:37
Comment thread apps/server/src/orchestration/Layers/ProjectionSnapshotQuery.ts
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-2-activity-lifecycle branch from 6a92a4b to b719312 Compare September 6, 2026 06:22
@t3dotgg
t3dotgg changed the base branch from main to t3code/debt-gzuf-2-migration48 September 6, 2026 06:22
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-2-migration48 branch from 66170fe to d858532 Compare September 6, 2026 06:36
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-2-activity-lifecycle branch from b719312 to 8a875c2 Compare September 6, 2026 06:38
@t3dotgg
t3dotgg changed the base branch from t3code/debt-gzuf-2-migration48 to main September 6, 2026 09:10
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-2-activity-lifecycle branch from 8a875c2 to ea4c7c3 Compare September 6, 2026 09:24
@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.

Web and mobile each had their own reducer for pending approvals and
questions. The mobile copy lacked two of the stale-request failure
fragments web matches and did not map dynamic_tool_call approvals, so a
request could stay open on one client after another client answered it.

Move the reducer into packages/client-runtime as derivePendingRequests.
It keys on request ID, treats a resolved or stale-failed request as
final even when activities arrive out of order, and is used by web,
desktop, and mobile. The server is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@t3dotgg
t3dotgg force-pushed the t3code/debt-gzuf-2-activity-lifecycle branch from ea4c7c3 to 7741079 Compare September 6, 2026 09:44
@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:XXL 1,000+ changed lines (additions + deletions). labels Sep 6, 2026
@t3dotgg
t3dotgg merged commit e63ddb4 into main Sep 6, 2026
27 checks passed
@t3dotgg
t3dotgg deleted the t3code/debt-gzuf-2-activity-lifecycle branch September 6, 2026 09:56
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 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