Repository navigation
feat(machine-health): start the monthly run in a plugin profile - #16590
Conversation
The Task Scheduler wrapper takes -PluginProfile <name>. At each run it asks the enabled plugin-profiles install for profiles.mjs launch, clears the variables the argv's env -u words name from the run's environment, and passes the argv's remaining claude arguments before the audit's. That works the same on every platform, so Windows needs no env. A missing plugin-profiles or a refused launch starts no run and logs why. Without the parameter the run is unchanged. Launching at each run, rather than storing the argv at install time, keeps the session file inside the 30-day sweep and the install path current after a plugin update, and adds only the profile name to /tr. Closes #16542 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015XWwmbLtFcfditeagftLrv
|
Owner: the control-hub session "Plugin Presets" watches and merges this pull request; it waits on CI Status and the review lanes on head 5203bd6. Review findings go to it, and the build session (plugin-profiles-build-5) fixes them. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5203bd6a48
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A profile wins on enabledPlugins, so one that leaves machine-health out starts a session that cannot run /machine-health:audit. The wrapper now reads enabledPlugins from the launch result and does not start the run unless a machine-health entry is on, naming the profile and the fix; a result without enabledPlugins is refused with "update plugin-profiles". The setup skill's profile question says the profile must include machine-health. Refs: #16542 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015XWwmbLtFcfditeagftLrv
|
claude-security-review needs no new review of Security review (incremental, since 5203bd6): no security issues foundI read every hunk of the four files in the incremental scope: the changelog fragment, What changed. In
Both checks run before Inputs. SKILL.md. The change adds the requirement that the profile must include machine-health. It removes or softens no instruction. Tests and changelog. The stub gains an Earlier reviews. The settled thread on critical-findings: 0 |
|
claude-review needs no new review of Code review (incremental, 5203bd6 → e1f9dee, blocking only)This lane already reviewed an earlier head, so this pass reports blocking findings only. I read all four files in the incremental diff in full: the changelog fragment, What changed since the last review. When a profile is named, the wrapper now reads
This is the fix the owner described in the settled thread on line 100. I did not raise that thread's point again. Blocking finding (one inline comment). The plugin-profiles in this tree never prints Other checks (no finding).
I ran no tests. The PR's Linux Pester results are as the author reports them and I did not verify them. Verifier dropped 0 of 1 candidates. |
Closes #16542
Summary
The machine-health monthly Task Scheduler run can now start in a plugin profile. #16523 wired the other launch sites to
profiles.mjs launchand left this one out: its/trvalue is capped in length, and the argvlaunchprints starts withenv, which Windows lacks.Fix
plugins/machine-health/skills/setup/templates/monthly-run.ps1: one optional parameter,-PluginProfile <name>(validated to^[A-Za-z0-9][A-Za-z0-9._-]*$, so it cannot add words to/tr). With it, each run:claude plugin list --json(the lane launcher's lookup);node <install>/scripts/profiles.mjs launch <name> --folder <StateBase> --unattended --json;enabledPlugins(each plugin as the session will start with it, which the profile wins) and does not start the run unless amachine-healthormachine-health@*entry istrue: "profile '' leaves machine-health off, so the run would not reach /machine-health:audit and did not start; name a profile that includes machine-health". A result withoutenabledPlugins(a plugin-profiles older than fix(harness-ops): refuse a lane that arms the stop gate under a profile without autonomy #16586) is refused with "update plugin-profiles";env -u NAMEwords name from the run'sProcessStartInfo.Environment, checks the next word isclaude, and passes the remaining words (--settings <session file>) before the audit's arguments, after any leading-ClaudeCommandwords;It never runs
env, on any platform. When plugin-profiles is not installed and enabled, or the launch refuses (exit non-zero, for example a missing required prerequisite under--unattended), the run does not start: the reason goes to the stderr log and the status file records a not-ok run with no exit code. Without-PluginProfilenothing above runs.plugins/machine-health/skills/setup/SKILL.md, Task Scheduler fallback: step 1 asks whether the run should start in a profile (default none) and says the profile must include machine-health; step 2 ends the/trvalue with-PluginProfile <profile>when one is named; step 3's run-now command takes the same parameter.Install-MonthlyRun.ps1is unchanged: nolaunch.json..changes/machine-health/: aminorfragment.Shape, and its Basis. The issue proposed
Install-MonthlyRun -Argvwriting<StateBase>/scheduler/launch.jsonfor the wrapper to read. Launching at each run instead has fewer parts (no new file, no installer change) and avoids two failures that shape would have:profiles.mjs launch"removes session files no launch has written for 30 days" (plugins/plugin-profiles/scripts/profiles.mjs, launch's description), so a session file written once at install could be gone before a monthly run. Each run's launch rewrites it.The
/trvalue grows only by-PluginProfile <name>, about 20 characters, against the cap the issue cites (I did not re-measure the cap;schtasksitself refuses an over-long/tr). Theenvproblem goes away because the wrapper starts claude throughProcessStartInfoalready (monthly-run.ps1, the$psiblock) and removes the variables from its environment itself.Done-when, item by item:
-PluginProfile <profile>in/tr; the wrapper applies it at each run. Delivered.env, no platform branch); the newmonthly-run wrapper in a plugin profilePester block passes on Linux (output under Verification); no cron or other route is added. Delivered, with one note: CI's machine-health Pester lane runs on Windows only (.github/workflows/pr-test-platforms.yml, "Run machine-health Pester suites"), so the Linux run is the local one below.env: the stub's argv startsenv -u PLUGIN_PROFILES_SESSION -u PLUGIN_PROFILES_SESSION_FILE claude, the wrapper runs from a shell where both are set, and the child sees neither (test 1); the wrapper never executesenv. Delivered; CI runs it on Windows.Verification
Invoke-Pester plugins/machine-health/skills/audit/tests/windows/scheduler/monthly-run.Tests.ps1on Linux (pwsh 7.6.10, Pester 6.2.0): the seven new cases pass:Of the existing 17 cases, 16 pass;
passes every argument intact through a .cmd claude, which cmd.exe re-parsesfails on Linux, and fails the same way on unchangedmainthere, since it needscmd.exe. CI runs this suite on Windows.The branch merges
origin/main(with fix(harness-ops): refuse a lane that arms the stop gate under a profile without autonomy #16586, which addedenabledPluginstolaunch --json). Against the merged tree, the realnode plugins/plugin-profiles/scripts/profiles.mjs launch harness-upkeep --folder <empty temp dir> --unattended --json --dry-runprints anenabledPluginsobject holding"machine-health@melodic-software": true; the same call forbuildreports itfalse, which the wrapper now refuses.No Pester case runs the wrapper against the real
profiles.mjs: itslaunchreads the installed plugins throughclaude plugin list --jsonand this machine's settings layers, so on a CI runner with no claude or plugins installed the result would describe the host, not the code. The stub stands in for that result, and the real call above checks its shape.Pre-push
check-affectedpasses.Related
profiles.mjs launch.🤖 Generated with Claude Code
https://claude.ai/code/session_015XWwmbLtFcfditeagftLrv