Repository navigation
Fox job-started hook: sample CPU load without perf-counter rights - #43
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The runner account (fox\factory-runner, scheduled task with a password logon, non-admin, not in Performance Monitor Users) gets zero rows from CIM Win32_PerfFormattedData_PerfOS_Processor: the Perflib ACL admits only INTERACTIVE, services, admins and the perf groups. Every real job therefore printed load=unknown and fell back to the highest block. Get-CpuLoad now reads per-CPU idle/kernel/user times twice, 250 ms apart, with NtQuerySystemInformation(SystemProcessorPerformanceInformation), which needs no rights. A live test asserts 8 numeric loads; in CI it runs as the runner account (diagnostic run 43582300359 failed there with the CIM code: CIM=0, who=factory-runner). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shiratsuru f8 (chart bot-38094207 / ci-fox-concurrency).
Symptom. After Trina installed the PR #42 hook (e4d719a6…d953), the first natural job (kitepon/Caveat run 43579266104, job 132400306799, factory-windows-fox-u2) printed
affinity=0xFF000000 load=unknown: the tie-break came from the highest-index fallback, not from a sample.Cause. Fox runners run as
fox\factory-runnerfrom scheduled taskdotagents-factory-runner-dedicated(LogonType Password = batch logon, RunLevel Limited, session 0). That account is not an admin and not in Performance Monitor Users / Performance Log Users. The Perflib key ACL admits only INTERACTIVE, LOCAL/NETWORK SERVICE, SYSTEM, Administrators and those two groups, so CIMWin32_PerfFormattedData_PerfOS_Processorreturns zero rows, no error. Interactive runs askite_(admin) worked, which is why the PR #42 check passed. Confirmed in the runner context: diagnostic run 43582300359 (old code, new live test) failed with{"load":null,"who":"factory-runner","diag":"CIM=0"}.Fix.
Get-CpuLoadreads per-CPU idle/kernel/user times twice, 250 ms apart, viaNtQuerySystemInformation(SystemProcessorPerformanceInformation)(Add-Type), which needs no rights. Selection rules are unchanged (overlap first, then least loaded, sample failure → highest index). Fox interactive: 32 numeric values in ~0.7 s including the type compile.Same diff.
docs/feature-map/runner-capacity.mdhook row (sample source) and test list; new live test inwindows-runner-job-started-hook.test.mjsasserting 8 numeric loads (prints the sample as a test diagnostic, so the CI log of the Windows job is the runner-context evidence). The no-wait guard now allows only the bounded sample sleep.No Fox install here; Trina installs after merge.
🤖 Generated with Claude Code