Skip to content

test: assert the real OPENCODE_CONFIG_CONTENT injection + merge (close boot_smoke false-green) - #55

Merged
jack-champagne merged 2 commits into
mainfrom
rchari/25-boot-smoke-config-injection
Jul 2, 2026
Merged

test: assert the real OPENCODE_CONFIG_CONTENT injection + merge (close boot_smoke false-green)#55
jack-champagne merged 2 commits into
mainfrom
rchari/25-boot-smoke-config-injection

Conversation

@Rchari1

@Rchari1 Rchari1 commented Jul 1, 2026

Copy link
Copy Markdown
Member

Closes #25.

boot_smoke.mjs is the only server-booting test and it boots without OPENCODE_CONFIG_CONTENT, so it stayed green even if the instructions/permission injection were removed entirely — a false-green surfaced in #12 review.

Where the fix lives

The real fix must use the real buildOpencodeConfigContent (a transcribed copy would just drift — the thing #25 warns about). A .mjs boot script can't import the TS builder, so the assertion belongs in opencode_config.test.ts, which already runs the real binary via opencode debug config (resolves the merged config ≈ GET /config) with the real builder.

Change

  • test/opencode_config.test.ts — hardened the real-binary merge test to a full injection+merge assertion. It now writes a user global config with a distinctive model + permission key and asserts:
  • test/boot_smoke.mjs — documented its scope: binary /event liveness only; the injection + merge coverage lives in opencode_config.test.ts.

Validation

  • Full suite green (80 pass); test:smoke PASS.
  • Genuine catcher: temporarily dropping instructions from the builder reds this test at the instructions assertion (and the unit test) — proving it now catches the regression the false-green allowed.

🤖 Generated with Claude Code

Rchari1 and others added 2 commits July 1, 2026 12:22
…(close boot_smoke false-green)

boot_smoke.mjs is the only server-booting test and boots WITHOUT
OPENCODE_CONFIG_CONTENT, so it stayed green even if the instructions/permission
injection were removed entirely (false-green surfaced in #12 review).

The real fix belongs where the REAL buildOpencodeConfigContent can be imported
(a .mjs can't import the TS builder without re-deriving it → drift). So harden the
existing real-binary test in opencode_config.test.ts: it already runs
`opencode debug config` (resolves the merged config, ≈ GET /config) with the real
builder; now it also
  - writes a user global config with a distinctive `model` + `permission` key,
  - asserts the injected `instructions` (AGENTS.md path) is present — the exact
    regression the false-green missed,
  - asserts the global `model` survives the deep-merge (Q129 provider selection),
  - keeps the #22 permission deep-merge assertions (user key survives + ours added).

Verified it's a real catcher: dropping `instructions` from the builder reds this
test (and the unit test) at the `instructions` assertion.

boot_smoke.mjs: documented its scope (binary /event liveness only; the injection
+ merge coverage lives in opencode_config.test.ts) so the split is explicit.

80 extension tests green; test:smoke PASS. Closes #25.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… (not skips)

The opencode config injection+merge integration test is skipIf(!OC_BIN), and the
fast job never fetched the vendored binary before vitest — so it self-skipped in
CI. That was the false-green ONE level up: even with the test added, a real
injection/merge regression would pass CI because the test didn't run. Fetch
opencode before `pnpm -r run test` so it executes and gates.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@jack-champagne jack-champagne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed — right fix, and cleaner than re-deriving the config in the .mjs. Closes the false-green at both levels: (1) the injection assertion (instructions land + permission merge) now exists in opencode_config.test.ts against the real buildOpencodeConfigContent (no drift), and (2) CI fetches opencode before the suite so the OC_BIN-gated integration test actually runs instead of self-skipping — the deeper false-green. Folds in the #22 permission-merge check and adds global-model preservation (Q129). debug-config vs live GET /config is a fine call (same resolution path). Verified green.

@jack-champagne
jack-champagne merged commit 60549c4 into main Jul 2, 2026
4 checks passed
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.

3 participants