Skip to content

test(claude-store): use a Bun stand-in client in the attach-behind-options test, since macOS 27 hides /bin/sh's environment (test-only) - #2105

Merged
devswha merged 1 commit into
mainfrom
test/claude-store-macos-attach
Oct 28, 2026
Merged

devswha merged 1 commit into
mainfrom
test/claude-store-macos-attach

Conversation

@devswha

@devswha devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner

Change

Test-only. On macOS 27, server/claude-store.test.ts "reads attach behind options only from a client whose environment is no background session's" fails on main. Its client was /bin/sh -c 'echo ready; read line', and macOS 27 withholds a platform binary's environment from KERN_PROCARGS2. ps -E shows no environment for a /bin/sh child, but does show one for a bun child. So the client read as "environment unreadable", and claudeAttachSession answered { session: null } where the test expects null.

The client is now a Bun process (process.execPath -e "process.stdin.resume(); console.log('ready')"). This matches the file's other environment tests (the KEEP_ALIVE stand-in) and the hermes.contract.test.ts one. What the test asserts is unchanged, and product code is unchanged. macOS 15 (the CI job "Native macOS session identity") still shows /bin/sh's environment, which is why CI never saw this.

Fixes #1971.

Verification

  • eamac (macOS 27.0.1, Bun 1.4.3), fresh clone of origin/main 0d439606 in /tmp, bun test server/claude-store.test.ts -t 'reads .attach. behind options only':
    • main: 3 of 3 fail with Received: { session: null }
    • this change applied: 3 of 3 pass; the whole file gives 80 pass, 1 skip, 0 fail
  • Linux (P620): the test passes 3 of 3; the whole file gives 79 pass, 2 skip, 0 fail; bun run check fast is green (unit 7774 pass, 0 fail).
    Two earlier check fast runs failed only in scripts/ci-browser.test.ts (its stub's 5 s kill timeout) while the host was at load 100 to 144. That file is untouched here and passed on its own.
  • Reviews (adversarial, read-only, on the same diff): omo-native-code-reviewer PASS, with two LOW notes and no action needed (the duplicated keep-alive string; an older cleanup edge if a spawn throws). Codex Sol 6.1 Fast xhigh PASS, with no actionable findings.

No changelog fragment: test-only.

…tions test, since macOS 27 hides /bin/sh's environment (test-only)

On macOS 27 the kernel withholds a platform binary's environment from
KERN_PROCARGS2 (`ps -E` shows none for a /bin/sh child but shows one for a
bun child). The test's /bin/sh client therefore read as "environment
unreadable", and `claudeAttachSession` answered `{ session: null }` where
the test expects `null`. The client is now a Bun process, as the file's
other environment tests already use. Product code is unchanged.

Fixes #1971.
@coderabbitai

coderabbitai Bot commented Oct 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 0d43960 and d42f788.

Files selected for processing: 1
  • server/claude-store.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devswha devswha changed the title "test(claude-store): use a Bun stand-in client in the attach-behind-options test, since macOS 27 hides /bin/shs environment (test-only)" test(claude-store): use a Bun stand-in client in the attach-behind-options test, since macOS 27 hides /bin/sh's environment (test-only) Oct 28, 2026
@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

CI is done on d42f788: everything is green. The one red check is a stale Pull request title run (00:24:01Z). It ran on the PR's first title, where the shell had dropped the apostrophe in /bin/sh's. I fixed the title, and the rerun on it (00:24:22Z) passed. A rerun of the red one would reuse that first event's title, so it can be ignored. CodeRabbit was rate-limited and did not review this head; this is a test-only PR.

@devswha

devswha commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

Merging d42f788 (test-only: a Bun stand-in client in the attach-behind-options test). omo-native-code-reviewer passes it: five mutations of the production code it covers each make the test fail. The required checks are green; Fast checks passed on a rerun after its job was cancelled. CodeRabbit did not review this head. Not run on macOS 27 here.

@devswha
devswha merged commit 29c152c into main Oct 28, 2026
27 of 29 checks passed
@devswha
devswha deleted the test/claude-store-macos-attach branch October 28, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(claude-store): the #1645 attach-behind-options test fails on macOS

1 participant