Watchdog is blind inside Incus VMs: add guest-CPU activity signal so busy-but-silent agents aren't killed - #566
Merged
Merged
Conversation
…signal so busy-but-silent agents aren't killed CodeyBox-WorkItem: 2a07eb4dc99247e092b95c0bee4b605c CodeyBox-Agent: antigravity/gemini-3.8-flash-high CodeyBox-Prompt-Revision: 1 Co-Authored-By: CodeyBox <noreply@codeybox.invalid>
…guest-CPU activity signal so busy-but-silent agents aren't killed CodeyBox-WorkItem: 2a07eb4dc99247e092b95c0bee4b605c CodeyBox-Agent: antigravity/gemini-3.8-flash-high Co-Authored-By: CodeyBox <noreply@codeybox.invalid>
…and add the required tests Audit rework: the previous commit added the sampling machinery but never connected it, so the watchdog signal could never fire. - IncusSandboxProvider now overrides SnapshotActiveSandboxProgressAsync: per-owned-sandbox cpu.usage sampling via an injected IIncusInstanceStateReader, a per-sandbox cache gated by ActivitySampleInterval, serialized refreshes, bounded fan-out, and an epoch-countered status that changes only while the guest exceeds ActivityCpuThresholdPercent. Sync SnapshotActiveSandboxProgress reports the same last-known projection. - DefaultIncusInstanceStateReader now validates the instance name and options identity before interpolating them into the incus query path. - IncusCpuActivityEvaluator reduced to Evaluate + IsActive; dropped the lossy implicit bool, the redundant fraction/primitive overloads, and the unused CpuPercent; sample Timestamp is now consumed for elapsed. - WorkerProgressActivitySource rethrows caller cancellation instead of downgrading it to no-signal; watchdog debug log collapsed to one template carrying the measured CPU fraction; CpuFraction units documented on both contracts; ReloadableSandboxProvider fans provider snapshots out in parallel. - Tests: pure-function coverage of the evaluator (first sample, counter reset/regression, threshold boundary, bad elapsed/threshold), the state parser, and the reader's input guards; provider tests with a fake state reader (busy guest changes the signature, idle/failed/within-interval keep it stable); FakeTimeProvider watchdog integration proving a silent busy Incus guest is not recovered past ProgressTimeout while a silent idle guest is. CodeyBox-WorkItem: 2a07eb4dc99247e092b95c0bee4b605c CodeyBox-Agent: antigravity/gemini-3.8-flash-high CodeyBox-Prompt-Revision: 1 Co-Authored-By: CodeyBox <noreply@codeybox.invalid>
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.
Automated via CodeyBox — work item 2a07eb4dc99247e092b95c0bee4b605c
Initiated by CodeyBox operator
Co-Authored-By: CodeyBox noreply@codeybox.invalid
🤖 Generated with CodeyBox