Skip to content

docs(github): clarify restart after gh setup - #75169

Closed
pfrederiksen wants to merge 1 commit into
openclaw:mainfrom
pfrederiksen:paul/docs-github-restart-guidance
Closed

pfrederiksen wants to merge 1 commit into
openclaw:mainfrom
pfrederiksen:paul/docs-github-restart-guidance

Conversation

@pfrederiksen

@pfrederiksen pfrederiksen commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • make the post-install/PATH restart requirement prominent in the GitHub skill setup docs
  • add concrete openclaw gateway restart / openclaw gateway status commands
  • mention PATH/service-user checks when gh works in the shell but the skill still appears unavailable
  • preserve the existing GH_CONFIG_DIR/HOME mismatch troubleshooting from main

Fixes #65958

Real behavior proof

  • Behavior or issue addressed: GitHub skill setup docs now distinguish install/PATH changes from auth/HOME troubleshooting. Installing gh or changing PATH while the gateway is already running requires openclaw gateway restart; fresh-session wording is no longer used for the binary-cache case.

  • Real environment tested: Live OpenClaw setup on Linux clankerpoo, running gateway service via systemd user service, PR branch paul/docs-github-restart-guidance at dad534fbce498dfcb3a332fcfe25530bc05bc07b after rebase onto origin/main.

  • Exact steps or command run after this patch:

    openclaw gateway status
    gh auth status
    grep -n "After installing \`gh\` or changing \`PATH\`\|openclaw gateway restart\|GH_CONFIG_DIR" skills/github/SKILL.md
    node --input-type=module <<'NODE'
    import fs from 'node:fs';
    import os from 'node:os';
    import path from 'node:path';
    import { hasBinary } from './src/shared/config-eval.ts';
    const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'hasBinary-gh-'));
    const oldPath = process.env.PATH;
    process.env.PATH = dir;
    console.log('initial missing:', hasBinary('gh'));
    const gh = path.join(dir, 'gh');
    fs.writeFileSync(gh, '#!/bin/sh\necho fake-gh\n');
    fs.chmodSync(gh, 0o755);
    console.log('after install same PATH:', hasBinary('gh'));
    process.env.PATH = `${dir}${path.delimiter}${oldPath ?? ''}`;
    console.log('after PATH string changes:', hasBinary('gh'));
    NODE
  • Evidence after fix: Copied live terminal output from the OpenClaw setup:

    Service: systemd user (enabled)
    Command: /usr/bin/node /usr/lib/node_modules/openclaw/dist/index.js gateway --port 18789
    Service file: ~/.config/systemd/user/openclaw-gateway.service
    Service env: OPENCLAW_GATEWAY_PORT=18789
    Runtime: running (pid 1150531, state active, sub running, last exit 0, reason 0)
    Connectivity probe: ok
    Capability: admin-capable
    --- gh auth status ---
    github.com
      ✓ Logged in to github.com account pfrederiksen (/root/.config/gh/hosts.yml)
      - Active account: true
      - Git operations protocol: https
      - Token: gho_************************************
      - Token scopes: 'gist', 'read:org', 'repo', 'workflow'
    --- proof text grep ---
    66:### After installing `gh` or changing `PATH`
    75:openclaw gateway restart
    93:looks up its config under `$GH_CONFIG_DIR`, then `$XDG_CONFIG_HOME/gh`, then
    97:To point the gateway at the canonical `gh` config, set `GH_CONFIG_DIR` on the
    102:GH_CONFIG_DIR=/path/to/operator/.config/gh
    initial missing: false
    after install same PATH: false
    after PATH string changes: true
    
  • Observed result after fix: The patched docs show the required gateway restart command for install/PATH changes, preserve the GH_CONFIG_DIR/HOME troubleshooting section from current main, and the live cache probe shows why restart is necessary: adding gh without changing the running process PATH keeps hasBinary('gh') false until the process environment changes or the gateway restarts.

  • What was not tested: I did not actually uninstall/reinstall gh or restart the production gateway; the live proof uses a temporary executable and the real hasBinary implementation to avoid disrupting the running OpenClaw service.

Verification

  • pnpm dlx markdownlint-cli2 skills/github/SKILL.md
    • Summary: 0 error(s)
  • git diff --check
  • Rebased onto current origin/main; PR is now mergeable.

@clawsweeper

clawsweeper Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

Summary
The PR updates skills/github/SKILL.md with GitHub CLI install/PATH restart guidance, gateway status checks, service-user PATH troubleshooting, and markdownlint-safe wrapping of long gh examples.

Reproducibility: yes. Source inspection shows the GitHub skill requires gh, eligibility uses cached hasBinary, and the contributor's terminal proof exercises the after-fix cache behavior.

Real behavior proof
Sufficient (terminal): The PR body includes after-fix terminal output from a live OpenClaw setup plus a direct hasBinary('gh') cache probe, with sensitive token output redacted.

Next step before merge
No repair lane is needed; the patch has no blocking findings and the remaining action is ordinary maintainer review and merge gating.

Security
Cleared: The diff is Markdown-only in skills/github/SKILL.md and does not change execution paths, dependencies, workflows, permissions, package resolution, or secret handling.

Review details

Best possible solution:

Land this docs clarification after normal maintainer review so the linked setup issue can close, and track any automatic restart prompt as separate product work.

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

Yes. Source inspection shows the GitHub skill requires gh, eligibility uses cached hasBinary, and the contributor's terminal proof exercises the after-fix cache behavior.

Is this the best way to solve the issue?

Yes. A docs-only restart/status clarification is the narrowest maintainable fix for the reported setup confusion; automatic restart prompting would be a separate product decision.

What I checked:

  • PR diff adds restart guidance: The PR adds an After installing gh or changing PATH section with openclaw gateway restart, openclaw gateway status, gh auth status, and service-user PATH troubleshooting. (skills/github/SKILL.md:66, dad534fbce49)
  • Current main still lacks the new block: Current main's setup section has gh auth login / gh auth status followed by the GH_CONFIG_DIR HOME-mismatch section, with no prominent post-install/PATH restart flow. (skills/github/SKILL.md:56, 532759e1ab2e)
  • GitHub skill requires the gh binary: The bundled GitHub skill declares metadata.openclaw.requires.bins: ["gh"], so the docs guidance is tied to an actual skill eligibility requirement. (skills/github/SKILL.md:9, 532759e1ab2e)
  • Skill eligibility uses cached binary lookup: shouldIncludeSkill passes hasBin: hasBinary into runtime eligibility, so the running process PATH determines whether the GitHub skill is available. (src/agents/skills/config.ts:89, 532759e1ab2e)
  • Binary lookup cache supports restart wording: hasBinary caches lookup results and clears the cache only when PATH or Windows PATHEXT changes, matching the PR's restart guidance for an already-running gateway. (src/shared/config-eval.ts:148, 532759e1ab2e)
  • Existing test covers cache invalidation: The config-eval test asserts binary lookups are cached until PATH changes, which matches the source-level reproduction path and contributor proof. (src/shared/config-eval.test.ts:88, 532759e1ab2e)

Likely related people:

  • steipete: GitHub commit metadata ties this account to the original GitHub skill, runtime-requires reuse, and adjacent gh config discovery hardening that shape the affected setup path. (role: feature-history and adjacent runtime contributor; confidence: high; commits: 145964c85e21, 7687f6cfcd5c, 4615f08817c7; files: skills/github/SKILL.md, src/shared/config-eval.ts, src/agents/skills/config.ts)
  • thewilloftheshadow: GitHub commit metadata ties this account to the missing skill dependency metadata work, including the requires.bins gate involved in this setup path. (role: dependency metadata contributor; confidence: medium; commits: a21671ed5b3f; files: skills/github/SKILL.md)
  • tmimmanuel: This account authored the merged GH_CONFIG_DIR/HOME mismatch doctor and docs work that this PR preserves and builds on in the same GitHub CLI setup area. (role: adjacent fix author; confidence: medium; commits: 8d1b2757c1b8; files: skills/github/SKILL.md, src/agents/skills/gh-config-discovery.ts, src/commands/doctor-skills.ts)

Remaining risk / open question:

  • The linked issue also mentions an optional automatic restart prompt; this PR intentionally solves only the immediate documentation gap.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 532759e1ab2e.

@pfrederiksen
pfrederiksen force-pushed the paul/docs-github-restart-guidance branch from 7de2ca6 to dad534f Compare May 14, 2026 01:53
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label May 14, 2026
@pfrederiksen

pfrederiksen commented May 14, 2026 •

Copy link
Copy Markdown
Contributor Author

Updated this PR with the requested real behavior proof and rebased it onto current main.

Behavior proof against src/shared/config-eval.ts:

initial missing: false
after install same PATH: false
after PATH string changes: true

That demonstrates hasBinary('gh') caches a missing binary inside the running process until PATH changes, so the docs now require openclaw gateway restart after installing gh or changing PATH instead of saying a fresh agent session is enough. I also preserved the existing GH_CONFIG_DIR/HOME troubleshooting section from main.

Validation:

pnpm dlx markdownlint-cli2 skills/github/SKILL.md  # Summary: 0 error(s)
git diff --check

@clawsweeper re-review

Re-review progress:

@clawsweeper

clawsweeper Bot commented May 14, 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.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 14, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 14, 2026
@pfrederiksen

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: GitHub skill requires OpenClaw restart after CLI installation but restart guidance is unclear

1 participant