Repository navigation
Expire agent.task.status queues of stopped A2A callers (#654) - #656
Merged
Merged
Conversation
Every A2A caller binds a durable per-identity queue,
rockbot.{Agent}.agent-task-status, to the shared status fan-out topic, so a
stopped caller's queue keeps collecting status updates forever. Same failure
mode as discovery (#650), which #653 fixed with per-subscription retention,
but AgentHost's topic list couldn't carry SubscriptionOptions.
- TopicSubscription gains an optional SubscriptionOptions, set through a new
AgentHostBuilder.SubscribeTo(topic, SubscriptionOptions) overload.
AgentHost subscribes through the options overload; topics without options
get the same defaults as before.
- The A2A caller's status subscription uses a 10 min TTL, 24 h idle expiry
and no dead-lettering. Status updates only matter while the in-memory
task tracker knows the task, which a restart clears.
- design/messaging.md: audit note updated (every other host topic is
point-to-point or a work queue); cleanup command covers status queues.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Summary
AgentHosttopics can carrySubscriptionOptions.TopicSubscriptiongets an optionalOptionsparameter, set through the newAgentHostBuilder.SubscribeTo(topic, SubscriptionOptions)overload.AgentHost.StartAsyncnow subscribes through the options overload ofIMessageSubscriber.SubscribeAsync. Topics registered without options get the same defaults as before, so RabbitMQ declares the same arguments for them. The topic'sDispatchConcurrencyalways wins.agent.task.statussubscription (rockbot.{Agent}.agent-task-status) now usesStatusSubscriptionOptions:MessageTtl= 10 min,IdleExpiry= 24 h,DeadLetter = false. That's the same shape as discovery in Expire discovery queues of stopped agents (#650) #653.A2ATaskTrackerstill knows the task, and a restart clears that.Ephemeral: deleting the shared queue on dispose would break the replacement pod during a rolling restart.agent.task.statusis the only shared fan-out topic on the host topic list. Every other topic is either point-to-point (*.{agentName}) or a work queue (script.invoke), where a pending request should wait, not expire.design/messaging.md: the audit note now describes the fix instead of a follow-up, and the cleanup command also lists orphaned*.agent-task-status(.dlq)queues.Migration
The queue arguments change, so the first start on the new version goes through the existing 406 → delete-and-recreate path, which drops whatever status updates are queued. Those updates are stale anyway: the tracker is empty after the restart. The old
rockbot.{Agent}.agent-task-status.dlqis no longer fed and can be deleted once empty.Test plan
RockBot.Messaging.Testsagainst a local RabbitMQ 4 broker: 50/50.AgentHostSubscriptionTests: options are passed through, defaults are used when no options are set, and the topic's concurrency wins.StatusSubscriptionOptionsto the status topic only.rockbot.RockBot.agent-task-status, andrabbitmqctl -p / list_queues name consumers arguments | grep agent-task-statusshowsx-message-ttl600000,x-expires86400000, and no dead-letter routing.Closes #654
🤖 Generated with Claude Code