Skip to content

feat(cli): support request cancellation in bounded commands - #2990

Merged
chrisbbreuer merged 2 commits into
mainfrom
codex/bounded-process-cancellation
Oct 25, 2026
Merged

chrisbbreuer merged 2 commits into
mainfrom
codex/bounded-process-cancellation

Conversation

@chrisbbreuer

Copy link
Copy Markdown
Member

Summary

Let finite native commands follow an HTTP request's cancellation signal. runBoundedProcess now accepts an optional native AbortSignal, refuses an already-canceled launch, and terminates and settles the owned child/readers before rejecting a later cancellation. The reason stays in cause without coercion, listeners are removed after settlement, and the first failure retains precedence.

request cancellation
  -> terminate owned process scope
  -> settle child and both readers
  -> reject with controlled message and original cause

The broader CLI checks also exposed an independent output-test launch problem: project preloads added env diagnostics to exact-output streams. Those fixtures now use their private cwd/config and a minimal OS environment. Real payloads, pipes, assertions, compiled autoload settings and timing guards remain intact.

Refs #2988 and #2989. This is a prerequisite for Open Farming's authenticated planning adapter; it does not implement that adapter or its ownership decisions.

Evidence

  • Before: three genuine missing-cancellation failures. An already-canceled call still launched, and live producers waited for their normal deadline. Separately, the unchanged broad CLI suite reported three output cases contaminated by project env warnings.
  • After: final native Buddy focused runs pass all 23 process cases and all 8 source/compiled output cases. Tests observe real PIDs, pending pipes/exit, an exited parent with an inherited-pipe descendant, listener removal, invalid admission, a registration race and opaque reasons. Existing limits, strict UTF8 and nonzero results remain covered.
  • The complete CLI package suite passed 109 tests with 213 assertions after fixture isolation. Its repeat was stopped before launch by the fresh 4 GB disk guard after later fixture typing cleanup. Exact candidate CI remains the final broad gate; the blocked repeat is not a pass.
  • Native frozen install preserves the lock. Full framework typecheck, CLI declaration checks, targeted strict fixture types, package build and 438-page docs build pass. A copied built module works outside the checkout with preloads and package auto-install disabled. Lint passes with six existing utility-class warnings in unrelated views. Independent Spec and Standards reviews are clean.
  • The buffered first-cause counterfactual probe passed and is not presented as an established prior decoder/cancellation regression.

Merge Danger

Door: Two-way.

Blast Radius: CLI.

The option is additive. Existing omitted-signal limits and result shape remain intact. Invalid supplied signals now reject before launch; cancellation rejects with <label> canceled. POSIX cleanup covers the owned process group; Windows covers the direct child/readers. Escaped descendants and hostile-code containment are outside the contract. Native source release and actual public consumer qualification remain separate acceptance gates.

@github-actions github-actions Bot added cli @stacksjs/cli docs @stacksjs/docs storage @stacksjs/storage core labels Oct 25, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@stacksjs/action-runner

npm i https://pkg.pr.new/@stacksjs/action-runner@2990

@stacksjs/actions

npm i https://pkg.pr.new/@stacksjs/actions@2990

@stacksjs/ai

npm i https://pkg.pr.new/@stacksjs/ai@2990

@stacksjs/alias

npm i https://pkg.pr.new/@stacksjs/alias@2990

@stacksjs/analytics

npm i https://pkg.pr.new/@stacksjs/analytics@2990

@stacksjs/api

npm i https://pkg.pr.new/@stacksjs/api@2990

@stacksjs/arrays

npm i https://pkg.pr.new/@stacksjs/arrays@2990

@stacksjs/audio

npm i https://pkg.pr.new/@stacksjs/audio@2990

@stacksjs/auth

npm i https://pkg.pr.new/@stacksjs/auth@2990

@stacksjs/browser

npm i https://pkg.pr.new/@stacksjs/browser@2990

@stacksjs/browser-extension

npm i https://pkg.pr.new/@stacksjs/browser-extension@2990

@stacksjs/buddy

npm i https://pkg.pr.new/@stacksjs/buddy@2990

@stacksjs/build

npm i https://pkg.pr.new/@stacksjs/build@2990

@stacksjs/cache

npm i https://pkg.pr.new/@stacksjs/cache@2990

@stacksjs/calendar-api

npm i https://pkg.pr.new/@stacksjs/calendar-api@2990

@stacksjs/charts

npm i https://pkg.pr.new/@stacksjs/charts@2990

@stacksjs/chat

npm i https://pkg.pr.new/@stacksjs/chat@2990

@stacksjs/cli

npm i https://pkg.pr.new/@stacksjs/cli@2990

@stacksjs/cloud

npm i https://pkg.pr.new/@stacksjs/cloud@2990

@stacksjs/cms

npm i https://pkg.pr.new/@stacksjs/cms@2990

@stacksjs/collections

npm i https://pkg.pr.new/@stacksjs/collections@2990

@stacksjs/commerce

npm i https://pkg.pr.new/@stacksjs/commerce@2990

@stacksjs/composables

npm i https://pkg.pr.new/@stacksjs/composables@2990

@stacksjs/config

npm i https://pkg.pr.new/@stacksjs/config@2990

@stacksjs/cron

npm i https://pkg.pr.new/@stacksjs/cron@2990

@stacksjs/database

npm i https://pkg.pr.new/@stacksjs/database@2990

@stacksjs/datetime

npm i https://pkg.pr.new/@stacksjs/datetime@2990

@stacksjs/defaults

npm i https://pkg.pr.new/@stacksjs/defaults@2990

@stacksjs/desktop-build

npm i https://pkg.pr.new/@stacksjs/desktop-build@2990

