Skip to content

test(cli): reproduce updater executable orphaning - #39482

Open
opencode-agent[bot] wants to merge 1 commit into
v2from
orphan-update-repro
Open

test(cli): reproduce updater executable orphaning#39482
opencode-agent[bot] wants to merge 1 commit into
v2from
orphan-update-repro

Conversation

@opencode-agent

Copy link
Copy Markdown
Contributor

Summary

Adds a deterministic subprocess regression reproducer for the executable-lifetime precondition behind #32002 and #32464.

The test installs a native executable through the same global Bun package-manager layout used by OpenCode, leaves it running, replaces the installed package, and verifies that:

  • the original process remains alive
  • its mapped executable changes from a named package path to the same path marked (deleted)

Current V2 calls global npm/pnpm/Bun/Yarn installation from its long-running background service updater every ten minutes, so this is the same inode-orphaning operation performed while OpenCode remains active.

On macOS 26, independent controlled reproductions correlate this orphaned mapping with repeated vn_getpath failed events and one unreclaimed 1 KiB data.kalloc.1024 allocation per failure. The exact OpenCode upgrade-under-load reproducer is https://gist.github.com/markjaquith/b6915a8f1b35939af04c166cd01b3b41.

Local proof

before: .../node_modules/opencode-updater-orphan-fixture/bin/opencode-updater-orphan-fixture
after:  .../node_modules/opencode-updater-orphan-fixture/bin/opencode-updater-orphan-fixture (deleted)
process: still running

Checks

  • bun test test/updater-orphan.test.ts
  • bun typecheck

Requested by: @kommander (Sebastian via Slack)

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