Repository navigation
fix(doctor): consolidate Gateway service config panels into a single note (#80287) - #78688
Conversation
90844ac to
69d3253
Compare
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. Source inspection on current main shows the three service-config note sites can all fire for a source-checkout entrypoint with audit findings and a declined repair, and the linked report supplies terminal output for that shape. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the focused consolidation after normal maintainer mergeability and CI checks, keeping one mismatch report and one actionable force hint without changing gateway audit or repair semantics. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main shows the three service-config note sites can all fire for a source-checkout entrypoint with audit findings and a declined repair, and the linked report supplies terminal output for that shape. Is this the best way to solve the issue? Yes. Deferring source-checkout text until audit issue codes are known is the narrow maintainable fix, and the latest head preserves force guidance for the declined path when the source-checkout warning was suppressed. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4615f08817c7. |
69d3253 to
eec975a
Compare
5862567 to
a0a52b0
Compare
a0a52b0 to
e739e1f
Compare
e739e1f to
c2e2e44
Compare
|
Verify fix #78688
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing). ✔ rolldown v1.0.0 Finished in 194.35 ms ┌ OpenClaw doctor |
d99da66 to
5b43a3f
Compare
5b43a3f to
d78f5a7
Compare
…note (openclaw#80287) [AI-assisted] `openclaw doctor` emitted three `Gateway service config` panels for one condition. Panel 1 carried the source-checkout warning (with an `openclaw gateway install --force` CTA), Panel 2 the aggregated audit bullets (which already restate the entrypoint mismatch as `X -> Y`), and Panel 3 a post-decline `--force` hint that duplicates Panel 1's CTA verbatim. The same entrypoint mismatch appeared twice and the same remediation appeared twice. Defer the source-checkout warning until after the audit, fold it into the audit-bullet emit so a single `note(..., "Gateway service config")` is produced per pass, and gate the warning on `audit.issues.every((issue) => issue.code !== gatewayEntrypointMismatch)` so the same entrypoint mismatch is not reported twice. Suppress the post-decline `--force` hint when the source-checkout warning already emitted that same advice (otherwise keep it so users without a source checkout still see how to replace the service definition). Verified: - pnpm install --frozen-lockfile - pnpm test src/commands/doctor-gateway-services.test.ts - pnpm exec oxfmt --check --threads=1 src/commands/doctor-gateway-services.ts src/commands/doctor-gateway-services.test.ts Closes openclaw#80287
d78f5a7 to
29d4e1d
Compare
|
Verification for 15f9a66:
Known proof note: an earlier local |
|
Landed via squash merge:
Verification was posted in #78688 (comment). Relevant current-head GitHub checks were green for Real behavior proof, Workflow Sanity, OpenGrep, CodeQL, CodeQL Critical Quality, and the doctor CI shard; remaining Blacksmith broad shards were queued without runners and were not required by branch protection. |
Fixes openclaw#80287. Co-authored-by: YB0y <[email protected]>
Fixes openclaw#80287. Co-authored-by: YB0y <[email protected]>
Fixes openclaw#80287. Co-authored-by: YB0y <[email protected]>
Summary
Describe the problem and fix in 2–5 bullets:
openclaw doctoremits three consecutive◇ Gateway service configpanels for one condition. Panel 1 is the source-checkout warning (with anopenclaw gateway install --forceCTA). Panel 2 is the aggregated audit-issue bullets, which already restate the entrypoint mismatch asX -> Y. Panel 3 is the post-decline--forcehint, which duplicates Panel 1's CTA verbatim.--forceCTA in Panel 1 + Panel 3 invites "did the first one not take?", and the entrypoint mismatch is reported twice (Panel 1's source-checkout prose + Panel 2'sX -> Ybullet). Doctor output is also what users paste into issues / Discord; three panels under one heading make the snippet harder to triage. Reproduces 100% onv2026.5.7and currentorigin/mainwheneverauditGatewayServiceConfigreturns a non-empty issue list together withserviceLayout.entrypointSourceCheckout = true.src/commands/doctor-gateway-services.ts, defer the source-checkout warning until after the audit, fold it into the audit-bullet emit so a singlenote(..., "Gateway service config")is produced per pass, and gate the warning onaudit.issues.every((issue) => issue.code !== gatewayEntrypointMismatch)so the same entrypoint mismatch is not reported twice. Suppress the post-decline--forcehint when the source-checkout warning already emitted that same advice (otherwise keep it so users without a source checkout still see how to replace the service definition).summarizeGatewayServiceLayout, the audit module's wording, the existing post-decline behavior when there is no source checkout (Panel 3 still fires in that case), the four secondary conditional notes at:391-394,:494-497,:501,:506-509(only the three primary emit sites consolidate), theGateway runtimewarning path, and the entrypoint-mismatch detection / repair flow.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
openclaw doctoremits 3+◇ Gateway service configpanels in one run with duplicate--forceCTAs (reproduces onv2026.5.7) #80287Real behavior proof (required for external PRs)
Gateway service configpanel emission with duplicateopenclaw gateway install --forceCTAs and doubly-reported entrypoint mismatch inopenclaw doctor. See [Bug]:openclaw doctoremits 3+◇ Gateway service configpanels in one run with duplicate--forceCTAs (reproduces onv2026.5.7) #80287./usr/bin/nodereportsv20.20.2, version-manager Node~/.nvm/versions/node/v22.22.2/bin/nodeis on PATH. The host has a source checkout at/home/orin/Gittensor/Ycom/openclaw(.git,src/,extensions/,dist/,package.json) sosummarizeGatewayServiceLayoutreportsentrypointSourceCheckout = true. The current daemon was last installed from a different cwd, so the audit surfaces a non-empty issue set includinggatewayEntrypointMismatch. OpenClaw source checkout at this branch tip rebased onto upstreamf298999597.pnpm install --frozen-lockfilepnpm buildpnpm openclaw doctor --non-interactive(One consolidated
Gateway service configpanel — was three before this patch. The source-checkout warning is gated out because the audit's entrypoint-mismatch bullet already covers the same condition; the post-decline--forcehint is the only remaining occurrence ofopenclaw gateway install --forceand only fires when the user actually declines.)◇ Gateway service configpanel is emitted in the bug-trigger configuration. The entrypoint mismatch is reported exactly once (as the audit bullet). Theopenclaw gateway install --forceadvice does not appear twice in the same run. When the user accepts the repair prompt (default--non-interactiveflow), no post-decline hint fires.confirmRuntimeRepairreturning false interactively (covered by an existing unit test that asserts the post-decline--forcehint fires when the source-checkout warning would not have been emitted).entrypointSourceCheckoutis platform-agnostic insummarizeGatewayServiceLayout).Root Cause (if applicable)
maybeRepairGatewayServiceConfighad three independentnote(..., "Gateway service config")emit sites for one condition: a pre-audit source-checkout warning, a post-audit aggregated bullet list, and a post-decline--forcereminder. The first and third repeated the sameopenclaw gateway install --forceremediation, and the first warning's prose described the same entrypoint mismatch that the second panel listed asX -> Y.Gateway service confignote when source-checkout layout coincides with audit findings". Existing tests covered each emit site in isolation (and the post-decline hint in non-interactive flow) but never the bug-shape combination.gatewayEntrypointMismatchissue code existed, so its prose did not anticipate the audit later restating the same mismatch. The post-decline hint was layered on top later as a generic actionable footer without considering whether the source-checkout warning already provided the same CTA.Regression Test Plan (if applicable)
src/commands/doctor-gateway-services.test.ts(one newit(...)case at the bottom of themaybeRepairGatewayServiceConfigdescribe block)..git,src/,extensions/,dist/,package.json) plussetupGatewayEntrypointRepairScenario(current entrypoint inside the source checkout, install entrypoint elsewhere), default-accept prompter. AfterrunRepair, exactly onenote(..., "Gateway service config")is emitted; that note contains the audit bullet "Gateway service entrypoint does not match the current install"; it does not contain "resolves to a source checkout" (gated out by the entrypoint-mismatch presence); and it does not containopenclaw gateway install --force(the post-decline hint never fires when the user accepts).note(...)calls fire and what they contain. Mocking the audit and command surface and asserting the exact emit pattern is sufficient; a seam or e2e test would add scaffolding without catching anything the unit cannot.warns when the gateway service entrypoint resolves to a source checkouttest covers source-checkout + empty audit (one panel by construction); the existingskips entrypoint rewrite in non-interactive fix modetest covers entrypoint mismatch + decline path with no source checkout (so Panel 3 fires there). Neither exercises the source-checkout + non-empty audit combination that produces the bug.User-visible / Behavior Changes
In the reported configuration (entrypoint inside a source checkout + non-empty audit including entrypoint mismatch):
◇ Gateway service configpanels — Panel 1 source-checkout warning with--forceCTA, Panel 2 audit bullets restating the mismatch, Panel 3 post-decline--forcehint.◇ Gateway service configpanel containing only the audit bullets. The source-checkout warning is suppressed (the audit'sgatewayEntrypointMismatchbullet already states the actionable condition). The post-decline--forcehint is suppressed when the source-checkout warning would have emitted, otherwise it still fires.When there is a source checkout but no audit findings, the source-checkout warning still emits as a single panel (existing test
warns when the gateway service entrypoint resolves to a source checkoutcontinues to pass).When there is no source checkout, the audit-bullets panel and the post-decline
--forcehint emit independently as before — unchanged.Diagram (if applicable)
Security Impact (required)
NoNoNoNoNoYes, explain risk + mitigation: N/A — the change is a wording / dedup adjustment in a diagnostics output path.Repro + Verification
Environment
~/Gittensor/Ycom/openclawrebased onto upstreamf298999597claude-cliauth profile; daemon was previously installed from a different cwd, so the audit surfaces non-empty issues includinggatewayEntrypointMismatchSteps
summarizeGatewayServiceLayoutreportsentrypointSourceCheckout = true), and the audit returns non-empty findings (e.g., the install resolves a different entrypoint than the running service).pnpm install --frozen-lockfile && pnpm build.pnpm openclaw doctor --non-interactive.Expected
◇ Gateway service configpanel listing the audit findings, includingGateway service entrypoint does not match the current install. (X -> Y).Gateway service configpanel saying "resolves to a source checkout".openclaw gateway install --forceadvice repeated within the same run when the user accepts the repair.Actual (after this patch — matches expected)
Gateway service configpanel; no duplicate--forceCTA; entrypoint mismatch reported once.Evidence
not.toContain("resolves to a source checkout")fails).pnpm openclaw doctor --non-interactiveis in the Real-behavior-proof section above.Human Verification (required)
Gateway service configpanel (audit bullets only).Gateway service configpanel (source-checkout warning, unchanged).Gateway service confignotes (audit bullets, then--forcehint), unchanged from prior behavior.pnpm test src/commands/doctor-gateway-services.test.ts→ 26/26 pass on Node 22.22.2.pnpm exec oxfmt --check --threads=1 src/commands/doctor-gateway-services.ts src/commands/doctor-gateway-services.test.ts→ clean.Gateway service configemit sites; theGateway runtimepath is unaffected).audit.issues.length === 0with source-checkout — single Panel 1 emit preserved.summarizeGatewayServiceLayout).Review Conversations
Compatibility / Migration
YesNoNoRisks and Mitigations
gatewayEntrypointMismatch(e.g., the only finding is a port mismatch), the source-checkout warning is now emitted as part of the consolidated panel rather than as its own panel. The user-visible content is the same; the panel count drops from two to one.warns when the gateway service entrypoint resolves to a source checkouttest (audit empty) still passes — that path is unchanged. The new path (audit non-empty without mismatch) correctly merges both messages into one panel.--forcehint no longer fires when a source-checkout warning was emitted in the same pass. A user who declined the repair could miss the explicit "runopenclaw gateway install --force" reminder if they skim past the consolidated panel.openclaw gateway install --forcetext (inherited from the source-checkout warning), so the actionable advice is still visible in the same run — just not repeated in a second panel. The decline path without a source-checkout warning is unchanged: Panel 3 still fires there, preserving the actionable hint for users without a source-checkout layout.