@stacksjs/dns

npm i https://pkg.pr.new/@stacksjs/dns@2990

@stacksjs/docs

npm i https://pkg.pr.new/@stacksjs/docs@2990

@stacksjs/email

npm i https://pkg.pr.new/@stacksjs/email@2990

@stacksjs/enums

npm i https://pkg.pr.new/@stacksjs/enums@2990

@stacksjs/env

npm i https://pkg.pr.new/@stacksjs/env@2990

@stacksjs/error-handling

npm i https://pkg.pr.new/@stacksjs/error-handling@2990

@stacksjs/events

npm i https://pkg.pr.new/@stacksjs/events@2990

@stacksjs/faker

npm i https://pkg.pr.new/@stacksjs/faker@2990

@stacksjs/feature-flags

npm i https://pkg.pr.new/@stacksjs/feature-flags@2990

@stacksjs/features

npm i https://pkg.pr.new/@stacksjs/features@2990

@stacksjs/forms

npm i https://pkg.pr.new/@stacksjs/forms@2990

@stacksjs/git

npm i https://pkg.pr.new/@stacksjs/git@2990

@stacksjs/github

npm i https://pkg.pr.new/@stacksjs/github@2990

@stacksjs/health

npm i https://pkg.pr.new/@stacksjs/health@2990

@stacksjs/http

npm i https://pkg.pr.new/@stacksjs/http@2990

@stacksjs/i18n

npm i https://pkg.pr.new/@stacksjs/i18n@2990

@stacksjs/image

npm i https://pkg.pr.new/@stacksjs/image@2990

@stacksjs/lint

npm i https://pkg.pr.new/@stacksjs/lint@2990

@stacksjs/logging

npm i https://pkg.pr.new/@stacksjs/logging@2990

@stacksjs/mobile

npm i https://pkg.pr.new/@stacksjs/mobile@2990

@stacksjs/model-meta

npm i https://pkg.pr.new/@stacksjs/model-meta@2990

@stacksjs/newsletter

npm i https://pkg.pr.new/@stacksjs/newsletter@2990

@stacksjs/notifications

npm i https://pkg.pr.new/@stacksjs/notifications@2990

@stacksjs/objects

npm i https://pkg.pr.new/@stacksjs/objects@2990

@stacksjs/orm

npm i https://pkg.pr.new/@stacksjs/orm@2990

@stacksjs/pagination

npm i https://pkg.pr.new/@stacksjs/pagination@2990

@stacksjs/path

npm i https://pkg.pr.new/@stacksjs/path@2990

@stacksjs/payments

npm i https://pkg.pr.new/@stacksjs/payments@2990

@stacksjs/push

npm i https://pkg.pr.new/@stacksjs/push@2990

@stacksjs/query-builder

npm i https://pkg.pr.new/@stacksjs/query-builder@2990

@stacksjs/queue

npm i https://pkg.pr.new/@stacksjs/queue@2990

@stacksjs/realtime

npm i https://pkg.pr.new/@stacksjs/realtime@2990

@stacksjs/registry

npm i https://pkg.pr.new/@stacksjs/registry@2990

@stacksjs/repl

npm i https://pkg.pr.new/@stacksjs/repl@2990

@stacksjs/router

npm i https://pkg.pr.new/@stacksjs/router@2990

@stacksjs/scheduler

npm i https://pkg.pr.new/@stacksjs/scheduler@2990

@stacksjs/search-engine

npm i https://pkg.pr.new/@stacksjs/search-engine@2990

@stacksjs/security

npm i https://pkg.pr.new/@stacksjs/security@2990

@stacksjs/server

npm i https://pkg.pr.new/@stacksjs/server@2990

@stacksjs/shell

npm i https://pkg.pr.new/@stacksjs/shell@2990

@stacksjs/sites

npm i https://pkg.pr.new/@stacksjs/sites@2990

@stacksjs/skills

npm i https://pkg.pr.new/@stacksjs/skills@2990

@stacksjs/slug

npm i https://pkg.pr.new/@stacksjs/slug@2990

@stacksjs/sms

npm i https://pkg.pr.new/@stacksjs/sms@2990

@stacksjs/socials

npm i https://pkg.pr.new/@stacksjs/socials@2990

@stacksjs/storage

npm i https://pkg.pr.new/@stacksjs/storage@2990

@stacksjs/strings

npm i https://pkg.pr.new/@stacksjs/strings@2990

@stacksjs/testing

npm i https://pkg.pr.new/@stacksjs/testing@2990

@stacksjs/tinker

npm i https://pkg.pr.new/@stacksjs/tinker@2990

@stacksjs/tunnel

npm i https://pkg.pr.new/@stacksjs/tunnel@2990

@stacksjs/types

npm i https://pkg.pr.new/@stacksjs/types@2990

@stacksjs/ui

npm i https://pkg.pr.new/@stacksjs/ui@2990

@stacksjs/utils

npm i https://pkg.pr.new/@stacksjs/utils@2990

@stacksjs/validation

npm i https://pkg.pr.new/@stacksjs/validation@2990

@stacksjs/video

npm i https://pkg.pr.new/@stacksjs/video@2990

@stacksjs/whois

npm i https://pkg.pr.new/@stacksjs/whois@2990

commit: 9423413

@chrisbbreuer
chrisbbreuer marked this pull request as ready for review October 25, 2026 12:46
@chrisbbreuer
chrisbbreuer merged commit 9423413 into main Oct 25, 2026
23 checks passed

This branch was successfully deployed

1 active deployment
production — 94234136 Deployed Oct 25, 2026 by chrisbbreuer via deploy #37967
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli @stacksjs/cli core docs @stacksjs/docs storage @stacksjs/storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant