Deepen process outcome policy#62
Merged
Merged
Conversation
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.
This pull request introduces a new process outcome policy abstraction to standardize how command-line tool executions and their failures are handled throughout the codebase. The main changes include the addition of a new
outcome-policy.tsmodule, refactoring of several modules to use this new abstraction, improvements to error reporting, and updates to tests to cover the new logic.Process outcome policy abstraction:
src/process/outcome-policy.tsmodule that provides a unified way to classify, represent, and format process execution outcomes, including handling of spawn errors, timeouts, exit codes, and signals. This includes new types (ProcessOutcome,ProcessFailure, etc.), arunProcessOutcomefunction, and aformatProcessFailureutility.Refactoring to use process outcome policy:
src/ai/providers/run-provider-command.ts,src/runner/plugins/gitleaks.ts, andsrc/runner/tool-command.tsto userunProcessOutcomeand related types/utilities instead of directly usingrunTimedCommand. This centralizes process result handling and error formatting, and simplifies the logic for interpreting command outcomes. [1] [2] [3] [4] [5] [6] [7] [8]Error and failure reporting improvements:
formatProcessFailureto generate consistent, human-readable error messages for different failure types (spawn errors, timeouts, exit codes, signals), improving diagnostics for users and developers. [1] [2] [3] [4]Configuration and naming consistency:
src/process/timed-command.tsto use a consistent naming scheme, making configuration clearer and less error-prone. [1] [2]Expanded test coverage:
test/process.test.tsto cover the new process outcome policy logic, including all failure modes and message formatting, ensuring robustness of the new abstraction. [1] [2]