镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

fix(core): report generate body timeouts correctly (carries #165) - #187

Merged
pierreraby merged 1 commit into
mainfrom
carry/pr165-body-timeouts
Nov 4, 2026
Merged

pierreraby merged 1 commit into
mainfrom
carry/pr165-body-timeouts

Conversation

@pierreraby

Copy link
Copy Markdown
Collaborator

Carries the stalled-response-body timeout fix from #165 by @patlux (cef7402f9f382e9b30252d29178efaf49392cc75). This is independent of the OAuth carry in #186 and the remaining fix groups in #165; it does not close #165.

Changes

  • Classify an attempt timeout while reading a generate response body as a timeout, not a user cancellation.
  • Retry only when no visible content has been emitted and retries remain.
  • Report an actionable timeout when content was already emitted or the retry budget is exhausted.
  • Preserve genuine user cancellation without retry.

The source and regression-test changes are identical to patlux's original commit. Only the CHANGELOG entry is adapted to current main, with explicit credit and scope. The commit includes a co-author trailer.

Scope

This fixes the extension-owned generate transport only. It does not change native Provider API retries, add mid-stream transport switching, or implement the breaking removal of generate proposed in #164.

Validation

Based on main 999b690:

  • Head regression tests against unmodified main: three failures (timeout reported as aborted after partial text; no retry after headers/content-free event; exhausted body timeout reported as aborted).
  • Corrected retry suite: 20/20 PASS, including existing abort and no-retry-after-content guards.
  • Full npm test: PASS, including project typecheck and real Pi/OMP against loopback mocks.
  • npm run format:check and git diff --check: PASS.

No paid API calls or production credentials used. The editor LSP reported unresolved Node types in the temporary worktree; the project TypeScript compiler completed successfully with the existing dependencies.

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Memory benchmark

Compared base fc292d4 with PR head baa552e on the same GitHub-hosted darwin runner. Lower values are better.

Metric Base PR PR − Base Change
Stable RSS 106.8 MiB ± 0.6 MiB 107.5 MiB ± 0.6 MiB +0.7 MiB ± 0.8 MiB +0.7%
Physical footprint 61.4 MiB ± 0.6 MiB 61.1 MiB ± 0.5 MiB -0.3 MiB ± 0.9 MiB -0.5%
Physical peak 72.8 MiB ± 1.7 MiB 72.5 MiB ± 0.5 MiB -0.1 MiB ± 1.0 MiB -0.2%

Interpretation: No metric shows a clear Base-to-PR difference beyond its measured run-to-run variation.

Extension overhead above pi baseline

Metric Base overhead PR overhead Difference
Stable RSS +5.3 MiB ± 1.0 MiB +5.1 MiB ± 1.0 MiB +0.7 MiB ± 0.8 MiB
Physical footprint +2.9 MiB ± 0.8 MiB +3.6 MiB ± 0.2 MiB -0.3 MiB ± 0.9 MiB
Physical peak +4.2 MiB ± 1.7 MiB +4.4 MiB ± 1.1 MiB -0.1 MiB ± 1.0 MiB

Values are medians of 6 alternating, paired runs. The value after ± is the median absolute deviation (MAD). Each process was sampled 12 times after a 2500 ms warm-up.

Environment: pi 0.84.4, Bun 1.4.4, darwin arm64. RSS comes from ps; physical footprint and peak come from macOS footprint.

This is a comparative signal, not a pass/fail threshold. GitHub-hosted runner noise can affect absolute values.

@pierreraby

Copy link
Copy Markdown
Collaborator Author

CI status at head d991056: correctness/typecheck, formatting, OMP compatibility, security checks and memory benchmark pass. The catalog/pricing check fails on missing-local-price | stealth/crouton-alpha.

The public Provider API currently advertises 96 models, including this new model. This PR changes neither src/pricing.ts nor the pricing checker relative to main 999b690, so the missing entry is inherited rather than introduced by the timeout fix. The pricing report lists Crouton Alpha as free while its stealth preview lasts; it needs a separate reviewed catalog/pricing change. No pricing check has been bypassed or weakened.

@pierreraby

Copy link
Copy Markdown
Collaborator Author

Pricing blocker resolved: #188 has landed on main as 26c4490, and this PR is rebased onto that commit (new head 54ab00f). The only rebase conflict was CHANGELOG.md; both entries are preserved. Range-diff confirms no source/test changes to the timeout fix. Full local suite (Pi/OMP), pricing check (96 models), and formatting pass again. All checks on the new head are now green, including catalog/pricing and memory. This PR remains open; no merge performed.

Carries the response-body timeout fix from #165 (cef7402), independently of its other fix groups. Preserve user cancellation and never retry after visible content.

Co-authored-by: Patrick Wozniak <email@patwoz.de>
@pierreraby
pierreraby force-pushed the carry/pr165-body-timeouts branch from 54ab00f to baa552e Compare November 4, 2026 13:00
@pierreraby
pierreraby merged commit 8c93ad5 into main Nov 4, 2026
15 checks passed
@pierreraby
pierreraby deleted the carry/pr165-body-timeouts branch November 4, 2026 13:03
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.

1 participant