Skip to content

fix(pi): preserve shell command exit codes - #17834

Merged
Yash-Singh1 merged 1 commit into
pingdotgg:mainfrom
StiensWout:t3code/pi-shell-results
Oct 10, 2026
Merged

Yash-Singh1 merged 1 commit into
pingdotgg:mainfrom
StiensWout:t3code/pi-shell-results

Conversation

@StiensWout

@StiensWout StiensWout commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Pi 1.1 shell results report exit codes in structuredContent.exit_code, while older versions use details.exitCode. PowerShell results also fell through to generic tool output.

Change

Handle bash and PowerShell as shell commands, prefer the current exit code, and retain the legacy fallback.

Scope and approval

Small adapter bug fix: current Pi shell exit codes and PowerShell results were normalized incorrectly. No new capability or setting.

Verification

Validation: 79 adapter tests, Pi typecheck and scoped lint/format checks passed.

Prepared for Wout by gpt-6.1-sol in Codex.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 10, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at e7f4f40

Macroscope's review found this PR approvable — This is a focused Pi adapter bug fix that normalizes current and legacy shell exit-code formats and correctly presents PowerShell executions. It includes targeted coverage for both shell tools and does not change defaults, schemas, deployment, or static-analysis configuration.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Path: .coderabbit.config.ts
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3ea2b935-4a73-4293-bf0b-9695110bd178


📥 Commits

Reviewing files that changed from the base of the PR and between 8c777fb and e7f4f40.



📒 Files selected for processing (2)
  • packages/provider-pi/src/server/adapter.test.ts
  • packages/provider-pi/src/server/adapter.ts


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.




📝 Walkthrough
📝 Walkthrough

Walkthrough

The Pi adapter now emits command execution items for Bash and PowerShell calls. It reads the exit code from structured content first, then falls back to the legacy details field. Tests cover both formats and successful and failing results.

Changes

Pi command execution results

Layer / File(s) Summary
Command item results
packages/provider-pi/src/server/adapter.ts, packages/provider-pi/src/server/adapter.test.ts
Bash and PowerShell calls emit command execution items. The adapter reads structuredContent.exit_code first and falls back to details.exitCode. Tests cover both exit-code formats and verify item status, tool name, input, output, and reported exit code.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge



Merge Risk: ⚪ Minimal · up to e7f4f

PowerShell command results now keep their exit codes, as Bash results already did, and both the structured and legacy result formats are supported. The tests cover both tools and both formats, and no merge-blocking risk was found.

Architecture Summary

Architecture risk: 🔵 Low · up to e7f4f

The change affects 1 system.

Changed systems: packages/provider-pi

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — packages/provider-pi (library) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in packages/provider-pi/src/server/adapter.test.ts: Adds cases for bash and powershell command results using structured exit_code or legacy details.exitCode. The test checks running-item input and verifies that the final command item preserves the tool name, input, and output, reports the selected exit code, and is completed only for exit code 0.
  • observed — Modified behavior in packages/provider-pi/src/server/adapter.ts: PowerShell calls now follow Bash into the command_execution item path. Both read the exit code from structuredContent.exit_code first, falling back to details.exitCode; previously, only Bash used this path and read from details.exitCode.


Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title clearly and concisely describes the main fix: preserving shell command exit codes in the Pi adapter.
Description check Passed The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the bug, the implementation, the focused scope, and the reported test and validation r…

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@Yash-Singh1
Yash-Singh1 merged commit 62da1cd into pingdotgg:main Oct 10, 2026
31 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Oct 11, 2026
## What's Changed
* fix(pi): preserve tool images and structured results by @StiensWout in pingdotgg/t3code#17851
* fix(server): Claude 5 task lists reach the tasks drawer by @Mnigos in pingdotgg/t3code#14964
* fix(web): find bar and thread details panel stop covering each other by @MatthewFeroz in pingdotgg/t3code#17858
* fix(web): use server metadata for file chip icons by @Yash-Singh1 in pingdotgg/t3code#17923
* fix(desktop): copy images from HTML previews by @Bil0000 in pingdotgg/t3code#17555
* docs(pi): update installation and remote login guidance by @StiensWout in pingdotgg/t3code#17836
* fix(pi): preserve native abort outcomes by @StiensWout in pingdotgg/t3code#17853
* fix(pi): keep thinking defaults specific to each model by @StiensWout in pingdotgg/t3code#17835
* fix(pi): preserve shell command exit codes by @StiensWout in pingdotgg/t3code#17834
* fix(pi): expire and cancel extension approvals by @StiensWout in pingdotgg/t3code#17840
* feat(pi): include native sessions in usage reports by @StiensWout in pingdotgg/t3code#17848
* fix(server): route Copilot ACP subagent output into subagent threads by @maria-rcks in pingdotgg/t3code#17714
* fix(web): composer banner titles truncate beside their icon instead of wrapping by @maria-rcks in pingdotgg/t3code#17699
* fix(server): Muse turns no longer fail on Windows by @ntindle in pingdotgg/t3code#17163
* fix(pi): allow known read-only T3 tools without approval by @StiensWout in pingdotgg/t3code#17852
* fix: worktree threads keep their worktree when the agent starts, and messages sent during setup queue by @maria-rcks in pingdotgg/t3code#17654
* fix(server): keep Claude workflows alive while they report progress by @maria-rcks in pingdotgg/t3code#17715
* fix(web): media preview centers its content and pins the close button by @maria-rcks in pingdotgg/t3code#17951
* fix(server): threads without a project no longer need Git installed by @t3dotgg in pingdotgg/t3code#17959
* fix(web): toggling tools and thinking at the bottom keeps you at the bottom by @t3dotgg in pingdotgg/t3code#17954
* fix(web): Compact chip follows Claude's real prompt cache TTL by @t3dotgg in pingdotgg/t3code#17945
* fix(usage): bound OpenCode history reads to prevent backend OOM by @Yash-Singh1 in pingdotgg/t3code#17961
* refactor: format diff line counts through one shared helper by @maria-rcks in pingdotgg/t3code#17948
* fix: new projects start their first thread in the project folder, not a worktree by @t3dotgg in pingdotgg/t3code#17371

