Skip to content

fix(doctor): surface multi-account default routing warnings in preview and lint#96147

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
Pick-cat:fix/doctor-preview-default-account-warnings
Jul 7, 2026
Merged

fix(doctor): surface multi-account default routing warnings in preview and lint#96147
vincentkoc merged 1 commit into
openclaw:mainfrom
Pick-cat:fix/doctor-preview-default-account-warnings

Conversation

@Pick-cat

@Pick-cat Pick-cat commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The existing WhatsApp and Telegram multi-account routing warnings were emitted
only by the direct doctor config flow. Structured doctor lint could not select
them with --all or --only, and moving them naively into the health registry
would duplicate normal doctor output.

Why This Change Was Made

Register one self-running structured health contribution:
core/doctor/default-account-routing.

The contribution reuses the existing warning collectors in preview and fix
modes, while remaining default-disabled for lint so the existing default lint
contract does not change. The duplicate direct emission is removed from the
config flow. Warning collection and repair behavior are otherwise unchanged.

This replaces the earlier seven-file implementation with the canonical
three-file owner-boundary fix.

User Impact

  • Normal openclaw doctor preview still reports the two routing warnings once.
  • openclaw doctor --fix still reports the warnings once without rewriting
    routing configuration.
  • openclaw doctor --lint --only core/doctor/default-account-routing --json can now select and return the two
    structured findings.
  • Default openclaw doctor --lint --json behavior remains unchanged.

Evidence

Exact repaired head: 651b9fc75f54b622fe285404a99adc269ec5a6e0

Blacksmith Testbox tbx_01kwxmthtv1hv7czc1qjb29704:

  • corepack pnpm test:serial src/flows/doctor-health-contributions.test.ts
    passed 87/87 tests.
  • OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 corepack pnpm check:changed passed the
    changed core, test-type, lint, guard, and import-cycle lanes.
  • Targeted oxfmt --check passed for all three changed files.
  • Real CLI proof passed for preview, fix, explicit lint selection, and the
    default-lint negative control.
  • Fresh Codex autoreview reported no accepted or actionable findings.

Hosted exact-head CI is linked from the PR checks.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: S labels Jun 23, 2026
@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 5, 2026, 10:58 AM ET / 14:58 UTC.

Summary
The PR moves existing multi-account default-account routing warnings into a structured core doctor health check, wires it through preview, lint, and gateway-services repair mode, and adds regression coverage.

PR surface: Source +34, Tests +169. Total +203 across 7 files.

Reproducibility: yes. at source level. Current main emits these warnings through the direct doctor config flow, while structured doctor lint lacks this check and the repair helper currently drops detection-only findings; I did not run the CLI in this read-only review.

Review metrics: 1 noteworthy metric.

  • Doctor lint diagnostic: 1 default-enabled warning check added. Warning-level doctor lint findings return a nonzero exit by default, so maintainers should explicitly notice the operator gate change before merge.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-config-flow.ts, migration/backfill/repair: src/commands/doctor/shared/preview-warnings.test.ts, migration/backfill/repair: src/flows/doctor-core-checks.test.ts, migration/backfill/repair: src/flows/doctor-core-checks.ts, migration/backfill/repair: src/flows/doctor-health-contributions.test.ts, migration/backfill/repair: src/flows/doctor-health-contributions.ts, and 3 more. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Maintainer should explicitly accept the default lint exit-status impact or request a non-failing lint shape.

Risk before merge

  • [P1] The new default warning-level doctor lint finding can make existing multi-account configurations return a nonzero openclaw doctor --lint exit where current main and v2026.6.11 do not.

Maintainer options:

  1. Accept the lint gate (recommended)
    Accept that missing explicit multi-account routing now fails default doctor lint while preview and fix remain warning-only and non-mutating.
  2. Narrow lint participation
    Ask for the check to remain visible in preview and fix while becoming opt-in, info-level, or non-failing in default lint.
  3. Pause for routing diagnostics scope
    Hold this PR if maintainers want one coordinated policy for missing bindings, default fallback logs, and restart guidance.

Next step before merge

  • [P2] Maintainer compatibility judgment is needed on the default doctor lint exit behavior; there is no narrow automated repair left after the current patch.

