fix: ShellProcessRunner timeout throws timedOut instead of nonZeroExit - #1
Merged
Conversation
- Add OpenCodeSupplier that shells out to 'opencode db' to read ~/.local/share/opencode/opencode.db for 5h/weekly/monthly usage - Add Shell/ module (ShellProcessRunner, ShellCommand, ShellError) for async Process execution with timeout - Add OpenCodeResponseParser with three-window reset algorithms (rolling 5h, UTC Monday, anchored monthly) and unit tests - Extend shortName from 2 to 2-3 uppercase letters/digits to fit OpenCode dimension labels (OC5, MAX, etc.) - Add dimension field to SlotViewData for per-window labeling - Disable App Sandbox: required for Process.run() since macOS sandbox blocks child process creation. Trade-off documented in PRD §3.6, README, and opencode_go.md. - Add .gitignore rule for *.zip build artifacts - Update docs: PRD appendix C (status V1 supported), README providers table, project structure, test suites, security notes
…oExit - ShellProcessRunner: timeoutTask returns Bool indicating whether process was terminated - Throw ShellError.timedOut explicitly when timeout occurs, before checking exitCode - OpenCodeSupplier: log stderr on nonZeroExit for better diagnostics - ErrorSummary: add CustomStringConvertible conformance to RefreshError - Tests: tighten timeout test to strictly expect timedOut with correct seconds
This was referenced Jul 31, 2026
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
ShellProcessRunner超时时会 terminate 进程,进程被 SIGTERM 终止后以非零状态退出,错误被错误归类为nonZeroExit,最终在OpenCodeSupplier中被映射为RefreshError.parsingError——实际上超时和解析错误是完全不同的错误类型。修复
ShellProcessRunner:timeoutTask返回Bool标记进程是否因超时被终止,超时后抛出ShellError.timedOut(在检查 exitCode 之前)OpenCodeSupplier:nonZeroExit分支增加logger.error记录实际的错误码和 stderr 前缀,方便排查真正的非零退出问题ErrorSummary: 为RefreshError添加CustomStringConvertible扩展timedOut及秒数改动文件
ShellProcessRunner.swiftOpenCodeSupplier.swiftErrorSummary.swiftShellProcessRunnerTests.swift