Keep at most 5,000 lines and 8 MiB of retained UTF-8 terminal history. Discard the oldest text at either limit while preserving complete live output.
Track bytes and newlines in small chunks. Join split surrogates before eviction. Restore only the needed file tail, handle short reads, and close the file before rewriting current or legacy history.
Created with GPT-6 Astra (preview) in Codex.
Co-authored-by: will <[email protected]>
Do not retain OpenCode tool parts after emitting their runtime events. The remaining cache readers need text, reasoning, or step-usage parts, not tool input and output.
Keep tool lifecycle events, output bytes, late-role assistant text, and usage handling unchanged. Add focused lifecycle coverage and verify retained memory through the real adapter.
Created with GPT-6 Astra (preview) in Codex.
Read only the selected thread's events when resuming its detail stream. Measure bounded row counts and serialized payload bytes before replay, using the existing aggregate index and a captured authoritative head.
Keep snapshot resets for oversized or invalid cursors. Reset recreated threads when a snapshot exists, and keep bounded replay for deleted threads whose snapshot is absent. Shell replay and the detail-event filter are unchanged.
Created with GPT-6 Astra (preview) in Codex.
Append terminal history incrementally and materialize text for snapshots and coalesced disk writes.
Clear evicted line references without changing retained output.
Continues [#9357](https://github.com/pingdotgg/t3code/pull/9357). The original contribution and author credit are preserved.
The current line limit and wire format stay unchanged. A strict byte limit remains separate work.
Created with GPT-6 Astra (preview) in Codex.
Co-authored-by: will <[email protected]>
OpenCode could show an Approval badge with no controls, appear stuck on TodoWrite, and keep showing a running turn after Stop.
- Show every permission, including old saved requests. Keep failed replies retryable and close completed requests even when reply events are lost.
- Keep OpenCode output pipes drained and automatic replies out of the event loop. Handle disconnects, reconnects, and confirmed stops without stale requests or running states.
- Show native task progress and command results. Do not treat TodoWrite or approval history as file edits or executed commands.
- Ignore late aborts and task updates after a turn finishes.
Fixes#4795Fixes#7113Fixes#5760
Created with GPT-6 Astra (preview) in Codex. Reviewed and merged with Claude Fable 5.1 in Claude Code.
Replace stale local desktop sessions in one transaction. Preserve paired clients and browser sessions, and keep the previous credential valid if replacement fails.
Closes https://github.com/pingdotgg/t3code/issues/6283.
Original implementation by seeb1337. Reviewed and verified with GPT-6 Astra (preview) in Codex.
Co-authored-by: seeb1337 <[email protected]>
Co-authored-by: Theo Browne <[email protected]>
Refresh missing PR associations after agent turns on the thread's current branch. Preserve background policy, known PR caches, and failed-lookup backoff. Serialize status loads and refreshes to prevent stale responses from hiding a PR. Find branches pushed under their own name while still tracking the default branch.
Original work by Theo Browne with Claude Fable 5.1 in Claude Code. Takeover fixes created with GPT-6 Astra (preview) in Codex.
Co-authored-by: Theo Browne <[email protected]>
Co-authored-by: Claude Fable 5.1 <[email protected]>
Follow-up to #9507, carrying over the reset-credit redemption from #9421.
Codex grants a reset credit when it has rate-limited an account unfairly (`"Thanks for using Codex! You've been granted one free rate limit reset."`). Redeeming one clears the current 5h/weekly windows. The Limits tab now shows how many are banked and when the next expires, with a confirmed **Use a reset credit** action.
## How it works
- `ServerProviderUsageLimits.resetCredits` carries the count and soonest expiry; the Codex probe reads it from the same `account/rateLimits/read` it already makes.
- `ProviderInstance.consumeResetCredit` is a new optional hook — account-level, so it sits beside `refreshModels` rather than on the thread-routed adapter. The Codex driver implements it over a short-lived app-server (via `withCodexAppServerClient`, factored out of the status and skills probes which duplicated the setup), then re-probes.
- Single-flight per instance with one idempotency key kept until Codex reports an outcome, so a retry after a timeout does not open a second attempt.
- New `provider.consumeResetCredit` RPC under the operate scope; the outcome (`reset` / `nothingToReset` / `noCredit` / `alreadyRedeemed`) is shown inline.
Only Codex reports credits today. A provider without the hook gets a clear "does not bank reset credits" error; one without credits shows nothing.
## Screenshots
The local Codex row with one banked credit (the same account via the CLIProxyAPI hub above it shows no credit, as expected — the hub does not relay them):

Close-up of the row:

Clicking it opens the confirmation; nothing is sent until **Use credit**:

## Verification
- Mapper tests for the credit summary; provider, contract, and Usage page suites pass; typecheck clean.
- Verified against a real Codex Pro account holding one credit: summary and expiry render, the confirm dialog opens. **Not redeemed** — that would spend the credit.
Written by Claude Fable 5 via Claude Code; design and single-flight approach from @StiensWout's #9421.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Redemption spends real account credits over a new RPC; correctness depends on per-account locking and idempotency, though disabled instances and non-Codex providers are rejected explicitly.
>
> **Overview**
> Adds **end-to-end redemption of banked Codex rate-limit reset credits** from the Limits UI on web and mobile, backed by a new operate-scoped `provider.consumeResetCredit` RPC.
>
> **Contracts and server:** `ServerProviderUsageLimits` can include `resetCredits` (count + next expiry). Codex probes attach that from `account/rateLimits/read`. Optional `ProviderInstance.consumeResetCredit` is implemented for Codex via a scoped app-server call to `account/rateLimitResetCredit/consume`, then a limits refresh. `CodexResetCreditCoordinator` serializes redemptions per Codex account directory, reuses one idempotency key until Codex returns an outcome, and times out hung requests. `withCodexAppServerClient` is extracted so status, skills, and redemption share the same short-lived app-server setup.
>
> **Clients:** Limits rows show banked credits and a confirmed **Use a reset credit** action that calls `serverEnvironment.consumeResetCredit` and surfaces outcomes (`reset`, `nothingToReset`, etc.) or errors.
>
> **Web usage sources (same PR):** Adding/removing CLIProxyAPI hubs and the add dialog target a **selected connected environment** (with picker when several are connected), gated by operate access—not only the primary environment.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 98f32e60852dca1d38c94335b3ed7aac8c4b895e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: Wout Stiens <[email protected]>
Co-authored-by: Claude Code <[email protected]>
Include SQLite conditions and schema issue tags without copying query data.
Continue @Sy-D's [#4837](https://github.com/pingdotgg/t3code/pull/4837). Add the missing Bun error codes and test the real SQL client.
Created with GPT-6 Astra (preview) in Codex.
Co-authored-by: Sy-D <[email protected]>
Co-authored-by: Claude Opus 5 <[email protected]>