Live data and RFC support#39
Conversation
WalkthroughAdds two new FleetConfig fields (LiveMinFrameBytes, LiveSourceID) for fleet automation's live_data/console_log scenarios. Runner logic tracks max frame length from simulator status, adds a polling helper to wait for real data frames, includes source_id in capture commands, and fails scenarios that only produce marker-sized frames. ChangesLive Frame Validation
Sequence Diagram(s)sequenceDiagram
participant Driver
participant SimContainer
participant fleetWaitMaxLen
participant fleetStatus
Driver->>SimContainer: start live_data/console_log (source_id)
SimContainer-->>Driver: req.<cmd>_reply (first frame)
alt LiveMinFrameBytes > 0
Driver->>fleetWaitMaxLen: wait for max_len >= live_min_frame_bytes
loop until deadline or threshold met
fleetWaitMaxLen->>fleetStatus: fleetSimStatus poll
fleetStatus-->>fleetWaitMaxLen: inbound[key].max_len
end
fleetWaitMaxLen-->>Driver: maxLen, reached
alt threshold not reached
Driver->>Driver: fail scenario (lifecycle markers only)
end
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
internal/runner/runner.go (1)
3664-3676: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOptional: extract shared polling loop.
fleetWaitMaxLenduplicates the poll/sleep/deadline structure of the pre-existingfleetWaitCountalmost verbatim, differing only in whichfleetStatusaccessor is called. Could be consolidated into a genericfleetPollUntil(simContainer, dirID, deadline, extract func(*fleetStatus) int, min int)helper to avoid drift between the two if polling behavior (e.g. sleep interval) ever needs to change.Also applies to: 3678-3696
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@internal/runner/runner.go` around lines 3664 - 3676, Extract the duplicated poll/sleep/deadline logic shared by fleetWaitCount and fleetWaitMaxLen into a single helper, since both functions only differ by the fleetStatus accessor they call. Create a generic polling helper in this area that accepts the status-extraction function and threshold, then have fleetWaitCount and fleetWaitMaxLen delegate to it so the sleep interval and deadline behavior stay consistent in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@internal/runner/runner.go`:
- Around line 3664-3676: Extract the duplicated poll/sleep/deadline logic shared
by fleetWaitCount and fleetWaitMaxLen into a single helper, since both functions
only differ by the fleetStatus accessor they call. Create a generic polling
helper in this area that accepts the status-extraction function and threshold,
then have fleetWaitCount and fleetWaitMaxLen delegate to it so the sleep
interval and deadline behavior stay consistent in one place.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: b10145fb-4641-4bda-9f11-0b855ab41dc5
📒 Files selected for processing (2)
internal/config/case.gointernal/runner/runner.go
Several updates for VirtualMetric Fleet
Summary by CodeRabbit
New Features
Bug Fixes