Skip to content

fix(opencode): override inherited disabled flags - #3469

Merged
morluto merged 1 commit into
morluto:mainfrom
CmsChase:fix/opencode-v2-registration-activation
Oct 22, 2026
Merged

morluto merged 1 commit into
morluto:mainfrom
CmsChase:fix/opencode-v2-registration-activation

Conversation

@CmsChase

@CmsChase CmsChase commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

fix(opencode): override inherited disabled flags

Summary

Fixes #3318. Explicitly activate OpenCode V2 registrations created by approved setup so an inherited disabled flag cannot keep setup and doctor stale.

Problem and expected behavior

When a lower-priority configuration contains disabled: true, the generated upper registration previously omitted that field. Recursive merging retained the disabled state: setup wrote the registration but exited 1 with needs_human/stale; repeating setup planned zero actions and still failed. Explicit setup should activate the selected integration.

Change and scope

Set disabled: false in the native V2 entry producer. Preserve the existing merge and diagnostic rules, lower configuration bytes, backups and other client dialects. Automatic maintenance continues to exclude disabled registrations; a regression covers that boundary.

Contract and boundary impact

  • Semantic owner and earliest changed stage: clientRegistrationEntry, native OpenCode V2 registration construction.
  • Contribution scope fit and linked maintainer decision: ordinary fix within existing approved setup boundaries; advance scope decision not applicable.
  • CLI and MCP/tool-catalog contract: setup and doctor can reach readiness after explicit setup; no command, schema or catalog changes.
  • Provider, bridge, target-format, or platform compatibility: no provider/bridge changes; Windows x64 REA CLI exercised.
  • Evidence, artifact, provenance, or reconstruction contract: no analysis-evidence changes; configuration bytes and exact backups are covered.
  • Target selection, authority, upstream behavior, and cleanup details: existing setup approval governs upper configuration writes. Lower settings remain untouched; disabled clients remain excluded from automatic maintenance. No new target interaction or cleanup behavior.
  • Generated metadata, package, or installation impact: no metadata, dependencies or package-layout changes. The existing setup registration gains an explicit activation field.

Expected effects of the registration workflow:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

The configuration effect is the existing approved upper registration write.

Evidence and regression coverage

  • Five real CLI cases cover JSON/JSONC, inherited disabled/enabled controls, idempotence, doctor readiness, exact backups, preserved lower settings and unrelated entries, retained JSONC comments, and malformed-lower-configuration refusal.

  • On unchanged production source at a32b4b6ac54a02a8fe9a7cb62861e54473ba5eb0, the two inherited-disabled cases fail and the other three pass. With the fix, all five pass.

  • An additional automatic-maintenance control verifies that an inherited disabled V2 registration is not selected and neither configuration layer changes. Two native V2 registration expectations are updated.

  • Independent CLI replay made 12 calls: first setup, repeated setup and doctor for disabled/enabled fixtures on both versions. Disabled-fixture exits changed from 1/1/1 to 0/0/0; enabled controls remained 0/0/0. Setup readiness changed from needs_human/stale to ready/aligned; repeated setup still plans zero actions.

  • Remaining proof gaps: no installed OpenCode client, live provider, POSIX host, full suite/CI or successful complete package verification was exercised.

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

Windows x64, Node 24.18.0, npm 11.16.0, locked dependencies:

  • npm run test:focused -- tests/acceptance/setup/opencodeV2ClientSetup.test.ts — baseline 2 failed / 3 passed; fixed 5 passed.
  • npm exec --no -- vitest run --project process-global tests/process-global/updateMaintenance.test.ts -t "maintenance activation and layered configuration" — 4 passed; 23 unrelated tests unselected.
  • npm run test:focused -- tests/boundary/filesystem/clientConfigurationDialects.test.ts tests/boundary/filesystem/clientConfigurationLayeredEnvironment.test.ts tests/boundary/filesystem/clientConfigurationEnvironment.test.ts tests/boundary/filesystem/clientRegistrationStatus.test.ts — baseline and fixed each 55 passed / 21 failed. All 21 failure names, primary errors and normalized assertion signatures match. Failures concern unchanged POSIX launcher expectations and host path spelling; the layered-environment 8/8 and environment 22/22 cases pass.
  • npm run check — passed: typecheck, formatting, lint, knip, metadata, module boundaries and architecture guards. Lint reports 0 errors / 1381 warnings; changed-file warning categories are unchanged from baseline.
  • npm run verify:test-discovery — 1274 test files discovered exactly once.
  • npm pack --dry-run --json — passed, 1648 entries.
  • npm run verify:package — baseline and fixed fail at the repository-skill stage with Windows spawn npm ENOENT, before package installation.
  • npm run verify:package:windows — baseline and fixed fail with Windows package omitted native/windows/build/manifest.json. The source checkout lacks the official native artifacts, which require the documented Linux/MinGW preparation path.
  • git diff --check and the normal staged formatting/lint commit hook — passed. The committed diff is byte-identical to the reviewed and validated diff.

Compatibility, safety, and release

  • Breaking changes or migration steps: none intended. Explicit setup activates the selected V2 integration; automatic maintenance retains its activation gate.
  • Real Hopper/Ghidra, browser, or OS coverage: Windows REA CLI with isolated configuration roots; no installed client, live provider or POSIX coverage claimed.
  • Package or release metadata impact: unchanged. Complete package verification remains unavailable for the errors above; pack dry-run does not establish installed-package correctness.
  • Security, privacy, process, or containment review: writes remain within approved setup. Malformed lower settings still block writes; lower bytes, unrelated settings and backups remain preserved. No new execution, network or target mutation capability.

