fix: release host terminals after usage scans - #32
Open
MayankBansal12 wants to merge 9 commits into
Open
Conversation
Owner
Author
|
Follow-up validation: bb only exposes terminal output while a session is running, so reading after natural exit caused HTTP 409 failures across all collectors. The branch now uses a bounded handshake: capture output while running, send a release line, then wait for natural exit. The shell fallback is capped at 30 seconds—there is no infinite hold. Live-tested with an isolated copy of the actual plugin restricted to the current machine. Codex, Claude, fx, Grok, Pi, Prime, Antigravity, OpenCode, and OpenCode Go all completed without terminal-output 409s. The temporary test plugin was removed afterward. |
…ontract Migrate to @get-bb/plugin-sdk 0.4.47 (BB >= 0.42), dropping the vendored type stubs. Add a bb.host entry (host.ts, host-contract.ts) that executes usage scans in a non-PTY host worker instead of long-lived terminals: short polling calls, cancellation and timeouts kill the command process group, and scans run with a concurrency limit of three per machine. Also add unit/integration tests for the host worker, a CI matrix over ubuntu/macos, and bump the version to 0.3.7.
…code-go test macOS keeps cat and rm in /bin, so the nodeOnly symlinks dangled and the fake curl saw an empty auth header (exit 9). Resolve cat, mktemp, and rm via command -v at test setup.
Supersedes the earlier host-worker commits on this branch: migrates to @get-bb/plugin-sdk 0.4.47 (BB >= 0.42), runs usage scans in non-PTY host workers with short polling calls and a three-scan-per-machine concurrency cap, adds host/usage integration tests, an ubuntu/macos CI matrix, and the tool-path fix for macOS.
… >= 0.36) Revert the 9bc08bd..97cf306 SDK/host-worker work so the PR stays compatible with BB >= 0.36; the plugin-sdk 0.4.47 migration ships separately. Removed: host.ts, host-contract.ts, host.test.ts, host.integration.test.ts, usage.integration.test.ts, the @get-bb/plugin-sdk devDependency and all experimental_* host APIs; server.ts/server.test.ts back to the terminal-based runHostCommand with vendored sdk stubs and paths restored; engines back to bb >= 0.36; package deps split and import specifiers restored; README back to "Requires BB 0.36 or newer". Kept: the macOS tool-path resolution fix in lib/opencode-go.test.ts (command -v for cat/mktemp/rm) and the ubuntu/macos CI matrix, with the build tool pinned back to bb-app@0.39.0.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
On bb 0.40.0 for macOS, repeated forced closes can leak PTY resources. The prior keep-alive loop and nine parallel scans accelerated that leak until bb could no longer open terminals.
Fixes #28