feat: add steering/follow-up queue inspection API#54
Merged
Conversation
Add read access to the Agent's message queues so clients can render pending messages while the agent is busy (pi-style queue UIs): - steering_queue_snapshot() / follow_up_queue_snapshot() — point-in-time copy, does not consume - steering_queue_len() / follow_up_queue_len() - take_steering_queue() / take_follow_up_queue() — atomic drain-and-return, enabling edit-and-requeue clear_* methods already existed; this adds the inspection half. Non-breaking, agent.rs only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- add steer_all()/follow_up_all() batch enqueue (one lock) so requeues from take_*_queue() cannot be split by a concurrent drain - document the edit-window semantics honestly: only the drain is atomic; survivors can deliver at the start of the next run; in-flight messages cannot be retracted; ordering vs concurrent producers; QueueMode effect; reset() and persistence caveats - note the _with_sender precondition (queue accessors need the spawn-based flows) - make the doc example self-contained (no undefined helper), derive the count from the snapshot instead of double-locking - api.md: return types on the new rows + batch method rows - test: batch-requeue via steer_all with survivor-content assertion; drop a redundant assertion Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Closes #50
Adds the read side of the
Agentqueue API so clients can render and manage pending messages while the agent is busy (pi-style queue handling):steering_queue_snapshot()/follow_up_queue_snapshot()steering_queue_len()/follow_up_queue_len()take_steering_queue()/take_follow_up_queue()The
clear_*methods already existed; this completes the "access" half of the issue. Snapshots are documented as point-in-time (the loop can drain the queue concurrently);take_*is the atomic primitive for editing.Non-breaking, additive, confined to
agent.rsplus docs (docs/reference/api.md,docs/concepts/agent-loop.md) and a behavioral test covering inspect → take → requeue.🤖 Generated with Claude Code