Repository navigation
fix(api): make api/registry.py report the prefixes the app actually mounts (#15120) - #15132
Merged
Merged
Conversation
This was referenced Aug 26, 2026
Closed
Closed
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
2 tasks
This was referenced Aug 28, 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.
Thinking Path
The issue frames this as one wrong prefix. It is not a style choice which spelling is
real, so I established it empirically before editing either side.
agent_config(underscore) is the served path. Four independent sources agree:autobot-frontend/src/types/generated/api.ts— 11 paths under/api/agent_config/, 0 under/api/agent-config/app.openapi()by the requiredverify-generated-types)libs/autobot-sdk-python/autobot_sdk/resources/agents.py:37,44,48calls/agent_config/agents/...repo_tests/sdk_request_url_test.py:149-156pins/api/agent_config/.../api/agent-config/returning404 - Endpoint not foundSo the mount is right and the registry entry is what is wrong. Changing the mount would
have broken the SDK, the generated types and two test files.
There is also no repo-wide convention to follow: the mounts use both spellings
(
agent_config,intelligent_agentunderscore;research-browser,service-monitor,system-validationhyphen). That is a second reason not to touch mounts — only to makethe registry report reality.
Writing the guard then showed the defect is ten of thirty-one entries, not one:
six advertise a prefix nothing serves, and four name a module a consolidation deleted.
The worst was
api.service_monitor, advertising/api/monitoring— a real prefixbelonging to
api.monitoring, so a reader following the registry landed on a livenamespace serving something else.
And the harm the issue predicted had already happened inside the backend:
middleware/llm_awareness_middleware.py:65had copied the hyphen into itsenable_for_pathsdefault._should_inject_contextis astartswithover that list,so awareness context was never injected for a router the middleware names
explicitly, silently, since the paths diverged. That is fixed here because it is the
same defect's direct consequence, not a separate concern.
On the
#15112dependency: not needed. That PR'seffective_routestraversalanswers a runtime question. Both tables here are source-level data, so the guard reads
them through
autobot_shared/api_routing/router_prefixes.py— the single grammar#12985established, already merged and already relied on by the blockingapi-wiringgate. No new traversal is written and none of
#15112's files are touched, so thetwo PRs cannot conflict and neither blocks the other. This also sidesteps the
fastapi-version hazard entirely: nothing here introspects a FastAPI object, so local and
CI resolutions cannot disagree.
What Changed
autobot-backend/api/registry.py— six prefixes corrected to the mounted path:agent_config/api/agent-config/api/agent_configintelligent_agent/api/intelligent-agent/api/intelligent_agentresearch_browser/api/research/api/research-browserservice_monitor/api/monitoring/api/service-monitorsystem_validation/api/system_validation/api/system-validationwebsockets""/api…and four
module_paths repointed to the module that carries the router today, eachverified against the mount tuples rather than guessed:
batchapi.batchapi.batch_jobs#1287; prefix also corrected to/api/batch-jobscacheapi.cacheapi.cache_management#1286chat_consolidatedapi.chat_consolidatedapi.chatapi.chatmounts at the same/apiinfrastructure_monitorapi.infrastructure_monitorapi.infrastructure/api/infrastructureDict keys and
name=fields are deliberately left alone: they are path-parameter valuesfor
GET /api/registry/router/{router_name}, and none of them is a claim about routing.autobot-backend/middleware/llm_awareness_middleware.py—enable_for_pathsdefault/api/intelligent-agent→/api/intelligent_agent.initialization/middleware.py:151docstring likewise.
New guard
repo_tests/registry_prefix_agreement_test.py(6 tests) — threenon-vacuity tests over the enumerations, then: every advertised module exists, every
advertised prefix is a mounted prefix, every advertised router is one the app factory
mounts. Both sides resolve to files through
resolve_registry_targets, so a packageentry (
api.user_management) lines up with a mount of its submodule(
api.user_management.router).New test
autobot-backend/middleware/llm_awareness_paths_test.py(8 tests) — servedpaths must reach the middleware, and paths nothing answers on must not (the contrast, so
a list holding both spellings would not pass).
Verification
All evidence is against the final head,
071b9da6c.registry_prefix_agreement_test.py6 passedllm_awareness_paths_test.py8 passedtypes/generated/api.tsuntouchedverify-generated-types)Contrast mutations, each run against the final head and reverted:
prefix="/api/agent-config"→AssertionError: api/registry.py advertises prefixes the app does not serve:api/agent_config.py: advertised ['/api/agent-config'] but mounted at ['/api/agent_config']module_path="api.batch"→AssertionError: api/registry.py names modules that do not exist: api.batch (advertised at '/api/batch-jobs')AssertionError: only 0 RouterConfig entries parsed out of registry.py; the agreement assertions below would range over almost nothingand
AssertionError: only 0 files are named by both tables (0 advertised, 290 mounted)enable_for_paths→AssertionError: /api/intelligent_agent/process is mounted and serves POST, but the awareness filter skips it; enable_for_paths=['/api/chat', '/api/llm', '/api/intelligent-agent', '/api/workflow']Shards (
repo_tests/stable_shard.py,--shard-splits 12):repo_tests/registry_prefix_agreement_test.py→ shard 10;autobot-backend/middleware/llm_awareness_paths_test.py→ shard 4.Not proven here:
agents/multi_agent_workflow_validation_test.py:121probes/api/intelligent-agent/deployand/api/research/deploy— both copied from the staleregistry values, and neither endpoint exists under any spelling (the router serves
/process,/system-info,/reload). That is a script probing endpoints that werenever built, a different defect from a misspelled prefix, so it is filed separately
rather than guessed at here.
Model Used
Claude Opus 5 (1M context)
Closes #15120