Skip to content

Deepen process outcome policy#62

Merged
dbrosio3 merged 1 commit into
mainfrom
codex/process-outcome-policy
Jun 24, 2026
Merged

Deepen process outcome policy#62
dbrosio3 merged 1 commit into
mainfrom
codex/process-outcome-policy

Conversation

@dbrosio3

Copy link
Copy Markdown
Member

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.ts module, 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:

  • Added a new src/process/outcome-policy.ts module 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.), a runProcessOutcome function, and a formatProcessFailure utility.

Refactoring to use process outcome policy:

  • Updated src/ai/providers/run-provider-command.ts, src/runner/plugins/gitleaks.ts, and src/runner/tool-command.ts to use runProcessOutcome and related types/utilities instead of directly using runTimedCommand. 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:

  • All modules now use formatProcessFailure to 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:

  • Standardized and renamed constants for output capture/tail limits and kill grace period in src/process/timed-command.ts to use a consistent naming scheme, making configuration clearer and less error-prone. [1] [2]

Expanded test coverage:

  • Updated and expanded tests in test/process.test.ts to cover the new process outcome policy logic, including all failure modes and message formatting, ensuring robustness of the new abstraction. [1] [2]

@dbrosio3 dbrosio3 merged commit 7e95a4b into main Jun 24, 2026
1 check passed
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