Repository navigation
Conversation
Co-Authored-By: zai-glm-52 <[email protected]> Agent: @bug-fix Scope: BUG-43445
Good hardening overall: transient-error classification with a verified retry, a circuit breaker that self-resets on success, and early-outs so a tripped breaker stops burning processes on every call. Some points:
|
|
Thanks for the review. All points addressed:
|
- Trip after 3 consecutive failures, short-circuit subsequent calls - Reset failure counter on success before tripping - Verify patch and diff return empty when breaker is tripped Co-Authored-By: zai-glm-52 <[email protected]> Agent: @bug-fix Scope: anomalyco#43455
|
Added circuit breaker tests covering the previously untested logic:
|
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
|
This PR was closed by automated PR cleanup (older than 1 month, fewer than 2 reactions). I'd like to request reopening because: The underlying issue (#43445) is still open. When Windows runs low on virtual memory, git processes spawned by the snapshot system fail with "paging file too small" errors. The snapshot code silently swallows these errors — no retry, no circuit breaker, no user notification. Snapshots stop working without any visible signal. This is directly related to a confirmed Windows-specific bug. The root cause (Windows commit limit exhaustion when multiple processes spawn in parallel) is tracked in the Go runtime (golang/go#75407, #75417) and also affects tsgo typechecking (see #49224, #49228). This PR adds resilience to the snapshot system specifically for this scenario:
No alternative exists. No other PR addresses snapshot resilience on Windows. The PR was in a reviewable state with tests for each mechanism (transient detection, retry policy, circuit breaker state transitions). I'm still actively maintaining this PR and would appreciate it being reopened. |
Issue for this PR
Closes #43445
Type of change
What does this PR do?
When Windows runs low on virtual memory, git processes spawned by the snapshot system fail with "paging file too small". The snapshot code silently swallows the error — no retry, no circuit breaker, no user notification. Snapshots stop working without any visible signal.
This adds three resilience mechanisms to
packages/opencode/src/snapshot/index.ts:isTransientGitError()matches "paging file", "out of memory", "malloc failed", etc.git()helper retries once after 500ms when a transient error is detectedtrack(),add(),patch(),diff(), anddiffFull()skip git operations entirely.recordSuccess()resets the breaker. AnEffect.logErroris emitted when it trips.How did you verify your code works?
isTransientGitError()intest/snapshot/transient-error.test.ts— 9 cases covering transient and non-transient stderr stringsbun -econfirming all 4 cases passScreenshots / recordings
N/A
Checklist