This repository was archived by the owner on Nov 7, 2026. It is now read-only.
Repository navigation
fix(core): backport transport and process-exit cleanup - #410
Merged
Merged
Conversation
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.
Author
|
Session ID: unknown |
…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)
…omalyco#55007) (cherry picked from commit 460c626)
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5 # Conflicts: # CHANGESET.md
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
Claude-Session: c368ed23-1e31-4f2c-b305-b84f21d79cc5
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
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
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
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
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
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
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.
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
Claude-Session: unknown
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
Claude-Session: unavailable (OpenCode session)
Claude-Session: unavailable (OpenCode session)
Claude-Session: unavailable (OpenCode session)
Claude-Session: unavailable (OpenCode session)
Claude-Session: unavailable (OpenCode session)
Claude-Session: unavailable (OpenCode session)
Claude-Session: unavailable (OpenCode session)
Claude-Session: unavailable (OpenCode session)
brentyates-swx
marked this pull request as ready for review
November 6, 2026 18:00
brentyates-swx
added a commit
that referenced
this pull request
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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-pickca3abb1290: the assigned TUI/run/mini fetch override is complete throughpackages/core/src/no-timeout-fetch.ts,packages/tui/src/context/sdk.tsx, andpackages/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-pick379832391b: the native override is wired atpackages/core/src/effect/app-node-platform.ts's actualRequestExecutorcomposition; payload status is complete.anomalyco/opencode#59411(e2bc79dc0bae112b79ab780f7c1a63db8a7f7dae), local cherry-pick31ccedc31b: detached POSIX groups are synchronously terminated while cleanup remains owed.packages/tui/src/app.tsxroutes terminal SIGHUP through renderer shutdown;packages/tui/src/terminal-signal.tspreserves 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.zipSHA-256baa6bb36f51d6e58561e02bbea825038a9df454f673d6d776e8bbf86f8c7850ematched the committed Nix SRIsha256-uqa7NvUdblhWHgK76oJQOKnfRU9nPW13bou/hvjHhQ4=. The extracted binary reported Bun1.4.4, revision1.4.4+38afee6c8.bun install --frozen-lockfilepassed with the verified binary and reported no lockfile changes (2,444 installs checked across 2,843 packages).Core, OpenCode, and TUI package-local
bun typecheckeach 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
CrossSpawnSpawnersends acknowledged process-group acquisition/release events to the TUI server Worker. Worker shutdown kills and confirms its remaining groups before replying;TuiThreadCommandkeeps the recorded PGID ledger for bounded timeout, Worker-error and owner-exit backstops. The focused integration test drives the realpackages/opencode/src/cli/tui/worker.tsRPC path for both shutdown acknowledgement and a blocked-shutdown parent backstop.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.CHANGESET.mdnow 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)
Focused preservation and removal proofs
noTimeoutFetchwithfetch(request, init)made the Mini and TUI SDK regressions fail attimeoutDisabled(false, expectedtrue). The attached-run regression also failed under a red-onlyBUN_CONFIG_HTTP_IDLE_TIMEOUT=2run with the helper removed; its green acceptance used the unmodified default.Layer.provide(withoutBunTimeout)made the native composition regression observetimeout: 1instead offalse. 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, andpackages/tui/test/app-lifecycle.test.tsx. Supporting process fixtures arepackages/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, andpackages/tui/test/fixture/sighup-terminal-worker.ts.Handoff
Current pushed head:
b05423513beb168f45c29cb11e3aaf5cdc7c631f, onfm/oc-transport-exit-393, based on the no-rebase merge oforigin/swxtchthrough02013d1c77(#407). PR #410 remains draft. The commit-identity gate passed on the merged base range. This repository has nobin/fm-lint.sh. Do not merge the PR or mark it ready; Firstmate owns review and final-suite admission.