Visitar URL original
Address CodeRabbit Findings on the One-Step Agent Setup by ptr727 · Pull Request #4089 · ptr727/ProjectTemplate · GitHub
Skip to content

Address CodeRabbit Findings on the One-Step Agent Setup - #4089

Merged
ptr727 merged 3 commits into
developfrom
feature/agent-setup-coderabbit-fixes
Nov 12, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/agent-setup-coderabbit-fixes

Conversation

@ptr727

@ptr727 ptr727 commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

Answers CodeRabbit's review of promotion PR #4088, whose head is develop and so takes no fixes directly.

  • update-host skill, Windows commands: a failed download no longer runs a stale loader. The status's "read-only" claim is qualified in the skill, the bootstrap.ps1 usage text and docs/host-setup.md, since a Windows PowerShell 5.1 start first installs PowerShell 7 where it is missing.
  • Status summary, both loaders: the agent-tools step is an inventory that never compares versions with upstream. It is now reported as listed, failed or not checked, and kept apart from the steps judged current.
  • bootstrap.ps1 saves and restores SKILLS_SOURCE_COMMIT and AGENT_SAFETY_SOURCE_COMMIT, so a persistent PowerShell session does not carry one run's commit into the next.
  • Both loaders check the curl, tar and flock prerequisites (tar.exe on Windows) only on the paths that fetch, so --agent-status --from-tree works without them.
  • Both rules wrappers prefer a Python 3.11+ interpreter, then fall back to any Python 3.
  • host-setup/README.md notes that an existing Claude Code registration for another directory is kept.
  • Tests: non-root guards, a Windows symlink-privilege skip, and a Windows skip for the stub-interpreter tests.

Two CodeRabbit findings were declined on #4088 with evidence: the interrupted-write restore and the Windows helper names.

Open Findings

  • .agents/skills/update-host/SKILL.md:34-35 (introduced): -ErrorAction Stop does not end the -Command script after Invoke-WebRequest throws a terminating error. So a failed download still runs powershell -File $f, a stale loader where an earlier run left one, which line 38 says cannot happen. Fixed in 58b3528, in this pull request's review loop: the download sits in a try that exits 1 on failure, and each command passes the loader's exit code back. A recorded local pass over that head found nothing open.

Verification

  • tests/test_bootstrap.py (186), tests/test_global_rules.py (39), tests/test_cli_usage.py, tests/test_tooling_encoding.py and the kit's test_install.py all pass.
  • build_dist.py --check is current. ruff, mypy and the prose gate are clean.
  • docker_lint.py passes shellcheck, shfmt, PSScriptAnalyzer and markdownlint.

🤖 Generated with Claude Code

ptr727 and others added 2 commits November 11, 2026 19:55
The Windows commands in the update-host skill now stop on a failed download, so a stale loader never runs. The skill and the bootstrap.ps1 usage say the status changes nothing in the agent setup, while any action first installs PowerShell 7 where it is missing.

The closing status no longer calls the agent tools step current, since its report lists versions without comparing them to upstream. It prints an inventory line instead. bootstrap.ps1 restores SKILLS_SOURCE_COMMIT and AGENT_SAFETY_SOURCE_COMMIT after the run. Both loaders check curl, tar, flock and tar.exe only after the given-tree return, so a supplied tree needs none of them.

The rules wrappers prefer a Python 3.11 or newer and fall back to any Python 3. The --from-tree docs name how a kept registration moves. Two tests gain the non-root guard, and the symlink test skips where a host refuses symlinks.

Refs #2553

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The interpreter-choice test uses extension-less shell stubs that Windows cannot start, so it now skips there. The agent status tracks the agent tools outcome apart from the not-current steps. A failed inventory report prints its own line instead of the inventory line, and the "every other step" line depends only on the other three steps.

The update-host skill drops the session-wide error preference, since a child's stderr line would end the setup partway under Windows PowerShell 5.1, and uses -ErrorAction Stop on the download alone. The skill and the host-setup doc both carry the qualified wording that the status changes nothing in the agent setup while any Windows bootstrap action first installs PowerShell 7.

Refs #2553

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ptr727 ptr727 added the comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses label Nov 12, 2026
Copilot AI lite review requested due to automatic review settings November 12, 2026 04:03
@ptr727

ptr727 commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head f5f7c89899c0cbad3822926bc2ce44bb4e98eff7, the content this pull request carries at that commit against develop, and it recorded 1 finding.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

-ErrorAction Stop turns a failed Invoke-WebRequest into a terminating error, which ends
only that statement inside a -Command script, so the next statement still ran a stale
loader. The download now sits in a try that exits 1 on failure, and each command passes
the loader's exit code back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ptr727

ptr727 commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 58b3528ac8d197fe7a62f7408acf9c78eab665ee, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

An active moderate issue remains because download failures can still allow a stale loader file to run, and the same unsafe behavior exists in the status command.

1 open issue
What changed in this PR

This PR addresses follow-up findings in the one-step agent setup workflow across Linux and Windows, improving status accuracy, interpreter selection, environment cleanup, documentation, and test coverage.

