Skip to content

fix(pi): preserve native abort outcomes - #17853

Merged
Yash-Singh1 merged 2 commits into
pingdotgg:mainfrom
StiensWout:t3code/pi-native-aborts
Oct 10, 2026
Merged

Yash-Singh1 merged 2 commits into
pingdotgg:mainfrom
StiensWout:t3code/pi-native-aborts

Conversation

@StiensWout

Copy link
Copy Markdown
Contributor

Problem

Pi-native aborts could be recorded as completed turns.

Change

Carry the native aborted outcome through the existing idle settlement check and clear it when a new agent run starts, preserving queued continuation and wake acknowledgement barriers. Native cancellations from extensions, compaction, or session replacement now use the existing interrupted-run presentation, including its "Run interrupted by user" row.

Scope and approval

Maintainer-requested Pi support follow-up. Scope is native Pi abort outcomes in the existing turn lifecycle.

Verification

Validation: 82 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:S 10-29 changed lines (additions + deletions). labels Oct 10, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 79d6e92

Macroscope's review found this PR approvable — This is a narrowly scoped Pi adapter bug fix that preserves native cancellation outcomes through the existing turn lifecycle and adds targeted regression coverage. It does not introduce new capabilities, schema changes, product-default changes, or static-analysis suppressions.

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: b2e8fade-e88d-4c0b-9b56-49a19b999b43

📥 Commits

Reviewing files that changed from the base of the PR and between a11f464 and 79d6e92.


📒 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; 2 remain after this review.



📝 Walkthrough

Walkthrough

The Pi adapter now records native aborts and treats them as interruptions during provider turn finalization. Tests cover aborted and non-aborted settlements, joined prompts, and retry-progress items.

Changes

Native abort settlement

Layer / File(s) Summary
Track native abort state
packages/provider-pi/src/server/adapter.ts
The active turn records Pi’s aborted value from settlement events and adopted settled wakes. New turns initialize the state, and a new agent_start clears it.
Finalize aborted turns
packages/provider-pi/src/server/adapter.ts, packages/provider-pi/src/server/adapter.test.ts
Finalization treats native aborts as interruptions when updating compaction and retry items, suppressing failure, setting turn status, and reporting terminal events. Tests cover settlement outcomes, joined prompts, and retry-progress interruption.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: juliusmarminge


Merge Risk | ⚪ Minimal · up to 79d6e

Merge Risk: ⚪ Minimal · up to 79d6e

No concrete issue remains that would prevent merging the native-abort settlement change after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 79d6e

Native cancellations now use the existing interrupted outcome without adding access, privileges or external interfaces. Settlement barriers and transport-failure reporting remain in place. Residual uncertainty concerns cancellation overlapping transport failure, not an established security vulnerability.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated change affects existing Pi turns, their retry/compaction items and downstream run outcomes. It does not demonstrate expanded tenant, service or credential exposure; deployed topology was not available to establish a broader maximum scope.

Trust Boundaries and Controls

  • observed — Turn finalization still cancels pending native prompts. Existing orchestration handling also dismisses native user inputs when provider turns become interrupted or terminal; native abort does not leave those requests open merely because it uses a different terminal outcome.

Resilience and Maintainability Implications

  • observed — Native cancellation is distinct from planned process shutdown. Unexpected transport closure still fails pending RPC requests, rejects outgoing work, marks the session errored and fails its event stream. Downstream failure recovery avoids rewriting an already-finalized run. These controls counter the possible interrupted-turn/errored-session combination, although that precise overlap lacks direct test coverage.

Pre-merge checks | Passed 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check Passed The title is concise, uses the conventional commit format, and clearly identifies the fix for preserving native Pi abort outcomes.
Description check Passed The description includes the required Problem, Change, Scope and approval, and Verification sections. It explains the behavior change and reports focused validation results.
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.

✨ 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 7e8071f into pingdotgg:main Oct 10, 2026
30 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:S 10-29 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