Skip to content

Comments

fix(cli): set non-zero exit code when run command encounters errors#14553

Open
kevinWangSheng wants to merge 4 commits intoanomalyco:devfrom
kevinWangSheng:fix/plugin-resolution-logging
Open

fix(cli): set non-zero exit code when run command encounters errors#14553
kevinWangSheng wants to merge 4 commits intoanomalyco:devfrom
kevinWangSheng:fix/plugin-resolution-logging

Conversation

@kevinWangSheng
Copy link

@kevinWangSheng kevinWangSheng commented Feb 21, 2026

Issue for this PR

Closes #14551

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

opencode run exits with code 0 even when the session encounters errors. This breaks CI/CD pipelines. The fix awaits the event loop and checks the error state, setting process.exitCode = 1 if errors occurred.

How did you verify your code works?

Tested that the exit code changes to 1 when the session produces errors.

Screenshots / recordings

N/A - no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

shenghui kevin and others added 3 commits February 21, 2026 05:02
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The session list command supports --format json for machine-readable
output, but the models command only supported plain text. This adds a
--format option with choices "text" (default) and "json" to bring
consistency across CLI commands and enable scripting use cases.

Closes anomalyco#14550

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When import.meta.resolve fails for a plugin path, the error was
completely swallowed by an empty catch block. This adds a warning log
so users can diagnose plugin loading issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Feb 21, 2026
The `model` object already contains an `id` field, so spreading it
after the explicit `id` property triggers TS2783. Move the spread
before the explicit properties so our composite id takes precedence.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Feb 21, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

fix: run command exits with 0 on session errors

1 participant