Skip to content

fix(opencode): cancel parent before foreground task jobs - #12

Open
benjaminshafii wants to merge 1 commit into
openwork-devfrom
parent-first-cancel
Open

benjaminshafii wants to merge 1 commit into
openwork-devfrom
parent-first-cancel

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

Issue for this PR

Related: different-ai/openwork#4679 (native Stop correctness).

Type of change

  • Bug fix

What does this PR do?

Adds a release patch for upstream v1.18.18. SessionRunState.cancel currently settles child jobs before interrupting the parent runner. That wakes a foreground task and lets the parent issue another provider request inside the abort call. Interrupt the parent first, then sweep jobs; retain recursive and no-runner cleanup.

The included regression uses real runner/background services and a readiness barrier. It checks interruption order, no continuation, descendant cleanup, and preservation of an unrelated job. Existing no-runner tests remain enabled.

How did you verify your code works?

  • New regression on pristine v1.18.18: failed (child interrupted before parent).
  • Bun 1.3.14: task/background/runner suites: 57 passed; package typecheck and Prettier passed.
  • With prompt suite: 114 passed, 1 explicitly disabled upstream test skipped (v2 projector disabled), 0 failed.
  • Built actual darwin-arm64 engine using OPENCODE_VERSION=1.18.18-openwork.parent-first.84d1dc1 bun run script/build.ts --single --skip-install --skip-embed-web-ui.
  • Source commit: 84d1dc17ade9373f748068673b0491adf278b8fc; binary SHA256: edb4b729a45ba135b1247a62bd3ce56e19ad01bedeab6564f999eb89ad84d8e6.
  • Exported patch replayed with git am on v1.18.18; resulting tree equals tested tree df56e8b2d1e91f03d1b9919422841453d95ab315.
  • OpenWork candidate a0b265a33832ce645a4cb9a9ad624a6054d45da4: headless native PERM-03 and PERM-04 passed on candidate v1 binary, with its version asserted through native health; both v2 regressions passed. PERM-04 reports zero extra provider requests; native cancellation, unrelated requests, and exactly-once follow-up assertions retained. PERM-03 includes failed-rejection visibility and retry.

Release is gated on required reviews/checks. This PR does not dispatch a release or change the OpenWork pin. After approval, orchestrator can build upstream_ref=v1.18.18 with an unused version such as 1.18.18-openwork.0 and verify published assets before integration.

Screenshots / recordings

Not a UI change; verification uses native API and provider-request witnesses.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown

The following comment was made by an LLM, it may be inaccurate:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant