fix(guard): page cloud command request snapshots#1292
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Greptile SummaryThis PR updates local approval-request snapshots sent through Guard Cloud command leases. The main changes are:
Confidence Score: 5/5Safe to merge with low risk. The change is focused on snapshot extraction, bounded payload shaping, and cursor paging. The added tests cover the main oversized-payload and multi-page backlog paths. No blocking correctness or security issues were identified. No files require special attention.
What T-Rex did
Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant Cloud as Guard Cloud command queue
participant Executor as command_executors
participant Snapshots as local_request_snapshots
participant Store as GuardStore
Cloud->>Executor: guard.localRequests.snapshot
Executor->>Snapshots: local_request_snapshot_payload(store)
Snapshots->>Store: get saved cursor state
Snapshots->>Store: list pending requests(limit + 1, cursor)
Snapshots->>Store: list resolved requests(limit + 1, cursor)
Snapshots->>Snapshots: shape cloud-safe payload fields
Snapshots->>Store: save next cursor or clear completed cursor
Snapshots-->>Executor: requests + completeness markers
Executor-->>Cloud: command result payload
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant Cloud as Guard Cloud command queue
participant Executor as command_executors
participant Snapshots as local_request_snapshots
participant Store as GuardStore
Cloud->>Executor: guard.localRequests.snapshot
Executor->>Snapshots: local_request_snapshot_payload(store)
Snapshots->>Store: get saved cursor state
Snapshots->>Store: list pending requests(limit + 1, cursor)
Snapshots->>Store: list resolved requests(limit + 1, cursor)
Snapshots->>Snapshots: shape cloud-safe payload fields
Snapshots->>Store: save next cursor or clear completed cursor
Snapshots-->>Executor: requests + completeness markers
Executor-->>Cloud: command result payload
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge All reviewed issues were resolved in earlier patches. The incremental changes are clean:
Files Reviewed (3 files)
Previous Review Summary (commit 3d2de80)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 3d2de80)Status: No Issues Found | Recommendation: Merge The existing P1/P2 comments referenced in the prompt are stale and were already addressed:
All changed code is clean:
Files Reviewed (3 files)
Reviewed by laguna-m.1-20260312:free · Input: 141.3K · Output: 13.1K · Cached: 263.9K |
Summary
Testing
python3 -m ruff format src/codex_plugin_scanner/guard/runtime/command_executors.py src/codex_plugin_scanner/guard/runtime/local_request_snapshots.py tests/test_guard_command_snapshot_paging.pypython3 -m ruff check src/codex_plugin_scanner/guard/runtime/command_executors.py src/codex_plugin_scanner/guard/runtime/local_request_snapshots.py tests/test_guard_command_snapshot_paging.pypython3 -m pytest tests/test_guard_command_snapshot_paging.py tests/test_guard_command_queue.py -q