Skip to content

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

Description

@ooiuuii

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions