# fix\(providers\): correct Pi subagent failure status and bound error logs · stienswout/t3code

[View on GitCafe](https://git.cafe/stienswout/t3code/commit/bb4a39e29afb890fadc7164adc48f496c68ef854)

Repository: [stienswout/t3code](https://git.cafe/stienswout/t3code)

Visibility: public

Requested revision: bb4a39e29afb890fadc7164adc48f496c68ef854

Requested commit: bb4a39e29afb890fadc7164adc48f496c68ef854

Commit: bb4a39e29afb890fadc7164adc48f496c68ef854

Tree: f77af51ee47578b60f2ae28a706f276218fe2c7e

Author: Wout Stiens

Committer: Wout Stiens

## Message

```
fix(providers): correct Pi subagent failure status and bound error logs

Review findings on the subagent surface:

- A non-zero subagent `exitCode` now counts as a failure regardless of
  whether the parent tool has ended. Gating it on `completed` let a finished
  child report "completed" while `piSubagentOutput` returned its stderr as
  the result, and left exit-code-only failures "running" until the parent
  tool finished.
- Fall back to `stderr` with `||` rather than `??`, so a failure carrying an
  empty `errorMessage` no longer hides a non-empty `stderr`.
- Log only the length of pi's extension-error and rejected-steer payloads.
  Both are unbounded remote output that can carry prompt text or
  credentials, matching the `stderrLength` form used in `PiRpc.ts`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

```

## Parents

- [41b51a7140e6b64af8ddb7730d2960ee76853c31](https://git.cafe/stienswout/t3code/commit/41b51a7140e6b64af8ddb7730d2960ee76853c31?format=markdown)

[Source at this commit](https://git.cafe/stienswout/t3code/tree/bb4a39e29afb890fadc7164adc48f496c68ef854?format=markdown)
