Repository navigation
Extra-fetch stored agents that fell off the newest-200 dispatch catalog - #346
Merged
Merged
Conversation
GET /v1/agents/:id already used get_agent_record. Orchestrate, A2A, and the scheduler installed only list_agent_records(200), so a stored agent that fell off that page 404'd as not found. Dispatch now extra-fetches the targeted id; sibling /agent and /parallel still use the REST page. Co-authored-by: Tyler Reckart <tylerreckart@users.noreply.github.com>
…gent-catalog # Conflicts: # CHANGELOG.md
tylerreckart
marked this pull request as ready for review
September 21, 2026 12:59
tylerreckart
enabled auto-merge (squash)
September 21, 2026 12:59
…gent-catalog # Conflicts: # CHANGELOG.md
…gent-catalog # Conflicts: # CHANGELOG.md
…gent-catalog # Conflicts: # CHANGELOG.md
…gent-catalog # Conflicts: # CHANGELOG.md
…gent-catalog # Conflicts: # CHANGELOG.md
…gent-catalog # Conflicts: # CHANGELOG.md
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.
Problem
GET /v1/agents/:idresolves a stored agent withget_agent_record./v1/orchestrate,/v1/agents/:id/chat, A2Amessage/sendandmessage/stream, and the scheduler installed onlylist_agent_records(200)(newestupdated_at).Event routing already has
list_agent_records_for_routingbecause a tenant with more than 200 agents can drop older ids off that page. Dispatch never got the same treatment, so a targeted stored agent GET still found returned SSEagent not found/ A2ATaskNotFound/ schedulernot found in tenant catalog.Fix
list_agent_records_for_dispatchreturns the newest-200 page plus aget_agent_recordof the targeted id when it is missing (empty /indexskip the extra fetch). Orchestrate, A2A, and the scheduler install that set. Sibling/agentand/parallelstill resolve from the newest-200 REST page;GET /v1/agentslist paging is unchanged.Tests
unit_tenant_agents— 201 agents so the 200 page drops one; dispatch of that id returns 201; on-page id is not duplicated; empty/index/missing/cross-tenant ids do not leak. Suite 7/7 locally (+ ASan/UBSan).Independently mergeable against
main(0456350). merge-tree vs #321–#345: code auto-merges. CHANGELOG[Unreleased]sibling-conflicts as usual after the first of those merges.Note
Medium Risk
Touches orchestrator catalog loading on orchestrate, A2A, and scheduler paths; behavior change is narrow (extra row when targeted id fell off the page) but affects agent resolution for large catalogs.
Overview
Fixes a catalog mismatch for tenants with more than 200 stored agents: dispatch paths only installed the newest-200
updated_atpage, soGET /v1/agents/:idcould succeed while/v1/orchestrate, agent chat, A2Amessage/send/message/stream, and the scheduler returned agent not found for older ids.Adds
TenantStore::list_agent_records_for_dispatch, which keeps the newest-200 list and extra-fetches the targeted id viaget_agent_recordwhen it is missing (skips for empty /index).build_blocking_orchestrator/build_a2a_orchestratortake an optionaltarget_agent_idand install that set; orchestrate, A2A, and scheduler pass the run’s agent id. Sibling/agentand/parallelresolution is unchanged (still newest-200 only). Unit test covers 201-agent tenants, no duplicate on-page ids, and tenant scoping.Reviewed by Cursor Bugbot for commit 97dd547. Bugbot is set up for automated code reviews on this repo. Configure here.