Changes:

  • Separates agent-tool inventory results from setup steps that can be judged current.
  • Prefers Python 3.11+ for global rule writers while retaining Python 3 fallback behavior.
  • Adds lazy prerequisite checks, PowerShell source-commit restoration, and expanded regression coverage.
  • Synchronizes host setup documentation and generated update-host skill distributions.
File Description
tests/​test_global_rules.py Adds interpreter-selection coverage and platform-specific skips for Windows setup tests.
tests/​test_bootstrap.py Expands coverage for status reporting, prerequisites, environment restoration, and privilege behavior.
host-setup/​windows/​install-global-rules.ps1 Prefers Python 3.11 or newer before falling back to another Python 3 interpreter.
host-setup/​README.md Documents existing Claude Code registration behavior and Windows status semantics.
host-setup/​linux/​install-global-rules.sh Adds version-aware Python interpreter selection for global rule installation.
host-setup/​bootstrap.sh Defers fetch-only prerequisite checks and separates agent-tool inventory status from current-state checks.
host-setup/​bootstrap.ps1 Restores source-commit environment variables and updates Windows prerequisite and status handling.
docs/​host-setup.md Clarifies Windows PowerShell behavior and agent-tool status reporting.
.github/​skills/​update-host/​SKILL.md Updates the GitHub update-host skill with revised setup commands and status guidance.
.claude-plugin/​fleet-skills/​skills/​update-host/​SKILL.md Updates the generated Claude-compatible update-host skill copy.
.claude-plugin/​fleet-skills/​.source-digests/​update-host Records the updated source digest for the generated update-host skill.
.agents/​skills/​update-host/​SKILL.md Updates the canonical update-host skill instructions and status guidance.

Review effort: Lite

Comment thread .agents/skills/update-host/SKILL.md Resolved
@codecov

codecov Bot commented Nov 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.85%. Comparing base (a342470) to head (58b3528).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #4089   +/-   ##
========================================
  Coverage    76.85%   76.85%           
========================================
  Files           40       40           
  Lines        14070    14070           
========================================
  Hits         10813    10813           
  Misses        3257     3257           
Flag Coverage Δ
python-3.13 76.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit f524ffd into develop Nov 12, 2026
13 checks passed
@ptr727
ptr727 deleted the feature/agent-setup-coderabbit-fixes branch November 12, 2026 04:42
ptr727 added a commit that referenced this pull request Nov 12, 2026
…kill (#4088)

## Summary

Promotes one change and its review follow-ups from `develop` to `main`.

- #4087: one action brings a host fully current for every coding agent,
and both host menus run it from a single line.
- `bootstrap.sh --agent-setup` / `bootstrap.ps1 -AgentSetup` runs four
steps in order. It upgrades the coding-agent CLIs already installed,
installs the fleet skills, and installs the Claude Code safety kit. It
then writes the host-wide rule blocks into Codex's and opencode's global
`AGENTS.md`, for each agent present.
- `--agent-status` reports all four read-only, and `--host` and `--dev`
now end with the agent setup.
  - A new `update-host` skill runs the setup from any session.
- The kit's stamp names the resolved commit when installed from a
bootstrap tree, which fixes items 2 and 3 of #2553. Item 1 of #2553,
installing the Claude Code CLI itself, stays open. Hooks for Codex and
opencode stay on #781.

- #4089: answers CodeRabbit's review of this promotion. The Windows
skill commands run the loader only after its download succeeds. The
status summary reports the agent-tools inventory as listed, failed or
not checked rather than current. `bootstrap.ps1` restores the
source-commit variables after a run, and `--agent-status --from-tree` no
longer needs curl, tar or flock. The rules wrappers prefer Python 3.11+.
Two findings were declined with evidence on their threads.

- #4090: the host-setup README's tree-lifetime paragraph no longer
counts the tree-keeping actions, and scopes itself to a run that fetches
its tree.
- #4091: the fleet map's G1 entry and cold-start flowchart describe the
agent setup. The README and the flowchart say the Claude Code plugin
registration, the safety kit and the host-wide rules act only on agents
already installed. So a fresh machine re-runs the agent setup after
installing a coding agent, before its first session. The
`install-skills` and `install-safety-kit` headers state where each
wrapper reaches.

- #4092: answers this promotion's attested local review. The Codex and
opencode rules files carry a digest of the rules written below their
header and note. A hand edit there now reads EDITED and is backed up
before the next rewrite. A non-blank Codex `AGENTS.override.md` makes
the status report SHADOWED and not current, and the setup never touches
it. Two findings from that review were declined with evidence: sharing
the skills installer's commit lookup, and the Python-less report.

- #4093: the Codex host-safety README says a non-blank
`AGENTS.override.md` keeps the host-wide rules from reaching Codex, and
takes their place as its instruction layer.

## Not Verified

- Native Windows end to end, a `verification` gap. Native Windows CI ran
the unit suite, including the new `global_rules.py` tests, and passed.
`bootstrap.ps1 -AgentSetup` / `-AgentStatus`, the Windows wrappers, tar
extraction and the user-profile writes have not run on a real Windows
host. Their PowerShell logic was exercised only through the
lifted-function tests under `pwsh`.

Refs #2553

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comments Permits the comment lines the pull request adds or edits, which the prose gate otherwise refuses

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants