Skip to content

fix(tui): show read-tool failures with error evidence - #570

Merged
tt-a1i merged 1 commit into
openpi-dev:mainfrom
ooiuuii:fix/read-tool-error-evidence
Sep 20, 2026
Merged

tt-a1i merged 1 commit into
openpi-dev:mainfrom
ooiuuii:fix/read-tool-error-evidence

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Problem

Fixes #569.

Native Pi tool failures reach these read-only tools with isError: true, but their TUI renderers ignored that flag. fd / rg can show undefined counts or empty results, and git_show / git_diff / git_log can show success labels for failed reads.

Value

Operators can distinguish a genuine empty search from a failed command without losing the reason for failure.

Approach

Check the native renderer context's isError before the normal success/partial paths. Show a failure label and reuse the existing sanitized, bounded 20-line preview. Apply the same projection invariant to all five sibling tools in one PR.

Tool execution, canonical output, parameters, and resource handling are unchanged. This is independent of the shared-process refactor in #368 and the revision/path boundary fix in #564.

Validation

  • Actual registered tools through Pi's native Agent and ToolExecutionComponent: missing binary, invalid regex and unknown Git revision fixtures reproduced false success; corrected output reports failure.
  • New regression suite was 11/11 failing before the production fix; final expanded suite 16/16 passes, covering both display modes, successful empty/partial results, sanitization, bounded errors and successful artifact links.
  • Focused Node tests including Git reads: 29/29 pass; file-search Vitest suite: 30/30 pass.
  • bun run check, git diff --check — pass.
  • One scoped read-only code review — no actionable findings.
  • Full local suite is not claimed green: this Windows host has reproduced baseline timeouts and a background-terminal child-cleanup hang; that hanging group was not repeated here. Fresh GitHub CI results remain authoritative for this branch's full run.

Impact

  • User-visible: failures now show failure status and readable error evidence.
  • Model-visible context/tools: unchanged.
  • Runtime/lifecycle and persisted config/data: unchanged.
  • Compatibility/risk: uses Pi's existing renderer error flag and preview sanitization; normal results and output-artifact links retain their behavior.

@tt-a1i
tt-a1i merged commit e25b26f into openpi-dev:main Sep 20, 2026
7 checks passed
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(tui): read-tool failures render as successful or empty results

2 participants