Repository navigation
feat(task): follow a task run to completion with --wait - #235
Merged
Merged
Conversation
- Add `ricochet task invoke --wait`, which polls the run until it finishes and exits non-zero unless it succeeds - Retry a status check that meets a connection error, timeout, or server error, backing off for about 30 seconds - Add `ricochet task invocation get <ID> <INVOCATION_ID>` to read one run, finished or not - Show the invocation ID after `task invoke` by reading the `id` field the server actually returns - Explain that a missing run usually means the server predates reading single runs
|
- Give each status check a 10 second timeout so a stalled request cannot hold a CI job for minutes - Retry failing checks within a 30 second window instead of a count of attempts - Name the run and the `task invocation get` command when waiting fails
JosiahParry
approved these changes
Oct 5, 2026
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.
ricochet task invoke --waitnow follows a task run until it finishes and exits non-zero unless it succeeded, andricochet task invocation getreads one run on demand.AI Summary
Behaviour
ricochet task invoke <ID> --wait(-w) checks the run every 2 seconds until it leavespending, prints the finished run, and exits 1 when it ended asfailureorcancelled. With-F jsonor-F yaml, stdout carries only the finished run.ricochet task invocation get <ID> <INVOCATION_ID>command to check it later.ricochet task invocation get <ID> <INVOCATION_ID>prints one run, finished or not. It takes the content ID as well as the invocation ID, because the server routeGET /api/v0/content/{ulid}/invocations/{id}(ricochet-rs/ricochet#1539) needs both.ricochet task invokenow shows the invocation ID. Every released server answers{"id", "content_id"}, but the CLI readinvocation_idandstatus, which the server never sends, so the table never showed the ID. The response is now typed and the test mocks match the real shape.Validation
just check(fmt, clippy-D warnings, docs-check),cargo test --all-features(278 passed) andprek run -apass.tests/json_output_test.rs:--waitpolls throughpendingtosuccess, a failed run exits non-zero while stdout still parses as JSON (the issue's verification case), a 503 on the first check is retried, a wait that fails names the lost run, andinvocation getwrites JSON alone.tests/invoke_test.rscovers the 404 message.Instructions-PR: ricochet-rs/agent-instructions#42
Closes #216