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-22: none.
Tool: none found.
Reason: Searches found OpenAPI-to-CLI generators (Restish, smtpfast-cli) that map routes to commands in a generated CLI, but none renames commands, dry-run plans, MCP rows and tests inside this hand-written Typer CLI.
Lacks:
- Rename existing commands inside a hand-written Typer CLI
- Dry-run plans that print the exact HTTP request path
- Update MCP exposure table, generated docs and name test
Proposed design
Problem statement
Do not start until a person breaks the dependency cycle #5236 → #5234 → #5232 → #5228 → #5236 and #5234 merges. The AI commands do not take the names of the HTTP routes that they call. ADR 0026 and #5223 require one command word for each route word. This change renames ai gateway routes to ai gateway model info, folds ai preload into ai prewarm, removes ai rag search, corrects the ai rag query dry-run route, and updates the MCP row, name test and generated documents.
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 reads both health routes
The devops ai gateway status command SHALL keep its name and SHALL send GET /health/readiness then GET /health when the first route fails.
Scenario: Status reads both health routes
- WHEN A test runs
devops ai gateway statuswith a fake gateway client that returns 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 set to -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 for collection c 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
The alternatives check of 2026-11-22 in the issue body is the source; it names no tool. No open, maintained tool covers the need, because the change renames commands inside this hand-written Typer CLI. The proposal edits the Typer command modules, the plan strings in ai_plans.py, the MCP exposure table, the name test and the generated documents. It adds no dependency and builds no library. Cost: about 2 hours of elapsed work and an estimated 100,000 tokens to make the rename, its tests and the regenerated documents.
Key questions
- Which command name replaces
ai gateway routesfor the LiteLLM routeGET /model/info?: Rename it toai gateway model info. The route holds the two wordsmodelandinfo, and the rule of feat(cli): tool commands pass unknown arguments to the tool #5223 gives one command word for each route word. (best practice) [sources: src/devops_cli/ai/gateway.py, src/devops_cli/config/constants.py:306, src/devops_cli/commands/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/readinessand thenGET /healthwhen the first route fails. The command reads two routes, so it is a composite with a project verb. The code holds no route that uses the wordstatuswith another meaning. (best practice) [sources: src/devops_cli/ai/gateway.py:469, tests/ai/mcp/test_ai_gateway.py]- Chosen: Keep
ai gateway statuswith both reads. It names the composite command and keeps the/healthfallback that the code makes. - Rejected: Rename to
ai gateway health readiness. It names one route and hides the second read. - Rejected: Rename to
ai gateway health. It does not show that the command reads two health routes.
- Chosen: Keep
- Should
ai preloadfold intoai prewarm?: Foldai preloadintoai prewarm. Both sendPOST /api/generatewithkeep_alive, andprewarm --keep-alive -1gives the old behavior ofpreload.prewarmsends one request to each Ollama server, so it is a composite, and Ollama has no routeprewarm. (best practice) [sources: src/devops_cli/ai/ai_plans.py, src/devops_cli/commands/ai.py]- Chosen: Fold
preloadintoai prewarm. One command sends the same route and keeps thekeep_alivefield. - Rejected: Keep
preloadandprewarm. Two commands send the samePOST /api/generaterequest. - Rejected: Rename
preloadtogenerate. It duplicatesprewarm, which already sendsPOST /api/generateto each server.
- Chosen: Fold
- 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 and 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 searchas an alias. Two command names for one Qdrant route break the route-name rule. - Rejected: Rename
querytosearch. The code callsquery_pointsatpoints/query, notpoints/search.
- Chosen: Remove
- How do the MCP exposure table, the API name test and the generated documents follow the rename?: Change the
CONST_MCP_EXPOSURE_TABLErow fromai gateway routestoai gateway model info. Addai gatewayto the groups oftests/commands/test_api_command_names.py. Regenerate the command reference and the MCP documents, and rundevops docs check. (best practice) [sources: src/devops_cli/config/constants.py:306, src/devops_cli/ai/mcp/generator.py, tests/ai/mcp/test_mcp_exposure_table.py, docs/CLI_REFERENCE.md]- 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
The item is in a dependency cycle #5236 → #5234 → #5232 → #5228 → #5236; a person must remove one edge before work starts.
The item is in a dependency cycle: #5236 → #5234 → #5232 → #5231 → #5230 → #5229 → #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