feat: add --wait-for-agent flag to exec command #20
+12
−5
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
Adds a
--wait-for-agentflag to theexeccommand that allows the CLI to wait for the guest agent to become ready before executing commands.Motivation
When a VM is still booting, the guest agent may not be ready immediately. Previously,
hypeman execwould fail immediately if the agent wasn't responding. This was especially problematic for:hypeman execimmediately afterhypeman runChanges
--wait-for-agentflag with a default of 30 seconds--wait-for-agent=60for 60 seconds)--wait-for-agent=0to fail immediately (old behavior)wait_for_agentfield to the exec request JSONUsage
Dependencies
This PR depends on the server-side support in:
The
wait_for_agentfield is passed to the exec endpoint, which will retry connecting to the guest agent onAgentConnectionErroruntil the timeout expires.Note
Introduces a configurable wait period for the guest agent before executing commands.
--wait-for-agentCLI flag (default 30s;0to fail immediately) toexeccommandwait_for_agentfield and sets it inhandleExecbased on the flagWritten by Cursor Bugbot for commit e1cd1f6. This will update automatically on new commits. Configure here.