Skip to content

fix(perf): retire idle provider resources - #517

Merged
astyfx merged 1 commit into
mainfrom
fix/perf-0909
Sep 8, 2026
Merged

fix(perf): retire idle provider resources#517
astyfx merged 1 commit into
mainfrom
fix/perf-0909

Conversation

@astyfx

@astyfx astyfx commented Sep 8, 2026

Copy link
Copy Markdown
Member

Summary

Long-running provider sessions could retain completed Codex thread resources,
quiet streams could lose their replay window, and failed host children could
survive a transport error. This change gives provider resources explicit idle
lifetime boundaries and keeps the live chat clock local to the row that renders
it.

Changes

Fixes

  • provider: unsubscribe idle Codex threads, retire idle App Server clients, and
    release turn ownership from one outer cleanup path
  • streams: retain quiet active turns for replay and expire completed buffers
    through an independent timer
  • host: escalate a failed child from SIGTERM to SIGKILL while retaining the
    original child reference
  • chat: move elapsed-time updates from the conversation list into the live
    message row

Refactors / Chores

  • add lifecycle and end-to-end regression coverage for provider, host, stream,
    and message-clock behavior
  • document the resource ownership and recovery contracts

Test Evidence

  • bun run test:isolated — 5,247 shared tests passed; 35 isolated suites passed
  • bun run typecheck and bun run typecheck:lens-main passed
  • bun run check:licenses, check:switch-exhaustiveness,
    check:max-lines-ratchet, check:doc-paths, and check:reliability-gates
    passed
  • bun run build and bun run build:desktop passed
  • focused lifecycle, stream, host, and Codex runtime tests passed

Notes

The raw bun test command runs process-wide module mocks together; the
repository's isolated test runner is the CI path and was used for the full
suite. Resource retirement is bounded and reversible: the next request starts
a fresh App Server and resumes the persisted thread when needed.

@astyfx
astyfx requested a review from a team as a code owner September 8, 2026 12:41
@astyfx
astyfx requested review from JongSikLim and dodonmountain and removed request for a team September 8, 2026 12:41
@upwind-code-us

upwind-code-us Bot commented Sep 8, 2026

Copy link
Copy Markdown

Upwind Upwind Code Scan - 🔍 Scan in progress…

Upwind is scanning this PR. Results will appear here when the scan completes.

@upwind-code-us

upwind-code-us Bot commented Sep 8, 2026

Copy link
Copy Markdown

Upwind Upwind IaC Scan - ✅ Passed

0 newly introduced misconfigurations · 0 resolved · 0 total in this PR vs main

View full analysis in Upwind Console →

Scan completed in 10s

Scan history (1 scan)
Commit Scanned at New Resolved Net
592cc31 < 2026-09-08 12:42 UTC 0 0 0

Last scanned: 592cc31 · 2026-09-08 12:42 UTC

@astyfx
astyfx enabled auto-merge (squash) September 8, 2026 12:42

@heath-s heath-s left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@astyfx
astyfx merged commit c7cf593 into main Sep 8, 2026
5 checks passed
@astyfx
astyfx deleted the fix/perf-0909 branch September 8, 2026 13:05
@astyfx astyfx mentioned this pull request Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants