GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): abort OpenCode child sessions on interrupt by NitayRabi · Pull Request #7770 · pingdotgg/t3code

Conversation

@NitayRabi

@NitayRabi NitayRabi commented Aug 21, 2026 •
edited by macroscopeapp Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

  • enumerate OpenCode child sessions when interrupting a turn
  • abort child/sub-agent sessions before aborting the parent session
  • preserve parent abort behavior when child enumeration is unsupported or fails
  • add regression coverage for multiple child sessions

Closes #7769.

Why

OpenCode sub-agents use child sessions. Relying only on session.abort(parent) leaves T3 dependent on the installed OpenCode version propagating cancellation to all children. When that propagation fails, the child provider stream remains alive and can occupy a single-slot local inference server indefinitely.

Validation

  • vp test apps/server/src/provider/Layers/OpenCodeAdapter.test.ts (33 passed)
  • vp run --filter t3 typecheck
  • vp fmt --check apps/server/src/provider/Layers/OpenCodeAdapter.ts apps/server/src/provider/Layers/OpenCodeAdapter.test.ts
  • git diff --check

Note

Abort child OpenCode sessions on interruptTurn

  • Adds abortOpenCodeSessionTree to abort a parent session and then enumerate and abort its children concurrently via the SDK in OpenCodeAdapter.ts
  • interruptTurn now calls this tree-abort utility instead of aborting only the parent
  • Test double gains onAbort and sessionChildrenById hooks to simulate children created during parent abort
  • Risk: per-child abort errors are silently ignored; if the SDK children query fails, child sessions may survive the interrupt

Macroscope summarized a677515.


Note

Medium Risk
Changes turn-interrupt cancellation for OpenCode, which can leave local inference slots occupied if child aborts are missed. Child enumeration errors are swallowed, so a failed session.children call still only aborts the parent.

Overview
User interrupt now cancels the OpenCode parent session first, then enumerates remaining child/sub-agent sessions and aborts those too. That covers older OpenCode builds that do not propagate parent abort, and still catches children spawned during the parent abort.

interruptTurn uses a new abortOpenCodeSessionTree helper. Child listing failures become an empty list (parent abort still succeeds). Individual child aborts are ignored so one failure does not block the rest.

Adds a regression test that asserts parent abort is first and that children present at abort time—including one created during parent abort—are aborted afterwards.

Reviewed by Cursor Bugbot for commit a677515. Bugbot is set up for automated code reviews on this repo. Configure here.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@NitayRabi
fix(server): abort OpenCode child sessions on interrupt
05630bb
@coderabbitai

coderabbitai Bot commented Aug 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ed704adb-9a8e-40d1-b4ba-ff3b20a26d11

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 21, 2026
macroscopeapp[bot]
macroscopeapp Bot reviewed Aug 21, 2026
View reviewed changes
Comment thread apps/server/src/provider/Layers/OpenCodeAdapter.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@NitayRabi
fix(server): abort OpenCode parent before children
75efead
@NitayRabi
NitayRabi marked this pull request as ready for review August 24, 2026 13:17
@NitayRabi
Merge branch 'main' into fix/opencode-abort-child-sessions
a677515
macroscopeapp[bot]
macroscopeapp Bot approved these changes Aug 24, 2026
View reviewed changes
@macroscopeapp

macroscopeapp Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a677515

Macroscope's review found this PR approvable — This is a focused OpenCode cancellation bug fix that preserves parent interruption while also cleaning up surviving child sessions. The production change is isolated to interrupt handling and is covered by targeted regression tests.

Notes:

  • No code objects were reviewed. Approvability was decided on eligibility alone.

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge

juliusmarminge commented Sep 1, 2026

Copy link
Copy Markdown
Member

Closing because #9005 already added OpenCode child-session cancellation, including children created during the parent abort and nested descendants. Thanks for working on this!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge closed this Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@macroscopeapp macroscopeapp[bot] macroscopeapp[bot] approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

OpenCode Stop can leave sub-agent provider requests running

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@NitayRabi @juliusmarminge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.