Author readiness

Human owner: @CmsChase

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

Set disabled to false in generated OpenCode V2 registrations so a
lower-priority disabled entry cannot keep approved setup stale.

Cover layered JSON/JSONC refreshes, idempotent setup and doctor readiness,
exact backups, preserved lower settings, malformed-config refusal, and
the exclusion of disabled registrations from automatic maintenance.
Update the native V2 registration expectations.

Fixes morluto#3318
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; approved setup enables the selected registration while automatic maintenance still excludes disabled clients.

Summary

OpenCode V2 registrations now include disabled: false, so approved setup overrides an inherited disabled flag.

  • OpenCode V2 setup now clears inherited disabled flags.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Approved setup] --> B[Write upper registration with disabled false]
  B --> C[Merge lower and upper settings]
  C --> D[Effective registration enabled]
  E[Automatic maintenance] --> F{Merged registration enabled?}
  F -->|No| G[Skip registration]
  F -->|Yes| H[Plan maintenance setup]
Loading

Reviews (1) · Last reviewed commit: "fix(opencode): override inherited disabl..." · Reviewed by Greptile

@CassieFox23

Copy link
Copy Markdown
Contributor

TL;DR: Two OpenCode V2 setup tests fail on main and pass with this PR. The PR now writes disabled: false into the V2 entry. I skipped the end-to-end setup test file, so that part is not checked.

Thanks, Haoran Xu, for the fix. I ran two of the three test files on main 62bf098 (#4169). First with only the PR's test changes, then with the source change too.

Step Node 24.18.0
Test changes only, on main 2 failed, 50 passed
Plus source change 52 passed

Both failures are in the "OpenCode V2 native server table" group of clientConfigurationDialects.test.ts. Each expects disabled: false and finds no such field on main.

The new case in updateMaintenance.test.ts passed both times. It checks one thing. Maintenance must skip a lower entry that is disabled. It is not a bug test. That file points the home folder at a temporary folder.

Not run

  • tests/acceptance/setup/opencodeV2ClientSetup.test.ts. It runs the doctor command and sits in a folder I do not run. It holds the end-to-end, repeat and layered-config cases. I did not check those.
  • Real GitHub CI did run on this PR and was green. I did not rerun it. The check named "Validate author declaration" reads the PR template only. Its latest run succeeded. An older run failed.
  • A real OpenCode install.
  • Only Node 24.18.0. Not Node 22 or 26.
Commands
# main 62bf09809 extracted to a work tree, then npm ci, npm run build, npm run test:prepare
# the two non-doctor test diffs split out of 3469.tests.diff
patch -p1 -d <tree> < clientConfigurationDialects.test.diff
patch -p1 -d <tree> < updateMaintenance.test.diff
npm run test:focused -- tests/boundary/filesystem/clientConfigurationDialects.test.ts tests/process-global/updateMaintenance.test.ts   # exit 1
patch -p1 -d <tree> < 3469.src.diff
npm run test:focused -- tests/boundary/filesystem/clientConfigurationDialects.test.ts tests/process-global/updateMaintenance.test.ts   # exit 0
Test setup
  • Box: Nobara 44 (Fedora 44 base), Linux 7.2.9
  • CPU: AMD Ryzen 9 5900X, 12 cores / 24 threads
  • RAM: 32 GB DDR4-3600
  • Node: 24.18.0
  • Head / base: bcfdedd (PR head) / 62bf098 (main)
  • Other: the box was shared with three other test agents.

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

CmsChase commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

@morluto I investigated the failed CI rerun for #3469.

The failing run checked out 185bb648 (base cbc0e97c plus the approved PR patch). The affected clientProfileLifecycle.test.ts case passed in 28.373s during attempt 1 but exceeded the 30s test deadline in attempt 2.

On Windows x64 / Node 24.18.0, I reproduced the timeout on both the unmodified upstream base and the same base with Round 6 applied, under the original deadlines. The test executes 16 sequential CLI commands, exhausting its aggregate test budget. The Round 6 V2 producer change is not exercised by this particular fixture, which uses the OpenCode V1 configuration.

Main already includes 85788452 (test(cli): batch redundant client lifecycle dry runs), reducing the sequential commands from 16 to 11. Applying only that upstream test correction to the original base makes the affected case pass with and without Round 6. The same case also passes on the newer main tested locally.

The OpenCode V2 public regression tests still pass 5/5 with the approved fix. No production or timeout changes are needed based on this investigation.

The original hosted runner's exact waiting point remains unknown, and the required CI is still red. Successful CI validation against an integration tree containing the existing upstream test correction is still needed.

Thanks for reviewing.

Copy link
Copy Markdown
Contributor Author

@morluto Quick follow-up: the third CI attempt has now completed successfully at the unchanged PR head, including all five test shards, Portable tests, and the required CI check.

The earlier lifecycle timeout did not recur, and no additional source changes were needed.

Thanks for rerunning the checks!

@morluto
morluto merged commit c592ea6 into morluto:main Oct 22, 2026
96 of 104 checks passed
@morluto morluto added area: cli CLI adapter and one-shot commands bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli CLI adapter and one-shot commands bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] OpenCode V2 registration stays disabled after setup refresh

3 participants