Maintainer decision needed

  • Question: Should missing explicit multi-account default routing become a default warning-level openclaw doctor --lint finding that returns a nonzero lint exit?
  • Rationale: The implementation is narrow and tested, but the default lint severity changes operator gate behavior for existing configs and needs maintainer compatibility intent.
  • Likely owner: giodl73-repo — Recent structured doctor lint and health-contribution history makes this the strongest owner signal for the default lint behavior decision.
  • Options:
    • Accept Warning-Gated Lint (recommended): Merge with the warning-level default lint check so affected multi-account configs fail lint until routing is explicit.
    • Make Lint Non-Failing: Keep preview and fix warnings, but make this check opt-in, info-level, or otherwise non-failing for default lint compatibility.
    • Hold For Broader Routing Diagnostics: Pause this PR until the broader missing-binding fallback diagnostics in [Bug/RFC] Missing binding causes silent fallback to main agent — no warning, no validation #97655 are scoped together.

Security
Cleared: The diff is limited to doctor diagnostic aggregation and tests; no dependency, workflow, package, permission, secret-handling, or code-execution surface change was found.

Review details

Best possible solution:

Land the structured consolidation after maintainers explicitly accept the default lint-gate behavior, or keep the preview/fix warning while making the lint check opt-in, info-level, or otherwise non-failing by default.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level. Current main emits these warnings through the direct doctor config flow, while structured doctor lint lacks this check and the repair helper currently drops detection-only findings; I did not run the CLI in this read-only review.

Is this the best way to solve the issue?

Yes, with a compatibility caveat. Consolidating the existing warning helpers into one structured doctor check and rendering detection-only findings in repair mode is the narrow maintainable fix; the open question is default lint failure behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 862de9f1a1c2.

Label changes

Label justifications:

  • P2: This is a bounded doctor diagnostic fix with limited blast radius but visible CLI output and lint exit-status impact.
  • merge-risk: 🚨 compatibility: The PR adds a default warning-level doctor lint finding that can fail existing lint gates for affected multi-account configs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body includes after-fix terminal output for doctor preview, doctor --lint, and doctor --fix, plus a negative control and focused test commands against a representative config.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix terminal output for doctor preview, doctor --lint, and doctor --fix, plus a negative control and focused test commands against a representative config.
Evidence reviewed

PR surface:

Source +34, Tests +169. Total +203 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 48 14 +34
Tests 3 172 3 +169
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 220 17 +203

What I checked:

  • Repository policy read and applied: Root AGENTS.md was read fully; its guidance treats config/defaults, setup checks, fallback behavior, and compatibility-affecting doctor changes as merge-risk surfaces requiring maintainer judgment. (AGENTS.md:29, 862de9f1a1c2)
  • Current main direct warning path: Current main emits default-account routing warnings directly from loadAndMaybeMigrateDoctorConfig, so the PR is consolidating an existing preview/fix warning rather than inventing new warning text. (src/commands/doctor-config-flow.ts:292, 862de9f1a1c2)
  • PR head preview path: At the PR head, collectDoctorPreviewNotes calls both existing default-account warning helpers, replacing the removed direct emission path for preview mode. (src/commands/doctor/shared/preview-warnings.ts:724, d859f53118bb)
  • PR head lint check: At the PR head, defaultAccountRoutingCheck maps the existing helper warnings into warning-severity core/doctor/default-account-routing health findings and includes the check in the default core check list. (src/flows/doctor-core-checks.ts:700, d859f53118bb)
  • PR head repair path: At the PR head, gateway-services repair runs the default-account-routing check and renders findings only for detection-only batches, preserving doctor --fix warning output without re-rendering repaired browser residue findings. (src/flows/doctor-health-contributions.ts:706, d859f53118bb)
  • Lint exit compatibility: runDoctorLintCli defaults severityMin to warning and exitCodeFromFindings returns 1 for warning-or-higher findings, so the new warning-level check changes default lint gate behavior for affected configs. (src/commands/doctor-lint.ts:49, 862de9f1a1c2)

Likely related people:

  • giodl73-repo: Recent merged commits exposed doctor findings through structured health checks and lint contribution ordering on the same doctor-health-contributions.ts and doctor-core-checks.ts surfaces. (role: recent structured doctor lint contributor; confidence: high; commits: 7bb686c14012, a1063aa4c83f, 219f27a5ec6b; files: src/flows/doctor-health-contributions.ts, src/flows/doctor-core-checks.ts, src/commands/doctor-lint.ts)
  • Sid-Qin: The original merged multi-account accounts.default warning work introduced the warning family this PR is moving into structured doctor checks. (role: adjacent warning feature contributor; confidence: medium; commits: 4ffe15c6b222; files: src/commands/doctor-config-flow.ts, src/routing/default-account-warnings.ts, docs/gateway/doctor.md)
  • vincentkoc: History shows extraction and follow-up maintenance around the shared doctor default-account warning helper and related doctor flow surfaces. (role: doctor helper refactor contributor; confidence: medium; commits: 039ea5998e2a, 7308e72fac98, e085fa1a3ffd; files: src/commands/doctor/shared/default-account-warnings.ts, src/commands/doctor-config-flow.ts, src/flows/doctor-health-contributions.ts)
  • steipete: Path shortlog and nearby commits show substantial prior work across doctor flow and config warning surfaces, making this a plausible fallback routing candidate if the structured lint owner is unavailable. (role: adjacent doctor/config area contributor; confidence: medium; commits: 48aa076d12e7, a861da41b5ad, 9e0d35869521; files: src/flows/doctor-health-contributions.ts, src/commands/doctor-config-flow.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (2 earlier review cycles)
  • reviewed 2026-07-02T11:34:35.799Z sha 2397edb :: needs maintainer review before merge. :: none
  • reviewed 2026-07-05T14:40:04.139Z sha d859f53 :: needs maintainer review before merge. :: none

@Pick-cat
Pick-cat force-pushed the fix/doctor-preview-default-account-warnings branch from bd8543a to c0f0a65 Compare June 24, 2026 01:18
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. and removed status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. labels Jun 24, 2026
@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Fixed P1: registered core/doctor/default-account-routing in doctor-health-contributions (gateway-services contribution), CI now passes (48/48). CLI proof requires multi-account gateway setup not available locally — noted in body.

@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Jun 24, 2026
@Pick-cat
Pick-cat force-pushed the fix/doctor-preview-default-account-warnings branch from e60ba61 to 17cad1a Compare June 24, 2026 07:08
@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Fixed P1 duplicate warning: removed direct calls from doctor-config-flow (preview path gets them via collectDoctorPreviewNotes, repair path via ordered health checks). 1 file changed, -10 lines.

@clawsweeper

clawsweeper Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Pick-cat
Pick-cat force-pushed the fix/doctor-preview-default-account-warnings branch from 17cad1a to ab18b00 Compare June 25, 2026 08:09
@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Fixed P1 repair-mode regression: added runCoreContributionHealthRepair(ctx, ["core/doctor/default-account-routing"]) inside runGatewayServicesHealth, matching the existing pattern in runBrowserHealth. This ensures the default-account-routing warnings are surfaced in all three modes:

  • Preview: via collectDoctorPreviewNotes
  • Lint: via resolveDoctorContributionHealthChecks
  • Repair: via runCoreContributionHealthRepair

Regression test added (1 new test in doctor-health-contributions.test.ts). Negative control confirmed: test fails without the source change, passes with it.

@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 25, 2026
@Pick-cat

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 25, 2026
@Pick-cat
Pick-cat force-pushed the fix/doctor-preview-default-account-warnings branch from 84d3b7f to ad6cb04 Compare June 27, 2026 11:17
@Pick-cat
Pick-cat force-pushed the fix/doctor-preview-default-account-warnings branch from 2397edb to d859f53 Compare July 5, 2026 14:22
@Pick-cat

Pick-cat commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review
Rebased onto latest main, conflicts resolved, tests pass, lint clean.

@clawsweeper

clawsweeper Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@vincentkoc
vincentkoc force-pushed the fix/doctor-preview-default-account-warnings branch from d859f53 to 651b9fc Compare July 7, 2026 07:16
@vincentkoc vincentkoc self-assigned this Jul 7, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Maintainer repair is complete on exact head
651b9fc75f54b622fe285404a99adc269ec5a6e0.

The stale seven-file implementation was replaced with the canonical three-file
fix: one self-running structured health contribution now owns preview, fix, and
opt-in lint reporting, while the duplicate direct config-flow emission was
removed.

Proof:

  • Blacksmith Testbox tbx_01kwxmthtv1hv7czc1qjb29704:
    corepack pnpm test:serial src/flows/doctor-health-contributions.test.ts passed 87/87.
  • The same Testbox passed check:changed for core types, test types, lint,
    guards, and runtime import cycles.
  • Exact-head CLI proof passed for preview, fix, explicit
    core/doctor/default-account-routing lint selection, and the default-lint
    negative control.
  • Fresh Codex autoreview against the final patch reported no accepted or
    actionable findings.
  • Hosted exact-head CI:
    https://github.com/openclaw/openclaw/actions/runs/28848618012

No docs, config schema, migration, dependency, auth, network, or security
surface changed.

@vincentkoc
vincentkoc merged commit 41c0540 into openclaw:main Jul 7, 2026
115 of 117 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 7, 2026
sheyanmin pushed a commit to sheyanmin/openclaw that referenced this pull request Jul 8, 2026
giodl73-repo pushed a commit to giodl73-repo/openclaw that referenced this pull request Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants