feat: add guard.app.update and guard.app.updateCheck command operations#1310
Merged
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Previous Review Summaries (4 snapshots, latest commit 7191d1e)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 7191d1e)Status: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Previous review (commit d744e28)Status: No Issues Found | Recommendation: Merge Files Reviewed (1 file)
Previous review (commit 1768f73)Status: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (4 files)
Fix these issues in Kilo Cloud Previous review (commit 649d0b9)Status: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (4 files)
Reviewed by step-3.7-flash · Input: 72.7K · Output: 11.9K · Cached: 84K |
…perations Add two new command queue operations for remote Guard CLI updates: 1. guard.app.update — executes run_guard_update(dry_run=False) on the agent machine. Returns the update payload and exit code. Does not require a harness (updates hol-guard itself, not a harness adapter). 2. guard.app.updateCheck — calls build_guard_update_status_payload() read-only. Returns current_version, latest_version, update_available, auto_updatable, and blocked_reason. Used by the portal to display version status in the agent list. Auto-update: _maybe_auto_update() runs during the empty poll path when no job was leased. Throttled to once per 6 hours via guard_auto_update_state KV. Only self-applies when auto_updatable=True, update_available=True, and no blocked_reason. Source/editable installs are excluded by the existing auto_updatable flag in build_guard_update_status_payload. Tests: 9 new tests covering both executors, auto-update throttle, auto-update exclusion for non-auto-updatable installs, and auto-update skip when no update is available. All 77 existing command queue tests still pass.
…rmed state Address Greptile review feedback: - P1: Wrap json.loads in try/except for malformed auto-update state. A corrupted guard_auto_update_state value no longer crashes the empty-poll path — it is treated as empty state. - P2: Move auto-update logic to auto_update.py (96 lines), reducing command_queue.py from 609 to 490 lines. command_queue.py now has a thin _maybe_auto_update wrapper that delegates to auto_update.maybe_auto_update. Added test: test_auto_update_handles_malformed_state verifies that malformed JSON in the state KV does not crash.
…ting - Restore _REQUEST_TIMEOUT_SECONDS constant that was accidentally removed during the auto-update extraction - Fix import block sorting (auto_update before runner) - Remove unnecessary quotes from type annotations in auto_update.py (from __future__ import annotations is present)
Address Greptile P1: run_guard_update() only refreshes managed harness installs when store is passed. Previously passed store=None which meant the update would not trigger the managed install refresh flow.
…-update state Address Greptile P1: GuardStore does not define get_kv/set_kv. Use the existing get_sync_payload/set_sync_payload methods that command_queue.py already uses for its state persistence. Remove the defensive hasattr checks since these methods are part of the GuardStore interface. Remove unused json import.
Address Greptile P1: when build_guard_update_status_payload() raises, the throttle state was not persisted, causing the next poll cycle to retry immediately. Now saves last_check_at and last_check_error before returning.
7191d1e to
ab61bca
Compare
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.
Summary
Add two new command queue operations for remote Guard CLI updates:
guard.app.update— executesrun_guard_update(dry_run=False)on the agent machine. Returns the update payload and exit code. Does not require a harness (updates hol-guard itself, not a harness adapter).guard.app.updateCheck— callsbuild_guard_update_status_payload()read-only. Returnscurrent_version,latest_version,update_available,auto_updatable, andblocked_reason. Used by the portal to display version status in the agent list.Auto-update
_maybe_auto_update()runs during the empty poll path when no job was leased. Throttled to once per 6 hours viaguard_auto_update_stateKV. Only self-applies when:auto_updatable=Trueupdate_available=Trueblocked_reason=NoneSource/editable installs are excluded by the existing
auto_updatableflag inbuild_guard_update_status_payload.Tests
9 new tests in
test_guard_command_executors_update.py:All 77 existing command queue tests still pass.