Skip to content

refactor(doctor): inline GitHub skill discovery inputs - #140343

Merged
steipete merged 1 commit into
mainfrom
steipete/deletion-doctor-gh-discovery
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/deletion-doctor-gh-discovery

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Doctor's GitHub CLI hint path went through two private wrappers for default inputs and a purported test injection seam. Neither has another caller; tests use the real Doctor entry and the canonical discovery owner. This production-deletion follow-up to #135868 removes that indirection.

Why This Change Was Made

Construct the same discovery input directly in the hint owner, before the existing eligibility checks. Pass the existing filesystem predicate directly, combine the identical missing/ineligible early returns, and infer the detector result type.

Removal Surviving owner and coverage
Private defaultGhConfigDiscoveryInput and describeGhConfigDirHintFromDiscovery wrappers src/commands/doctor-skills.ts:22 owns the same inputs and detection. Real Doctor hint output remains covered by src/commands/doctor-skills.test.ts:207.
Filesystem forwarding closure and redundant result annotation/import The canonical detectGhConfigDirMismatch still receives the same platform, environment and existence check; src/skills/lifecycle/gh-config-discovery.test.ts:28 retains its 18 platform/discovery cases unchanged.
Separate missing-skill early return The same empty outcome is shared with the existing ineligible branch. src/commands/doctor-skills.test.ts:230 protects ineligible suppression; non-GitHub skill cases at :102 continue through the same real Doctor entry.

Whole-repository search finds no external caller of the deleted private functions. git log -S defaultGhConfigDiscoveryInput reaches the shallow history boundary e357203be57; no older introduction claim is made. No public or shipped injection contract is removed.

User Impact

No observable behavior change. Discovery input construction order, eligibility, configuration hints and displayed output remain unchanged. No tests were edited or removed.

Evidence

  • Doctor skills and canonical GitHub config discovery suites: all 28 tests passed before and after.

  • Independent Codex review: scoped-clean, no actionable P0–P2 findings.

  • Production +6 / −21 = −15 lines. Tests/support, tooling and docs: unchanged.

  • Full node scripts/check-changed.mjs passed, including typechecking, Knip, lint and runtime import-cycle checks.

Rebased onto the main-side docs route repair #140337. Earlier source validation remains byte-identical; the lockfile is unchanged.

ClawSweeper disposition: its technical re-review confirms that configuration repair, persistence and authorization code are unchanged, and says the earlier migration-proof blocker is unsupported. The rendered “Add data-model compatibility proof” checklist is therefore skipped: this diff changes no schema, stored representation, migration, retention, concurrency, recovery or projection semantics. The same 28 existing tests and identical discovery inputs/output protect the actual contract. Exact-head CI run 34050729824 is green.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 6, 2026, 2:12 PM ET / 18:12 UTC.

ClawSweeper review

What this changes

Simplifies Doctor’s GitHub CLI configuration hint by constructing discovery inputs directly and removing private forwarding helpers without changing displayed guidance.

Merge readiness

⛔ Blocked before merge - 1 item remains

The refactor is useful and behavior-preserving, with no actionable findings. Current main still contains the wrappers. The earlier migration-proof blocker is unsupported by this diff and should not carry forward.

Priority: P3
Reviewed head: 8b621c71930af7bda5f9a15a829c03626554bc89

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving simplification with retained coverage and no concrete correctness or security concerns.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied repository state identifies a MEMBER-authored refactor, so the external-contributor proof gate does not apply; reported tests supplement source equivalence but are not live Doctor proof, and no authority change requires additional evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied repository state identifies a MEMBER-authored refactor, so the external-contributor proof gate does not apply; reported tests supplement source equivalence but are not live Doctor proof, and no authority change requires additional evidence.
Evidence reviewed 8 items Introduced refactor preserves behavior: The pinned base-to-head diff only simplifies private hint construction. Environment capture remains before eligibility checks; optional chaining preserves the missing-skill return; the detector still receives a single-path existence predicate. Configuration repair, persistence, and authorization code are unchanged.
Current main still contains the cleanup opportunity: Fetched main retains both private wrappers. The supplied related PRs do not establish a merged replacement for this cleanup.
Latest release retains the wrappers: The supplied latest release, v2026.9.2, also contains the private wrappers and identical eligibility and hint behavior; this cleanup is not already shipped.
Findings None None.
Security None None.

How this fits together

Doctor checks each agent’s skill readiness and presents diagnostic guidance. For eligible GitHub skills, it checks configuration-file locations and displays a hint when the CLI’s effective location differs from an authenticated location.

flowchart TD
  A[Doctor skill check] --> B[Agent skill status]
  B --> C{GitHub skill eligible?}
  C -->|Yes| D[Check config file locations]
  E[Process environment and filesystem] --> D
  D --> F{Location mismatch?}
  F -->|Yes| G[Display GitHub CLI hint]
  C -->|No| H[No hint]
  F -->|No| H
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source -15. Total -15 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 6 21 -15
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 6 21 -15

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-skills.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep discovery policy in its existing owner and construct its runtime inputs directly where Doctor builds the hint.

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

Not applicable: this PR proposes behavior-preserving cleanup, not a reported runtime defect; source inspection supports equivalent inputs, gating, and output.

Is this the best way to solve the issue?

Yes. Inlining the single-use private wrappers reduces indirection while retaining the canonical detector and existing behavioral coverage.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against add29edb0b64.

Labels

Label justifications:

  • P3: This is a small internal simplification with unchanged diagnostic behavior and no new user-facing capability.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The supplied repository state identifies a MEMBER-authored refactor, so the external-contributor proof gate does not apply; reported tests supplement source equivalence but are not live Doctor proof, and no authority change requires additional evidence.

Evidence

What I checked:

  • Introduced refactor preserves behavior: The pinned base-to-head diff only simplifies private hint construction. Environment capture remains before eligibility checks; optional chaining preserves the missing-skill return; the detector still receives a single-path existence predicate. Configuration repair, persistence, and authorization code are unchanged. (src/commands/doctor-skills.ts:22, 8b621c71930a)
  • Current main still contains the cleanup opportunity: Fetched main retains both private wrappers. The supplied related PRs do not establish a merged replacement for this cleanup. (src/commands/doctor-skills.ts:22, add29edb0b64)
  • Latest release retains the wrappers: The supplied latest release, v2026.9.2, also contains the private wrappers and identical eligibility and hint behavior; this cleanup is not already shipped. (src/commands/doctor-skills.ts:22, 3928bad9badf)
  • Canonical discovery boundary: The unchanged discovery owner checks file existence and returns a diagnostic result; its formatter produces guidance. It does not read credential contents, alter environment settings, or perform authenticated I/O. No Codex runtime or protocol contract is required by this refactor. (src/skills/lifecycle/gh-config-discovery.ts:129, 8b621c71930a)
  • Retained behavior coverage: The Doctor tests exercise hint output and ineligible suppression through maybeRepairSkillReadiness with a mocked detector; the discovery suite separately covers platform paths, environment precedence, mismatch detection, and formatting. Neither deleted wrapper is a test entrypoint. The PR reports 28 passing tests before and after and a completed changed-file check; these were not executed during this read-only review. (src/commands/doctor-skills.test.ts:207, 8b621c71930a)
  • Prior review blocker reassessed: The supplied completed review had no findings and requested migration or upgrade proof. The current introduced patch changes no stored format, schema, settings, default, or repair decision, so that request does not apply. The earlier reviewed SHA could not be loaded; no claim of byte-identical rebase continuity is made. (src/commands/doctor-skills.ts:22, 8b621c71930a)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-06T17:55:06.123Z sha 837ce68c180fd8fddd06f128c5cc9c85bd935354 :: blocked before merge. :: none

@steipete
steipete force-pushed the steipete/deletion-doctor-gh-discovery branch from 837ce68 to 8b621c7 Compare September 6, 2026 18:07
@steipete
steipete marked this pull request as ready for review September 6, 2026 18:07
@steipete
steipete merged commit d9cc3ef into main Sep 6, 2026
247 of 249 checks passed
@steipete
steipete deleted the steipete/deletion-doctor-gh-discovery branch September 6, 2026 18:20
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
* origin/main: (25 commits)
  docs(releases): keep the release-notes nav group to version routes (#140353)
  fix(ui): hide trust wrappers in imported chat history
  fix(subagents): subagent list building decodes unrelated saved prompts in large session stores (#139540)
  test(process): share relay startup fixtures (#140345)
  refactor(doctor): inline GitHub skill discovery inputs (#140343)
  refactor(ui): share channel status type definitions (#140331)
  refactor: simplify queue state and infrastructure dispatch (#140311)
  fix: require saved agent turns before update verification succeeds (#140274)
  fix(update): keep the service profile when switching to Git (#140263)
  fix(ui): prevent image avatars overlapping mobile chat (#140341)
  fix(test): accept release subpages in docs route shape (#140337)
  refactor(plugins): share uninstall mutation ownership (#140322)
  refactor(agents): use canonical tool execution arguments (#140280)
  perf(cli): keep inference metadata and domain help lazy (#140327)
  refactor(plugins): simplify self-hosted setup results (#140332)
  refactor(config): reuse parent lookup for unset operations (#140326)
  fix(plugins): preserve exact installed-index mutation receipts (#140328)
  test(agents): simplify MCP and LSP boundary fixtures (#140312)
  fix(ui): preserve literal source previews and copied whitespace (#140306)
  fix: OpenCode Go/Zen requests are missing the required x-opencode-session header (#137464)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

1 participant