Repository navigation
Hydrate POST /v1/events with the routed agent constitution - #333
Merged
Merged
Conversation
Orchestrate only preloads the newest-200 tenant catalog and never reads agents_dir, so a file-backed match or an off-page tenant agent 404'd (or, on an id clash, ran the tenant blob). Attach the winning constitution as inline agent_def so dispatch matches routing. Co-authored-by: Tyler Reckart <tylerreckart@users.noreply.github.com>
tylerreckart
marked this pull request as ready for review
September 21, 2026 13:23
…ate-agent-def # Conflicts: # CHANGELOG.md
tylerreckart
enabled auto-merge (squash)
September 21, 2026 13:23
Contributor
Author
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 426dbde. Configure here.
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Author
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_dba1911b-2948-4d9d-b30a-e96a91f79364) |
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep both Unreleased changelog entries. Co-authored-by: Cursor <cursoragent@cursor.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.

Problem
POST /v1/eventsroutes file-backed agents first, then the full tenant catalog (list_agent_records_for_routing, up to 10k). It then delegates tohandle_orchestratewith onlyagent_overrideset. Orchestrate preloadslist_agent_records(..., 200)(newestupdated_at) and never readsagents_dir.That mismatch has two failure modes:
agent not foundafter SSE opens.Fix
After routing, attach the winning constitution as inline
agent_defon the synthetic orchestrate body (stampedidmatches the override). File-backed glob wins even when a tenant row shares the id. Explicitagent/ tenant routing prefer the tenant blob, then fall back toagents_dir.indexis unchanged.Tests
unit_route_event— file-backed load by stem / Title Case; file routing prefers the file blob over a colliding tenant blob; tenant/explicit prefer the tenant blob; file fallback when the tenant row is missing;indexand unknown ids stay empty.Independently mergeable against
main. Code hunks (event_routing,handle_event_ingest) auto-merge with #321–#332. CHANGELOG[Unreleased]will need a rebase after whichever sibling merges first.Note
Medium Risk
Changes how event ingest hands off to orchestrate and which constitution runs when file and tenant agents share an id; behavior is covered by new unit tests and fails open if JSON parse fails.
Overview
POST /v1/eventsnow passes the routed agent’s constitution into orchestrate as inlineagent_def, closing a gap where routing could pick a file-backed agent or a tenant agent outside orchestrate’s newest-200 preload while the run still 404’dagent not foundor used the wrong stored definition on id collision.Event ingest records whether file glob routing won, loads the tenant
agent_defwhen tenant routing wins, and uses newevent_ingest_agent_def_json/file_backed_agent_def_jsonhelpers to choose the blob (file wins on clash when file routing won; explicit/tenant paths prefer tenant, then disk) and stampidto matchagent_override. Docs and CHANGELOG describe the behavior;unit_route_eventcovers load, stem vs display name, and precedence.Reviewed by Cursor Bugbot for commit 97f3d40. Bugbot is set up for automated code reviews on this repo. Configure here.