## New Contributors
* @ntindle made their first contribution in pingdotgg/t3code#17163

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261010.2948...v0.0.46-nightly.20261011.2955

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261011.2955
github-actions Bot added a commit to davidvanderklay/t3code-flake that referenced this pull request Oct 11, 2026
## What's Changed
* fix(pi): preserve tool images and structured results by @StiensWout in pingdotgg/t3code#17851
* fix(server): Claude 5 task lists reach the tasks drawer by @Mnigos in pingdotgg/t3code#14964
* fix(web): find bar and thread details panel stop covering each other by @MatthewFeroz in pingdotgg/t3code#17858
* fix(web): use server metadata for file chip icons by @Yash-Singh1 in pingdotgg/t3code#17923
* fix(desktop): copy images from HTML previews by @Bil0000 in pingdotgg/t3code#17555
* docs(pi): update installation and remote login guidance by @StiensWout in pingdotgg/t3code#17836
* fix(pi): preserve native abort outcomes by @StiensWout in pingdotgg/t3code#17853
* fix(pi): keep thinking defaults specific to each model by @StiensWout in pingdotgg/t3code#17835
* fix(pi): preserve shell command exit codes by @StiensWout in pingdotgg/t3code#17834
* fix(pi): expire and cancel extension approvals by @StiensWout in pingdotgg/t3code#17840
* feat(pi): include native sessions in usage reports by @StiensWout in pingdotgg/t3code#17848
* fix(server): route Copilot ACP subagent output into subagent threads by @maria-rcks in pingdotgg/t3code#17714
* fix(web): composer banner titles truncate beside their icon instead of wrapping by @maria-rcks in pingdotgg/t3code#17699
* fix(server): Muse turns no longer fail on Windows by @ntindle in pingdotgg/t3code#17163
* fix(pi): allow known read-only T3 tools without approval by @StiensWout in pingdotgg/t3code#17852
* fix: worktree threads keep their worktree when the agent starts, and messages sent during setup queue by @maria-rcks in pingdotgg/t3code#17654
* fix(server): keep Claude workflows alive while they report progress by @maria-rcks in pingdotgg/t3code#17715
* fix(web): media preview centers its content and pins the close button by @maria-rcks in pingdotgg/t3code#17951
* fix(server): threads without a project no longer need Git installed by @t3dotgg in pingdotgg/t3code#17959
* fix(web): toggling tools and thinking at the bottom keeps you at the bottom by @t3dotgg in pingdotgg/t3code#17954
* fix(web): Compact chip follows Claude's real prompt cache TTL by @t3dotgg in pingdotgg/t3code#17945
* fix(usage): bound OpenCode history reads to prevent backend OOM by @Yash-Singh1 in pingdotgg/t3code#17961
* refactor: format diff line counts through one shared helper by @maria-rcks in pingdotgg/t3code#17948
* fix: new projects start their first thread in the project folder, not a worktree by @t3dotgg in pingdotgg/t3code#17371

## New Contributors
* @ntindle made their first contribution in pingdotgg/t3code#17163

**Full Changelog**: pingdotgg/t3code@v0.0.46-nightly.20261010.2948...v0.0.46-nightly.20261011.2955

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.46-nightly.20261011.2955
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants