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(core): backport transport and process-exit cleanup by brentyates-swx · Pull Request #410 · swxtchio/swx-opencode-archive

This repository was archived by the owner on Nov 7, 2026. It is now read-only.

Conversation

@brentyates-swx

@brentyates-swx brentyates-swx commented Nov 4, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Closes https://github.com/swxtchio/swx-opencode/issues/393.

Backport the assigned transport and process-lifecycle behavior in the fork's existing owners. Preserve request options, caller cancellation, configured deadlines, fork #303's generation-progress watchdog, fork #380 cancellation cleanup, and intentional descendant release.

Donor coverage

  • anomalyco/opencode#55149 (52a10f573f1da5103c85990da9341e3645a39365), local cherry-pick ca3abb1290: the assigned TUI/run/mini fetch override is complete through packages/core/src/no-timeout-fetch.ts, packages/tui/src/context/sdk.tsx, and packages/opencode/src/cli/cmd/run.ts. The donor's existing-session shell-failure UI recovery is unassigned and excluded; payload status is partial.
  • anomalyco/opencode#55007 (460c626acd9e3de8fdffc27bde99bb5f070bb70f), local cherry-pick 379832391b: the native override is wired at packages/core/src/effect/app-node-platform.ts's actual RequestExecutor composition; payload status is complete.
  • anomalyco/opencode#59411 (e2bc79dc0bae112b79ab780f7c1a63db8a7f7dae), local cherry-pick 31ccedc31b: detached POSIX groups are synchronously terminated while cleanup remains owed. packages/tui/src/app.tsx routes terminal SIGHUP through renderer shutdown; packages/tui/src/terminal-signal.ts preserves nohup's ignore without a TTY. The upstream CLI shutdown-deadline module is absent and not imported; payload status is partial, assigned behavior complete.

Bun 1.4.4 and install

The official bun-linux-aarch64.zip SHA-256 baa6bb36f51d6e58561e02bbea825038a9df454f673d6d776e8bbf86f8c7850e matched the committed Nix SRI sha256-uqa7NvUdblhWHgK76oJQOKnfRU9nPW13bou/hvjHhQ4=. The extracted binary reported Bun 1.4.4, revision 1.4.4+38afee6c8. bun install --frozen-lockfile passed with the verified binary and reported no lockfile changes (2,444 installs checked across 2,843 packages).

Core, OpenCode, and TUI package-local bun typecheck each passed in bounded, memory-capped background scopes. OpenCode typecheck was repeated after the test-only server-readiness bound adjustment and passed.

Round-one review coverage

  1. CrossSpawnSpawner sends acknowledged process-group acquisition/release events to the TUI server Worker. Worker shutdown kills and confirms its remaining groups before replying; TuiThreadCommand keeps the recorded PGID ledger for bounded timeout, Worker-error and owner-exit backstops. The focused integration test drives the real packages/opencode/src/cli/tui/worker.ts RPC path for both shutdown acknowledgement and a blocked-shutdown parent backstop.
  2. TUI SDK/SSE and Mini attach tests hold real requests while a default fetch control expires under a child Bun 1.4.4 process configured with BUN_CONFIG_HTTP_IDLE_TIMEOUT=2; they then release the real event or session response. The attached-run acceptance uses the same short child-process timeout and confirms persisted session output.
  3. SIGHUP fixtures now report only observed behavior: the real terminal TUI fixture verifies lifecycle cleanup, the nohup fixture proves ignored-SIGHUP survival, and a non-TTY non-nohup fixture proves the OS default action without asserting graceful cleanup.
  4. The default unit suite no longer waits multiple minutes: held-request witnesses use bounded child Bun processes and short release windows. Before that change, unmodified-default runs had already observed native and attached-run completion after 374.96s and 418.23s respectively.
  5. CHANGESET.md now records the replace-not-merge native request policy, high-level option preservation, acknowledged Worker group ownership, SIGHUP distinctions, and test coverage.

Focused validation (verified Bun 1.4.4)

  • Core native idle witness: 1 pass, 12.18s; CrossSpawnSpawner ownership/scope-release slice: 5 pass, 17.92s.
  • Mini attach witness: 1 pass, 21.13s; attached-run witness: 1 pass, 22.19s.
  • TUI SDK/SSE witness: 1 pass, 15.31s; terminal/nohup/default SIGHUP fixtures: 3 pass, 7.90s.
  • Real TUI Server Worker process-group shutdown/backstop test: 1 pass, 22 assertions.
  • Core, OpenCode, and TUI package typechecks passed in bounded scopes; the normal pre-push Turbo typecheck also passed 30/30 with concurrency limited to one.

Focused preservation and removal proofs

  • Under Bun 1.4.4, the core fetch-helper tests, Mini attach construction, TUI SDK event client, TUI terminal/nohup SIGHUP cases, Core native caller-expiry case, abrupt-owner-exit group cases, and the fix(core): reap shell process groups on cancellation #380 scope-release descendant-reaping case passed.
  • The fix(opencode): bound stalled provider streams and interrupts #303 Foundry stall case passed with the generation-progress timeout restored; the slow-reasoning and Chat Completions/tool-argument progress cases passed. An earlier slow-reasoning run hit the fixture's 2-second progress deadline; the final isolated uninstrumented run passed.
  • Replacing noTimeoutFetch with fetch(request, init) made the Mini and TUI SDK regressions fail at timeoutDisabled (false, expected true). The attached-run regression also failed under a red-only BUN_CONFIG_HTTP_IDLE_TIMEOUT=2 run with the helper removed; its green acceptance used the unmodified default.
  • Removing Layer.provide(withoutBunTimeout) made the native composition regression observe timeout: 1 instead of false. Removing the spawner's exit hook made live and cleanup-owed group cases fail with recorded members still alive. Removing the TUI non-terminal guard made the nohup case fail; removing terminal handler registration made the PTY case fail. Disabling the fix(opencode): bound stalled provider streams and interrupts #303 progress timer made the stalled-Foundry case fail inside its bound. Each behavior was restored and its focused positive case passed.

Round-one changed tests: packages/core/test/effect/app-node-platform.test.ts, packages/core/test/effect/cross-spawn-spawner.test.ts, packages/opencode/test/cli/run/mini-attach.test.ts, packages/opencode/test/cli/run/run-process.test.ts, packages/opencode/test/cli/tui/worker-process-group.test.ts, packages/tui/test/cli/tui/sdk-transport.test.tsx, and packages/tui/test/app-lifecycle.test.tsx. Supporting process fixtures are packages/opencode/test/cli/run/mini-attach-worker.ts, packages/opencode/test/cli/tui/worker-process-group-worker.ts, packages/tui/test/fixture/sighup-ignore-worker.ts, and packages/tui/test/fixture/sighup-terminal-worker.ts.

Handoff

Current pushed head: b05423513beb168f45c29cb11e3aaf5cdc7c631f, on fm/oc-transport-exit-393, based on the no-rebase merge of origin/swxtch through 02013d1c77 (#407). PR #410 remains draft. The commit-identity gate passed on the merged base range. This repository has no bin/fm-lint.sh. Do not merge the PR or mark it ready; Firstmate owns review and final-suite admission.

Sorry, something went wrong.

Uh oh!

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

All reactions
@brentyates-swx
docs: plan transport and lifecycle backport
4b2bd81
Implement the assigned transport and lifecycle behavior in existing fork owners.

- Pick each donor in its own -x commit; omit shell-failure UI and absent CLI/MCP payload.
- Disable Bun’s independent fetch deadline only for long network clients and native provider requests; preserve caller signals, domain deadlines, and the #303 watchdog.
- Track detached POSIX groups only while cleanup is owed, preserving #380 escalation and release of intentional descendants; route terminal SIGHUP through the TUI lifecycle.
- Add real-server and child-process regressions with removal proofs, then record donor coverage and focused checks in CHANGESET.md.
@brentyates-swx

brentyates-swx commented Nov 4, 2026

Copy link
Copy Markdown
Author

Session ID: unknown
Working repo: /home/byates/fm-worktrees/fm-llmrouter/oc-transport-exit-393/swx-opencode

All reactions

Sorry, something went wrong.

Uh oh!

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

Finn763 and others added 14 commits November 4, 2026 17:43
@Finn763 @brentyates-swx
fix(tui): keep long-pending requests past Bun's fetch deadline (anoma…
ca3abb1
…lyco#55149)

Give the TUI client timeout: false, share the no-timeout fetch helper across run, mini and the TUI via @opencode/util/no-timeout-fetch, and surface existing-session shell failures with a toast and composer restore.

Closes anomalyco#54974

Co-authored-by: Finn763 <[email protected]>
(cherry picked from commit 52a10f5)
@rekram1-node @brentyates-swx
fix(core): disable Bun's fetch idle timeout for provider requests (an…
3798323
…omalyco#55007)

(cherry picked from commit 460c626)
@rekram1-node @brentyates-swx
fix(util): kill spawned process groups when opencode exits (anomalyco…
31ccedc
…#59411)

(cherry picked from commit e2bc79d)
@brentyates-swx
fix(core): type Bun fetch timeout overrides
d9132dd
@brentyates-swx
test(opencode): verify mini attach timeout wiring
c8961c1
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
test(core): verify abrupt owner process-group cleanup
b11b17b
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
test(tui): verify SDK long-call fetch policy
f71d026
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
fix(tui): preserve nohup SIGHUP behavior
0f713a0
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
test(core): verify native fetch timeout override
bbf2f2a
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
test(core): prove native requests outlive default idle timeout
d9e031d
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
test(opencode): verify attached runs survive Bun idle timeout
e9a6940
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
docs: record transport and lifecycle backport
37f6283
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
docs: clarify backport regression ownership
4b677f6
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
chore: merge swxtch into transport-exit backport
ea12e95
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5

# Conflicts:
#	CHANGESET.md
@brentyates-swx brentyates-swx mentioned this pull request Nov 4, 2026
fix(ci): skip draft PR workflow work #413
Merged
brentyates-swx added 9 commits November 5, 2026 05:56
@brentyates-swx
chore: merge swxtch into transport-exit backport
130e23b
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
test(opencode): allow Bun 1.4.4 server startup window
aa660aa
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
test: shorten idle-timeout acceptance tests
65b6f3f
Run the native and attached held-response witnesses in bounded Bun 1.4.4 child processes with BUN_CONFIG_HTTP_IDLE_TIMEOUT=2 so they stay out of the multi-minute range.

Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
test(tui): prove SDK long calls survive Bun idle expiry
a43fe7f
Exercise SDKProvider's external SDK and SSE paths with a held event stream, a real timeout control, and a completed event after the injected short idle expiry.

Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
test(opencode): prove mini attach survives Bun idle expiry
e9ba764
Hold the real mini attach session response in a Bun 1.4.4 child process, observe an unmodified control fetch time out first, then release the expected 404 response.

Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
test(tui): make SIGHUP fixture reports truthful
a986c69
Keep the nohup fixture scoped to listener policy and process survival, and add a non-TTY non-nohup default-disposition witness while retaining lifecycle assertions only from the real TUI producer.

Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
fix(tui): clean Worker-owned process groups on exit
27a31d8
Acknowledge Worker group ownership and release events, kill and await remaining groups before the shutdown reply, and use the recorded PGID ledger as the bounded TUI-owner backstop when shutdown is unconfirmed.

Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
docs: finalize transport exit review coverage
b054235
Record the acknowledged TUI Worker group lifecycle, truthful SIGHUP behavior, and short Bun 1.4.4 behavioral witnesses in the backport ledger.

Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
@brentyates-swx
fix(tui): centralize Worker process-group ownership
e5ce507
This was referenced Nov 5, 2026
Pre-push hook runs a full root typecheck on the pushing machine, which conflicts with the no-heavy-builds workstation ruling #415
Open
Non-renderer CLI commands (run, serve) still die by default SIGHUP/SIGTERM, so detached process groups are orphaned #417
Open
brentyates-swx added 2 commits November 5, 2026 22:34
@brentyates-swx
docs: plan transport exit review fixes
bcb666c
1. Make worker and parent ownership ledgers converge on each local acquire, release, and cleanup decision even when acknowledgement is rejected or delayed; validate recorded identities before parent-side signalling.
2. Add rejected/delayed acknowledgement regressions for acquire, release, cleanup announcement, and release/reacquire identity fallback.
3. Harden fixture cleanup and deadlines; add Linux-only guards; correct CHANGESET ownership and SIGHUP claims; remove only test hooks no longer needed.
4. Verify focused changed cases and then each importing test file once under checksum-verified Bun 1.4.4; commit without pushing.
@brentyates-swx
fix(core): reconcile process-group acknowledgement failures
a7981a2
Reconcile Worker and parent ownership ledgers on local acquire, release, and cleanup facts, independent of rejected or delayed acknowledgements. Validate recorded member identities before signalling and preserve released member identities across reacquisition.

Bound identity-owned process fixture cleanup, gate procfs child fixtures to Linux, retain portable SDK cancellation coverage, and correct the #410 SIGHUP and ownership ledger.

Claude-Session: unknown
brentyates-swx added 10 commits November 6, 2026 01:06
@brentyates-swx
chore: merge swxtch SQLite contention fix (#411)
3bdb9a7
Claude-Session: unknown
@brentyates-swx
test(opencode): gate shell output on spawn readiness
ca555e4
Wait for the process spawn acknowledgement before the ShellTool first-output deadline and reap the child on readiness failure. Tighten process-group fixture types for package typecheck.

Claude-Session: unknown
@brentyates-swx
fix(core): restore cross-platform process group cleanup
754d26a
Claude-Session: unavailable (OpenCode session)
@brentyates-swx
fix(core): unify process-group ownership decisions
0228cd3
Claude-Session: unavailable (OpenCode session)
@brentyates-swx
fix(core): publish process-group ownership updates
e371712
Claude-Session: unavailable (OpenCode session)
@brentyates-swx
test(opencode): cover cancellation-overlap ownership
ecdfc1e
Claude-Session: unavailable (OpenCode session)
@brentyates-swx
test(core): wait for process-group cleanup
0e57e99
Claude-Session: unavailable (OpenCode session)
@brentyates-swx
test(opencode): harden process-group test results
fb36454
Claude-Session: unavailable (OpenCode session)
@brentyates-swx
test(opencode): validate cancellation result shape
f6f13bc
Claude-Session: unavailable (OpenCode session)
@brentyates-swx
test(opencode): type fixture results as unknown
62b48bf
Claude-Session: unavailable (OpenCode session)
@brentyates-swx
brentyates-swx marked this pull request as ready for review November 6, 2026 18:00
@brentyates-swx
brentyates-swx merged commit 5d878c1 into swxtch Nov 6, 2026
5 of 7 checks passed

Uh oh!

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

@brentyates-swx
brentyates-swx deleted the fm/oc-transport-exit-393 branch November 6, 2026 18:11
brentyates-swx added a commit that referenced this pull request Nov 6, 2026
@brentyates-swx
chore: merge swxtch after #410
fcf1b32
@brentyates-swx brentyates-swx mentioned this pull request Nov 6, 2026
chore(opencode): sync upstream through the V2 promotion parent #424
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Backport upstream long-call fetch-timeout override and hard-exit process-group cleanup

Uh oh!

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

3 participants

@brentyates-swx @Finn763 @rekram1-node
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 01402792 — 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.