Repository navigation
Description
Problem or Motivation
The owner asked on 2026-11-12 that a devops command on an HTTP API take its names from the API routes (ADR 0026, #5223). Sources: commands/ai_gateway.py, ai/gateway.py, commands/ai.py, commands/rag.py and ai/ai_plans.py.
| devops command | Route |
|---|---|
ai gateway routes |
GET /model/info |
ai preload and ai prewarm |
Both send POST /api/generate with keep_alive to each Ollama server. |
ai rag query and ai rag search |
One command at two paths. The dry-run plan names points/search, but the code calls query_points (POST /collections/{c}/points/query). |
ai gateway status |
GET /health/readiness, then GET /health. It reads two routes. |
Agents use the MCP tools ai_gateway_status and ai_gateway_routes. Loki holds no usage error for this group in the 7 days to 2026-11-12.
Proposed Solution & Architectural Design
- Rename
ai gateway routestoai gateway model info, from the LiteLLM route/model/info. The two segments give two words. The MCP description ofai_gateway_model_infostarts withdevops ai gateway model info(feat(cli): tool commands pass unknown arguments to the tool #5223). ai gateway statusreads two routes, so it is a composite with a project verb, and its name stays. Premise check: confirm in the LiteLLM proxy reference that no route uses the wordstatuswith another meaning. Record also if the second read ofGET /health, which calls each model deployment, stays. If it goes, the command reads one route and becomesai gateway health readiness.- Fold
ai preloadintoai prewarm, which has--keep-alivefor the route fieldkeep_alive. The oldpreloadisprewarm --keep-alive -1on all servers.prewarmsends one request to each server, so it is a composite, and Ollama has no routeprewarm. - Remove
ai rag search, the second path ofai rag query. Correct the plan route toPOST /collections/{c}/points/query.ai rag queryembeds the text and then queries Qdrant, so it is a composite. The Qdrant route wordqueryhas the same meaning, so it stays. - Change the MCP row
ai gateway routes. - Add
ai gatewayto the groups oftests/commands/test_api_command_names.py.
Target Subsystem
AI (devops ai gateway, devops ai rag, devops ai prewarm).
Existing Tool Considered
The LiteLLM proxy, Ollama and Qdrant API references give the names. Nothing is built.
Acceptance Criteria
devops ai gateway model info --dry-runprintsGET /model/infoand sends 0 requests.devops ai rag query --dry-runprintsPOST /collections/<c>/points/query.devops ai gateway routes,devops ai preloadanddevops ai rag searchexit 2.tests/commands/test_api_command_names.pypasses forai gateway.devops docs checkpasses.
Dependencies
Open the pull request after the pull request of #5234 merges (generated command reference, CONST_MCP_EXPOSURE_TABLE, the API name test).
Source: #5223
Alternatives check of 2026-11-28: none.
Tool: none found.
Reason: Searches found only OpenAPI code generators, which emit clients or server stubs from a spec and cannot rename this project's hand-written Typer commands, plan strings, MCP table and tests; the issue needs an internal edit, not a dependency.
Covers:
- Generates typed HTTP clients and server stubs from an OpenAPI document
- Many target languages and generator templates
- Reads route paths and operation names from a spec
Lacks:
- No rename of existing hand-written Typer subcommands
- No edit of dry-run plan strings or the MCP exposure table
- Replaces the command tree instead of aligning its names with routes
Proposed design
Problem statement
Do not start this work until a person breaks the dependency cycle. The AI commands do not take their names from the HTTP routes that they call. This change renames ai gateway routes to ai gateway model info, folds ai preload into ai prewarm --keep-alive -1, removes ai rag search, corrects the ai rag query dry-run route, and updates the MCP row, the API name test and the generated documents. It waits on #5234.
Acceptance criteria
Requirement: Gateway model info dry run
The devops ai gateway model info command SHALL print GET /model/info in its dry-run plan and SHALL send no request.
Scenario: Dry run of model info
- WHEN A test runs
devops ai gateway model info --dry-runwith a fake gateway client. - THEN The output holds
GET /model/infoand the fake client records 0 requests.
Requirement: Gateway status keeps both health reads
The devops ai gateway status command SHALL keep its name and SHALL send GET /health/readiness and then GET /health when the first route fails.
Scenario: Status falls back to health
- WHEN A test runs
devops ai gateway statuswith a fake gateway client that answers 503 for/health/readinessand 200 for/health. - THEN The fake client records a
GET /health/readinessrequest and then aGET /healthrequest.
Requirement: Prewarm keep alive
The devops ai prewarm command SHALL accept --keep-alive -1 and SHALL send POST /api/generate with keep_alive -1 to each Ollama server.
Scenario: Preload behavior through prewarm
- WHEN A test runs
devops ai prewarm --keep-alive -1with two fake Ollama servers. - THEN Each fake server receives one
POST /api/generaterequest withkeep_alive-1.
Requirement: RAG query dry run route
The devops ai rag query command SHALL print POST /collections/<c>/points/query in its dry-run plan and SHALL send no request.
Scenario: Dry run of RAG query
- WHEN A test runs
devops ai rag query --dry-runfor collectionc. - THEN The output holds
POST /collections/c/points/queryand the fake client records 0 requests.
Requirement: Old AI command names exit 2
The commands ai gateway routes, ai preload and ai rag search SHALL exit with code 2.
Scenario: Old command names are absent
- WHEN A test invokes
devops ai gateway routes,devops ai preloadanddevops ai rag searchwith no option. - THEN Each invocation exits with code 2.
Requirement: MCP exposure row follows the rename
The MCP exposure table SHALL name the path ai gateway model info in place of ai gateway routes, so the server publishes the tool ai_gateway_model_info.
Scenario: Exposure table holds the new row
- WHEN A developer runs
uv run pytest tests/ai/mcp/test_mcp_exposure_table.py. - THEN The test passes, each exposed path resolves to a command of the tree, and the server holds the tool
ai_gateway_model_info.
Requirement: API command name test group
The API command name test SHALL include ai gateway in its groups and SHALL pass.
Scenario: API command name test for gateway
- WHEN A developer runs
uv run pytest tests/commands/test_api_command_names.py. - THEN The test passes and its group list holds
ai gateway.
Requirement: Documentation check
The generated command reference and the MCP documents SHALL match the renamed commands.
Scenario: Documentation check after the rename
- WHEN A developer runs
uv run devops docs check. - THEN The command exits 0 and reports no stale generated document.
Existing Tool Considered
No open, maintained tool covers the need. The alternatives check of 2026-11-28 in the issue body gives the verdict none and names no tool. The check found only OpenAPI code generators, which cannot rename this project's hand-written Typer commands, dry-run plan strings, MCP exposure table or tests. The change makes internal edits with no new dependency. Cost: about 2 hours elapsed and about 100,000 tokens.
Key questions
- Which command name replaces
ai gateway routesfor the LiteLLM routeGET /model/info?: Useai gateway model info. The route holds the wordsmodelandinfo, and the command uses one word for each route word in route order. (best practice) [sources: src/devops_cli/commands/ai_gateway.py, src/devops_cli/ai/gateway.py]- Chosen: ai gateway model info. It uses the two words of
GET /model/infoin route order. - Rejected: ai gateway routes. It names no route word and keeps the old name.
- Rejected: ai gateway model-info. It joins two route words into one segment and adds a punctuation mark.
- Chosen: ai gateway model info. It uses the two words of
- Does
ai gateway statuskeep its name and both health reads?: Keep the name and both reads._probe_gateway_httpsendsGET /health/readiness, thenGET /healthwhen the first route fails. The command reads two routes, so it is a composite with a project verb. (best practice) [sources: src/devops_cli/ai/gateway.py:466, src/devops_cli/commands/ai_gateway.py]- Chosen: Keep ai gateway status with both reads. It names the composite command and keeps the
/healthfallback that the code makes. - Rejected: ai gateway health readiness. It names one route and hides the second read.
- Rejected: ai gateway health. It does not show that the command reads two health routes.
- Chosen: Keep ai gateway status with both reads. It names the composite command and keeps the
- Should
ai preloadfold intoai prewarm?: Fold it. Both sendPOST /api/generatewithkeep_alive, andprewarm --keep-alive -1gives the old behavior ofpreload.prewarmsends one request to each server, so it is a composite, and Ollama has no routeprewarm. (best practice) [sources: src/devops_cli/commands/ai.py, src/devops_cli/ai/ai_plans.py]- Chosen: Fold preload into ai prewarm. One command sends the same route and keeps the
keep_alivefield. - Rejected: Keep preload and prewarm. Two commands send the same
POST /api/generaterequest. - Rejected: Rename preload to generate. It duplicates
prewarm, which already sendsPOST /api/generateto each server.
- Chosen: Fold preload into ai prewarm. One command sends the same route and keeps the
- Should
ai rag searchstay, and which route does theai rag queryplan name?: Removeai rag searchand keep oneai rag query. The plan must namePOST /collections/{collection}/points/query, because the code callsquery_pointsand notpoints/search. The command embeds the text, then queries Qdrant, so it is a composite, and the route wordquerystays. (best practice) [sources: src/devops_cli/commands/rag.py, src/devops_cli/ai/ai_plans.py]- Chosen: Remove ai rag search. One command has one route, and the second name hides that both paths call the same query.
- Rejected: Keep ai rag search as an alias. Two command names for one Qdrant route break the route-name rule.
- Rejected: Rename query to search. The code calls
query_pointsatpoints/query, notpoints/search.
- How do the MCP exposure table, the API name test and the generated documents follow the rename?: Change the
CONST_MCP_EXPOSURE_TABLErow toai gateway model info. Addai gatewayto the groups of the API name test that feat(vault): vault commands take the Vault API route names #5234 lands. Regenerate the command reference and the MCP documents, then runuv run devops docs check. (best practice) [sources: src/devops_cli/config/constants.py:309, src/devops_cli/ai/mcp/generator.py, tests/ai/mcp/test_mcp_exposure_table.py, tests/commands/test_api_command_names.py]- Chosen: Update the table, the test and the documents. The tool name and the command name stay equal, and the API name test covers the new group.
- Rejected: Keep the old table row. The MCP tool would name a command that exits 2, and the exposure test would fail.
- Rejected: Update the table only. The API name test would not cover
ai gateway.
Fit
Fits in one pull request.
Suspected block
A person must break the dependency cycle #5236 → #5234 → #5232 → #5228 → #5236 before work starts.
The item is in a dependency cycle: #5236 → #5234 → #5232 → #5228 → #5236. A person removes one edge of the cycle, so that its items no longer wait on each other.
Activity
dan-petty commentedon Nov 12, 2026
Both work on the ai gateway commands, but #2241 adds dry-run request plans while the candidate renames and folds the commands to match API routes.devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at 4d085f1 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
fix(roadmap): Keep blockers that a sentence opens with other words (#…
fix(roadmap): an open tracker holds back no item (#6548)
devops-cli-service commentedon Nov 21, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 21, 2026
One more plan of the same family names a request that the command does not make, found on 2026-11-21 (main 11fee3f):
devops ai rag clear --dry-runprintsDELETE /collections/devops-codeandDELETE /collections/devops-docs. The real run deletes the configured collections fromresolve_rag_components()(src/devops_cli/commands/rag.py:602-608), which aredevops_codeanddevops_docson this workstation (devops ai rag status).plan_ai_rag_clearand the other rag plans insrc/devops_cli/ai/ai_plans.py(lines 434, 454, 467, 505, 526 and 553) hard-codedevops-codeanddevops-docsin place of the configured names.devops-cli-service commentedon Nov 22, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 22, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (3)
Searches run:
Sources:
devops-cli-service commentedon Nov 23, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 26, 2026
Owner question: See Suspected block in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence