feat(ipc): poll agent snapshots#300
Conversation
Greptile SummaryThis PR consolidates the two-round GUI poll (
Confidence Score: 5/5Safe to merge — the change is a straightforward consolidation of two RPCs into one, with no removal of existing methods and the protocol version bump correctly guarded by wire-format golden tests. The atomicity fix is correct: launch_at_login, inventory_health, and inventory are all read under a single orchestrator lock. Fields outside the orchestrator (accessibility_granted, hook_installed) are handled the same way as the pre-existing status() method. The wire format is fully pinned by golden-byte tests, and snapshot() is properly appended as variant 0x0e without disturbing any existing variant indices. The old status() and inventory() methods remain in the trait, preserving compatibility. No files require special attention. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant GUI as GUI (ipc_client.rs)
participant Agent as Agent (server.rs)
participant Orch as Orchestrator
Note over GUI,Agent: Before (v3) - two separate RPCs
GUI->>Agent: status()
Agent->>Orch: lock - launch_at_login, inventory_health
Orch-->>Agent: values
Agent-->>GUI: AgentStatus
Note over Orch: enumeration can land here
GUI->>Agent: inventory()
Agent->>Orch: lock - inventory list
Orch-->>Agent: list
Agent-->>GUI: DeviceInventory list
Note over GUI: may pair stale health with fresh list
Note over GUI,Agent: After (v4) - single atomic RPC
GUI->>Agent: snapshot()
Agent->>Orch: lock - launch_at_login + inventory_health + inventory
Orch-->>Agent: all three from same lock
Agent-->>GUI: AgentSnapshot
Note over GUI: health and list always consistent
%%{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 GUI as GUI (ipc_client.rs)
participant Agent as Agent (server.rs)
participant Orch as Orchestrator
Note over GUI,Agent: Before (v3) - two separate RPCs
GUI->>Agent: status()
Agent->>Orch: lock - launch_at_login, inventory_health
Orch-->>Agent: values
Agent-->>GUI: AgentStatus
Note over Orch: enumeration can land here
GUI->>Agent: inventory()
Agent->>Orch: lock - inventory list
Orch-->>Agent: list
Agent-->>GUI: DeviceInventory list
Note over GUI: may pair stale health with fresh list
Note over GUI,Agent: After (v4) - single atomic RPC
GUI->>Agent: snapshot()
Agent->>Orch: lock - launch_at_login + inventory_health + inventory
Orch-->>Agent: all three from same lock
Agent-->>GUI: AgentSnapshot
Note over GUI: health and list always consistent
Reviews (3): Last reviewed commit: "docs(gui): wrap IPC client module commen..." | Re-trigger Greptile |
f5e0d10 to
23daf93
Compare
d2677a7 to
6692194
Compare
|
Review follow-up: wrapped the IPC client module comment. I checked the suggested |
6692194 to
2844f55
Compare
Summary
Validation
Stacked on #299.