Repository navigation
Closed
Labels
priority/p2-mediumPriority P2: standard workscope/aiAI review pipeline, personas, prompts, LLM client, or RAGscope/configSettings, OS Keyring, environment variables, and defaultstype/bugType bug: the code does not do what it must
Description
Problem
ai.tasks.metadata is declared, documented and settable from the environment, but no code reads it. Lines are at release/v0.2.25 (e3ff98c).
- Declared.
AITasksConfig.metadata(src/devops_cli/config/settings.py:415). The option keys are atconfig/options.py:36-39, and four environment variables atconfig/env.py:40-43, registered at:129-132and:377-392.docs/ENV_VARS.md:30-32lists them as "AI model override for metadata task". - Never read. The only
for_taskcalls nameanalysis,verification,compose,chatandembedding:ai/review/runner.py:1589-1612,ai/run_store.py:149-150,commands/ai.py:1028,:1206,ai/rag/embeddings.py:278andcommands/ai_gateway.py:430.get_llm_client(task)(settings.py:1086-1093) has one caller, with no task (ai/harness/workflow.py:498). - The commands it fits use the global settings instead.
devops analyze path|branch|pr --enhancedasks a model for each file's metadata (ai/analyze/outlines.py:119,:311). It saves that metadata underdata.analysis_dir, documented as the "Storage directory for pre-analysis metadata JSON files" (docs/ENV_VARS.md:44). It builds its client fromsettings.ai(commands/analyze.py:311,:400,:495).devops ai agentsgenerates AGENTS.md, CLAUDE.md and copilot-instructions.md from the repository, also withsettings.ai(commands/ai.py:877).
- The review's own pre-analysis makes no model call (
ai/review/pipeline.py:931-938passesai_client=None), so it is not a consumer. - People set it anyway. The owner's
config.yamlsetsai.tasks.metadata(providergateway, modeldevops-chat,context_window: 61440), and none of it is read. It matches the global model today, so only the context window differs.
As a result, the slow-tier plan cannot route these two batch commands to the background tier from config.yaml without moving everything else that reads the global ai.model. A setting that silently does nothing is also a pre-1.0 leftover.
Source: .data/slow-tier-plan-20261003.md, section 4 (analyze --enhanced and ai agents), re-read at e3ff98c.
Acceptance criteria
-
devops analyze path,branchandprwith--enhancedbuild their client fromsettings.ai.for_task("metadata")(commands/analyze.py:311,:400,:495). -
devops ai agentsbuilds its client fromsettings.ai.for_task("metadata")(commands/ai.py:877). - With
ai.tasks.metadataunset, both use the globalaisettings as today. A test pins that. - A test sets
DEVOPS_CLI_AI_TASK_METADATA_MODEL=devops-backgroundand runsdevops analyze path <tmp> --enhancedanddevops ai agentswithLLMClientpatched to record its config. Both recorddevops-background. The test fails on the current code. - The descriptions at
config/env.py:377-392(and sodocs/ENV_VARS.md:30-32) name the commands: "foranalyze --enhancedandai agents". - The tests run offline, call no model, and each runs in under 1 s.
-
uv run devops cipasses.
Key questions
- Wire the setting, or delete it? (proposed) Wire it. The code already has the setting, its four environment variables, its options and its docs. The name fits what
analyze --enhancedwrites: per-file metadata into the analysis directory. Wiring it is three call sites inanalyze.pyand one inai.py. Deleting it would leave the globalai.modelas the only way to move these batch commands, and that also movesai pipeline, the pydantic-ai bridge and every othersettings.aireader. - Is
ai agentsa metadata task? (proposed) Yes, for routing. Likeanalyze --enhanced, it is a batch job that describes the repository, and the slow-tier plan routes both to the background tier. Leaving it on the global settings would need a second task slot for one command. - Does
DEVOPS_CLI_AI_TASK_METADATA_REASONING_EFFORTneed a docs row? (proposed) Not here. It is registered atenv.py:42and:131, but not in the docs table. The generated docs are fix(docs): generated docs mask non-secret defaults and hide off flags, and docs name things that do not exist #956's. - Is this P1? (proposed) No, P2. Nothing breaks today, and
DEVOPS_CLI_AI_MODEL=devops-backgroundalready routes one run.
Depends on: none.
Order: #840 (v0.2.27) changes devops ai agents so it never overwrites AGENTS.md, in commands/ai.py. #1000 makes the settings field the one declaration of its env name and description. Whichever lands second rebases.
Related:
- fix(k8s): every ollama tier keeps one model loaded and serves one request at a time, so its kv cache holds one context #1061 and its follow-up fix(k8s): ollama-48gib-slow keeps its embedding model and qwen3-coder loaded and leaves every interactive pool, so a review no longer evicts the embedder #1064: the
devops-backgroundtier. - fix(docs): generated docs mask non-secret defaults and hide off flags, and docs name things that do not exist #956: generated docs.
- refactor(config): a settings field is the one declaration, and the option, env and config-show registries become views of it #1000: one declaration per setting.
- docs(agents): instruction surfaces state only what is true, and
devops ai agentsnever overwrites AGENTS.md #840:ai agentsand AGENTS.md.
Metadata
Metadata
Assignees
Labels
priority/p2-mediumPriority P2: standard workscope/aiAI review pipeline, personas, prompts, LLM client, or RAGscope/configSettings, OS Keyring, environment variables, and defaultstype/bugType bug: the code does not do what it must
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 8, 2026
Linked: #1001, whose one client factory replaces these four constructions (
commands/analyze.py:312,:401,:489,commands/ai.py:864); whichever lands second keeps themetadatatask. Found by the 2026-10-08 backlog review.chore(main): release 0.4.0 (#1960)