Skip to content

test(launcher): assert the scoped env and versioned bundled runtime in source oracles - #7365

Merged
lidge-jun merged 1 commit into
devfrom
fix/launcher-source-oracle-cache-scope
Oct 19, 2026
Merged

lidge-jun merged 1 commit into
devfrom
fix/launcher-source-oracle-cache-scope

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Summary

#7362 changed two lines in bin/ocx.mjs that source-invariant oracles pin literally, so dev fails test 4/4 (PR run 39218333499, job 117947637695):

  • ocx.mjs package launcher (source invariants) > the Bun child receives the runtime provenance the launcher actually selected (#848) expected return { path: bin, source: "bundled" };
  • … > the inspection child does not inherit a duplicate copy of the snapshotted values expected ...inheritedEnv,

Both oracles now assert the new lines without dropping either guarantee:

I missed these because test:changed follows imports and these oracles read bin/ocx.mjs as text. This PR changes only the test file.

Verification

Against dev 7dfc141 (includes #7362 and #7364):

  • Every test file that reads or spawns bin/ocx.mjs, plus the runtime, startup-action, startup-health, cache-scope and lab-boundary suites (26 files): 598 pass, 0 fail.
  • CI-workflow suites that reference these sources (ci-workflows, ci-scope-reduction, ci-review-lanes, linux-desktop-packaged-ci): 172 pass, 0 fail.
  • bun x tsc --noEmit passes.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (Test-only.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Tests
    • Updated launcher tests to verify that runtime resolution includes its version and that the inherited environment uses the selected runtime’s cache.

…n source oracles

#7362 changed the bundled-runtime return and the spawn env line that two
source-invariant oracles pinned literally (dev test 4/4, run 39218333499).
Assert the new lines; the scoped inheritedEnv must sit inside the spawn call.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 19, 2026 08:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T08:13:47.733155Z 16d2b0a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: efcc791b-57d2-4a1d-87cb-cb5024ef9479
📥 Commits

Reviewing files that changed from the base of the PR and between 7dfc141 and 16d2b0a.

📒 Files selected for processing: 1
  • tests/cli/ocx-launcher-source.test.ts
+-----------------------+
| Hasta la vista, bugs. |
+-----------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Oct 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 16d2b0ae7f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

expect(source).toContain("const bunRuntime = resolveBun({ allowInstall: !codexCliUpdateInspection });");
expect(source).toContain("const bun = bunRuntime.path;");
expect(source).toContain('return { path: bin, source: "bundled" };');
expect(source).toContain('return { path: bin, source: "bundled", version: bundledBunVersion(bunDir) };');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Cover the post-install bundled return

When the bundled binary is initially unusable but install.js repairs it, resolveBun takes the second bundled return at bin/ocx.mjs:1061. This toContain is already satisfied by the fast-path return at line 1052, so the post-install branch could again omit version, pass this oracle, and send undefined to scopeTranspilerCacheToRuntime; assert both occurrences or scope an assertion to each branch.

Useful? React with 👍 / 👎.

@lidge-jun
lidge-jun merged commit 52c326b into dev Oct 19, 2026
27 of 28 checks passed
@lidge-jun
lidge-jun deleted the fix/launcher-source-oracle-cache-scope branch October 19, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant