Skip to content

fix(sessions): preserve native Bash failure status in previews - #580

Open
ooiuuii wants to merge 1 commit into
openpi-dev:mainfrom
ooiuuii:fix/sessions-native-bash-status
Open

ooiuuii wants to merge 1 commit into
openpi-dev:mainfrom
ooiuuii:fix/sessions-native-bash-status

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Problem

Fixes #575.

Native Pi bashExecution messages carry exitCode and cancelled, not the isError field alone used by the Sessions preview. Failed commands can therefore appear without a failure marker in history.

Value

Preserve the command's actual failure or cancellation outcome when reviewing a past session.

Approach

Project native cancellation and defined nonzero exit codes onto the existing Bash preview error flag. Preserve explicit legacy isError; keep unknown exit status unmarked. No execution or canonical-history changes.

Validation

  • Actual isolated SDK AgentSession.executeBash("exit 7") produces the canonical message used by the preview regression; no model/provider call or private state.
  • New tests: unchanged code 3 pass / 4 fail; fixed 7/7 pass.
  • Complete Sessions group: 42/42 Node, 42/42 Bun. Covers success, nonzero exit, cancellation, unknown status, legacy flags and unchanged history.
  • bun run check, git diff --check, one scoped read-only review — pass/no actionable findings.
  • Full local suite not claimed green: this host has separately reproduced baseline timing failures and Windows child-cleanup hangs. The unsafe group was not repeated; fresh branch CI supplies broader validation.

Impact

  • User-visible: accurate Bash failure/cancellation marker in Sessions previews.
  • Model-visible/tools/runtime execution: unchanged.
  • Persisted config/data: unchanged.
  • Compatibility/risk: existing preview shape and sanitization retained; no new status policy, shell behavior, or session lifecycle.

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.

bug(sessions): native Bash failures lose their preview status

1 participant