Problem
The Sessions history preview reads isError from native Pi bashExecution messages, but their outcome is carried by exitCode and cancelled. A failed native ! command therefore loses its failure indication in the preview.
Reproduction
At main f6b49ae59605b1276b8267f2886d22c03f01533c, an isolated native SDK AgentSession.executeBash("exit 7") produces a canonical message with exitCode: 7, cancelled: false. Passing that actual message through buildSessionPreview() does not mark the Bash block as failed; the existing renderer consequently shows the ordinary Bash marker.
This uses a real local shell but no model, external service, installed user session or private data.
Expected
Map native nonzero exit codes and cancellation onto the existing preview error flag. Preserve explicit legacy error flags, do not label an unknown exit code as failure, and leave the canonical history unchanged.
New regressions: unchanged code 3 pass / 4 fail; fixed code 7/7 pass. Complete Sessions tests pass under both Node and Bun (42/42 each).
Problem
The Sessions history preview reads
isErrorfrom native PibashExecutionmessages, but their outcome is carried byexitCodeandcancelled. A failed native!command therefore loses its failure indication in the preview.Reproduction
At main
f6b49ae59605b1276b8267f2886d22c03f01533c, an isolated native SDKAgentSession.executeBash("exit 7")produces a canonical message withexitCode: 7, cancelled: false. Passing that actual message throughbuildSessionPreview()does not mark the Bash block as failed; the existing renderer consequently shows the ordinary Bash marker.This uses a real local shell but no model, external service, installed user session or private data.
Expected
Map native nonzero exit codes and cancellation onto the existing preview error flag. Preserve explicit legacy error flags, do not label an unknown exit code as failure, and leave the canonical history unchanged.
New regressions: unchanged code 3 pass / 4 fail; fixed code 7/7 pass. Complete Sessions tests pass under both Node and Bun (42/42 each).