Skip to content

Fix missing exit code check for streaming prepare command#42

Merged
jsk11235 merged 1 commit intomainfrom
fix-prepare-exit-code-check
Feb 17, 2026
Merged

Fix missing exit code check for streaming prepare command#42
jsk11235 merged 1 commit intomainfrom
fix-prepare-exit-code-check

Conversation

@jsk11235
Copy link
Copy Markdown
Collaborator

The streaming version of run_stream() did not return exit code information, so the prepare command in DefaultProvider would proceed even if the command failed with non-zero exit code.

Changes:

  • Add ExitCode(i32) variant to OutputLine enum
  • Modify ShellConnector::run_stream() to yield exit code after stdout/stderr complete
  • Check exit code in DefaultProvider::from_config() and return ProviderError::ExecFailed if prepare command fails
  • Handle new ExitCode variant in output callbacks

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown

Vet found 4 issues.


[documentation_implementation_mismatch] (severity 3/5) (confidence 0.95)

The doc example for run_stream in the module-level documentation of src/connector.rs shows a match on OutputLine with only Stdout and Stderr variants, but the enum now has an ExitCode variant. The example would fail to compile due to non-exhaustive match.

[documentation_implementation_mismatch] (severity 3/5) (confidence 0.95)

The with_output_callback method's doc example in src/orchestrator/runner.rs shows a match with only Stdout and Stderr variants, missing the new ExitCode variant. This would fail to compile.


src/provider.rs:426

[documentation_implementation_mismatch] (severity 3/5) (confidence 0.95)

The doc example for stream_output in src/provider.rs shows a match on OutputLine with only Stdout and Stderr variants, but the enum now has an ExitCode variant. This example would fail to compile due to non-exhaustive match.


src/connector.rs:423

[test_coverage] (severity 2/5) (confidence 0.85)

The new ExitCode variant and the exit code streaming behavior in ShellConnector::run_stream() are not covered by any tests. A test should verify that run_stream yields an ExitCode item after stdout/stderr, and that the exit code value is correct for both successful and failing commands.

The streaming version of run_stream() did not return exit code
information, so the prepare command in DefaultProvider would proceed
even if the command failed with non-zero exit code.

Changes:
- Add ExitCode(i32) variant to OutputLine enum
- Modify ShellConnector::run_stream() to yield exit code after
  stdout/stderr complete
- Check exit code in DefaultProvider::from_config() and return
  ProviderError::ExecFailed if prepare command fails
- Handle new ExitCode variant in output callbacks
- Add tests for run_stream exit code behavior

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jsk11235 jsk11235 force-pushed the fix-prepare-exit-code-check branch from aa12999 to fc2a6db Compare February 17, 2026 17:56
@github-actions
Copy link
Copy Markdown

Vet found 3 issues.


[correctness_syntax_issues] (severity 3/5) (confidence 0.95)

The Connector trait's run_stream doc example in src/connector.rs shows a match on OutputLine with only Stdout and Stderr arms. With the new ExitCode variant, this example would fail to compile due to non-exhaustive match.


src/connector.rs:179

[documentation_implementation_mismatch] (severity 3/5) (confidence 0.97)

The docstring for the run_stream method on the Connector trait says 'The stream does not provide the exit code. If you need the exit code, use run instead...' but the implementation now yields OutputLine::ExitCode as the last item in the stream. The doc comment should be updated to reflect that the stream now includes the exit code.


src/orchestrator/runner.rs:73

[correctness_syntax_issues] (severity 3/5) (confidence 0.95)

The OutputCallback type doc example in src/orchestrator/runner.rs shows a match on OutputLine with only Stdout and Stderr arms, but the enum now has an ExitCode variant. This doc example would fail to compile due to non-exhaustive match.

@jsk11235 jsk11235 merged commit 1b3e7fa into main Feb 17, 2026
3 checks passed
@jsk11235 jsk11235 deleted the fix-prepare-exit-code-check branch February 17, 2026 18:09
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