Skip to content

feat(doctor): re-apply doctor-config-flow upstream improvements (#2204)#2256

Merged
alexey-pelykh merged 1 commit intomainfrom
feat/re-apply-doctor-config-flow-2204
Apr 10, 2026
Merged

feat(doctor): re-apply doctor-config-flow upstream improvements (#2204)#2256
alexey-pelykh merged 1 commit intomainfrom
feat/re-apply-doctor-config-flow-2204

Conversation

@alexey-pelykh
Copy link
Copy Markdown

Summary

Re-apply ~400 LoC of upstream diagnostic and repair features to doctor-config-flow.ts that were lost during PR #2191 wholesale restoration from pre-v2026.3.1. Builds on top of PR #2254 which already re-applied maybeRepairAllowlistPolicyAllowFrom, detectEmptyAllowlistPolicy, and hasAllowFromEntries.

6 feature groups re-applied:

  1. noteOpencodeProviderOverrides — Replace no-op stub with real implementation that detects when OpenCode Zen provider overrides mask built-in routing/costs
  2. collectMissingDefaultAccountBindingWarnings — New exported diagnostic function + normalizeBindingChannelKey helper. Warns when channels have accounts configured but no default account and no binding coverage
  3. Exec safe-bin profile scaffolding — 3 type aliases + 6 functions: normalizeConfiguredSafeBins, normalizeConfiguredTrustedSafeBinDirs, collectExecSafeBinScopes, scanExecSafeBinCoverage, scanExecSafeBinTrustedDirHints, maybeRepairExecSafeBinProfiles. Imports from existing gutted stub modules (exec-command-resolution, exec-safe-bin-runtime-policy, exec-safe-bin-trust)
  4. "Legacy" → "Compatibility" terminology — 3 string/comment renames in loadAndMaybeMigrateDoctorConfig
  5. formatConfigIssueLines usage — Replace 2 inline .map() formatting calls with shared formatConfigIssueLines() from config/issue-format.js
  6. Supporting importsisRecord from utils, formatConfigIssueLines from config/issue-format, 6 exec-safe-bin functions from 3 infra modules

Call sites added to loadAndMaybeMigrateDoctorConfig:

  • collectMissingDefaultAccountBindingWarnings(candidate) — after autoEnable, before repair/scan branch
  • maybeRepairExecSafeBinProfiles(candidate) — in repair branch, after toolsBySenderRepair
  • scanExecSafeBinCoverage(candidate) + scanExecSafeBinTrustedDirHints(candidate) — in scan/else branch, after toolsBySenderHits

Closes #2204

Test plan

  • All 19 tests across 3 doctor-config-flow test files pass
  • Type-check passes (zero errors in modified file)
  • Lint passes (zero warnings/errors)
  • Format check passes
  • Pre-commit hook passes (full pnpm check)
  • Unit test suite: 5948 passed (1 pre-existing A2UI bundle failure unrelated)

🤖 Generated with Claude Code

…v2026.3.1/v2026.3.2 (#2204)

Re-apply ~400 LoC of upstream diagnostic and repair features lost during
PR #2191 wholesale restoration. All dependency modules exist in the fork.

Feature groups re-applied:
1. noteOpencodeProviderOverrides — replace no-op stub with real
   implementation detecting OpenCode Zen provider overrides
2. collectMissingDefaultAccountBindingWarnings — new channel-layer
   diagnostic warning when accounts lack default/binding coverage
3. Exec safe-bin profile scaffolding — 3 types + 6 functions
   (normalizeConfiguredSafeBins, collectExecSafeBinScopes,
   scanExecSafeBinCoverage, scanExecSafeBinTrustedDirHints,
   maybeRepairExecSafeBinProfiles, normalizeConfiguredTrustedSafeBinDirs)
4. "Legacy" to "Compatibility" terminology rename (3 occurrences)
5. formatConfigIssueLines usage from dedicated issue-format module
6. Supporting imports (isRecord, formatConfigIssueLines, exec-safe-bin
   modules)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@alexey-pelykh alexey-pelykh enabled auto-merge (squash) April 10, 2026 22:48
@alexey-pelykh alexey-pelykh merged commit 5a65124 into main Apr 10, 2026
10 checks passed
@alexey-pelykh alexey-pelykh deleted the feat/re-apply-doctor-config-flow-2204 branch April 10, 2026 22:54
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.

Re-apply doctor-config-flow upstream improvements (~620 LoC, v2026.3.1/v2026.3.2)

1 participant