Skip to content

[Fix] Shell exit codes are always missing from task transcripts and the completion check - #3080

Merged
mrubens merged 1 commit into
developfrom
fix/opencode-shell-exit-code
Sep 22, 2026
Merged

mrubens merged 1 commit into
developfrom
fix/opencode-shell-exit-code

Conversation

@mrubens

@mrubens mrubens commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Problem

OpenCode's shell tool (1.18, which the worker pins) reports a command's exit code as metadata.exit. extractOpenCodeExitCode in the harness reads metadata.exitCode, metadata.code, and the same two keys on the output object, so every shell result is recorded with a null exit code. On the nightly deployment, 0 of 3,283 shell results in the last 24 hours carry one. The shell tool's own <shell_metadata> block only reports timeouts and aborts, so the code is not recoverable from the output text either.

This matters more since #3071: the completion check holds the agent's "tests pass" claim against the recorded commands, and without exit codes it can only go by the output tail.

Change

Read metadata.exit as well, ahead of the legacy keys. One line plus a test that feeds the 1.18 metadata shape through the harness and checks the exit code reaches the completion check.

Validation

  • Harness completion-gate tests (13), pnpm lint:fast, pnpm check-types:fast.

@roomote-community

roomote-community Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

No code issues found. See task

Reviewed 9b6275e

@mrubens
mrubens marked this pull request as ready for review September 22, 2026 00:45
@mrubens
mrubens merged commit 0b832c6 into develop Sep 22, 2026
17 checks passed
@mrubens
mrubens deleted the fix/opencode-shell-exit-code branch September 22, 2026 00:46
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.

1 participant