Repository navigation
Description
Problem
The baseline of the stage eval (#3566) runs with a context window of 131072 tokens for each run. It sets the window with the variable DEVOPS_CLI_AI_TASK_STAGE_CONTEXT_WINDOW. The issue #3566 names this variable, but it does not exist.
Facts, checked on 2026-11-09:
_TASK_VARIABLESinsrc/devops_cli/config/settings.pyholds onlyprovider,model,reasoning_effortandollama_urls.docs/ENV_VARS.mdlists noCONTEXT_WINDOWorMAX_TOKENSvariable for a task.- With
DEVOPS_CLI_AI_TASK_STAGE_CONTEXT_WINDOW=131072set,load_settings().ai.for_task('stage').context_windowreturns262144. The variable has no effect and raises no error. - The task
verificationhas noVariable(fields=...)marker, so it has no variable at all. - The fields
context_windowandmax_tokensexist onAITaskOverride, soai.tasks.<task>.context_windowworks inconfig.yamlalready. Only the environment variable is missing.
Without the variable, a baseline run must edit the live config, and #3566 decided that the deployed value stays (a live change of the stage window is a separate decision).
Expected
DEVOPS_CLI_AI_TASK_<TASK>_CONTEXT_WINDOWworks for the tasksstage,analysisandverification.DEVOPS_CLI_AI_TASK_<TASK>_MAX_TOKENSworks for the same tasks.docs/ENV_VARS.mdlists them. The generator writes the file:uv run devops docs generate.- The variables are optional. A deployed config that does not set them keeps its values. The
Settingsmodels ignore unknown keys, butAITasksConfigandAITaskOverrideuseextra="forbid". This change adds a variable and removes no key, so the live ConfigMap needs no change first (see the go-live check ink8s/README.md).
Acceptance criteria
-
DEVOPS_CLI_AI_TASK_STAGE_CONTEXT_WINDOW=131072 uv run python -c "from devops_cli.config.settings import load_settings; assert load_settings().ai.for_task('stage').context_window == 131072"passes. It fails today: the value is 262144. - The same check passes for
analysisandverification, and forMAX_TOKENS. It fails today. -
uv run pytest tests/config/test_ai_task_settings_paths.py -k context_windowpasses. The test sets each variable and readsfor_task(task). It fails today: the test does not exist. -
git grep -n "AI_TASK_STAGE_CONTEXT_WINDOW" -- docs/ENV_VARS.mdfinds the variable. It fails today. -
uv run devops docs generateleaves no diff indocs/ENV_VARS.md, anduv run pytest tests/test_config_declarations.pypasses with the new variables in its set.
Existing tool considered
The Variable marker and the generator of src/devops_cli/config/env.py already declare a variable. This change adds two names to _TASK_VARIABLES and one Variable marker for verification. It adds no new code path and no new library.
Cost
- Tokens to build: low. About 2 lines of code, 1 generated doc, 1 test.
- Tokens to keep: none. The generator keeps the doc.
- Tokens to fix: low.
- Elapsed time: about 30 minutes. Without it, the baseline of test(roadmap): run the cloud baseline of the stage eval #3566 cannot run with its own window.
Related
- test(roadmap): run the cloud baseline of the stage eval #3566 (cloud baseline of the stage eval, which names the variable).
- feat(roadmap): set the stage planner caps from a week of cut data #4218 (stage planner caps; its eval run needs a window per run).
Proposed design
Problem statement
The variable DEVOPS_CLI_AI_TASK_STAGE_CONTEXT_WINDOW does not exist. The setting is silently ignored and for_task('stage').context_window stays 262144. The stage eval baseline of #3566 needs a window of 131072 for each run without a change to the live config. The task verification has no environment variable at all. The fields context_window and max_tokens already exist on AITaskOverride, so only the variable declarations are missing.
Acceptance criteria
Requirement: Stage context window variable
The settings loader SHALL read DEVOPS_CLI_AI_TASK_STAGE_CONTEXT_WINDOW into ai.tasks.stage.context_window.
Scenario: Stage window set by variable
- WHEN The variable DEVOPS_CLI_AI_TASK_STAGE_CONTEXT_WINDOW is 131072 and load_settings() runs.
- THEN load_settings().ai.for_task('stage').context_window equals 131072.
Requirement: Window variables for analysis and verification
The settings loader SHALL read DEVOPS_CLI_AI_TASK_ANALYSIS_CONTEXT_WINDOW and DEVOPS_CLI_AI_TASK_VERIFICATION_CONTEXT_WINDOW into the context window of their tasks.
Scenario: Analysis and verification windows set by variable
- WHEN Each of the two variables is 131072 and load_settings() runs.
- THEN for_task('analysis').context_window and for_task('verification').context_window both equal 131072.
Requirement: Max tokens variables
The settings loader SHALL read DEVOPS_CLI_AI_TASK_<TASK>_MAX_TOKENS into the max tokens of the tasks stage, analysis and verification.
Scenario: Max tokens set by variable
- WHEN DEVOPS_CLI_AI_TASK_STAGE_MAX_TOKENS is 4096 and the same variable is set for analysis and verification.
- THEN for_task(task).max_tokens equals 4096 for each of the three tasks.
Requirement: Unset variables keep values
The settings loader SHALL keep the current values of the window and max tokens when no new variable is set.
Scenario: No new variable
- WHEN None of the new variables is set and load_settings() runs.
- THEN for_task('stage').context_window equals 262144 and for_task('stage').max_tokens is None.
Requirement: Invalid value names its variable
The settings loader MUST refuse a value of a new variable that is not a positive integer and MUST name the variable in the error.
Scenario: Bad window value
- WHEN DEVOPS_CLI_AI_TASK_STAGE_CONTEXT_WINDOW is abc or 0 and load_settings() runs.
- THEN load_settings() raises ConfigurationError whose message contains DEVOPS_CLI_AI_TASK_STAGE_CONTEXT_WINDOW.
Requirement: No variable for other tasks
The change SHALL add the two variables only for the tasks stage, analysis and verification.
Scenario: Chat task has no window variable
- WHEN The set of variable names from setting_variables() is read.
- THEN The set holds no variable of the tasks chat, metadata or embedding that ends with CONTEXT_WINDOW or MAX_TOKENS.
Requirement: Generated docs list the variables
The file docs/ENV_VARS.md SHALL list the six new variables with a non-empty description, as the generator writes it.
Scenario: Docs match generator
- WHEN uv run devops docs generate runs after the change.
- THEN docs/ENV_VARS.md holds the six variable names and the command leaves no diff.
Existing Tool Considered
The Variable marker and the generator in src/devops_cli/config/env.py already declare an environment variable, and pydantic-settings style sources already load it. No outside library is needed. This change adds a tuple of field names, one Variable marker for verification, and two field descriptions. The cost is low: about 10 lines of code, 1 generated doc and 1 test, about 30 minutes, and no upkeep because the generator keeps the doc.
Key questions
- Which tasks and fields does the change add as variables?: The fields context_window and max_tokens for the tasks stage, analysis and verification, as the issue states. Both fields already exist on AITaskOverride, so config.yaml works already and only the variables are missing. [sources: src/devops_cli/config/settings.py, src/devops_cli/config/env.py, docs/ENV_VARS.md]
- How does the change declare the new variables without adding them to the chat, metadata and embedding tasks?: Add a new tuple next to _TASK_VARIABLES that holds the four existing fields plus context_window and max_tokens. Use it for analysis and stage. Give verification a Variable marker with only context_window and max_tokens. Leave chat, metadata and embedding on _TASK_VARIABLES. (best practice) [sources: src/devops_cli/config/settings.py, src/devops_cli/config/env.py]
- Chosen: New tuple for analysis and stage, and a marker with two fields for verification. It matches the scope of the issue and adds no variable that nobody asked for.
- Rejected: Add the two fields to _TASK_VARIABLES. It also adds variables for chat, metadata and embedding, which the issue does not ask for and which grow the docs and the test set.
- Rejected: Give verification the full field set. It adds provider, model and other variables for verification that the issue does not need.
- Does the generated doc show a description for the new variables?: The generator reads the description of the field. The fields context_window and max_tokens of AITaskOverride have none today. The change adds a short description to both, in the style of the existing fields, so the doc rows are not empty. (best practice) [sources: src/devops_cli/config/settings.py, src/devops_cli/config/env.py]
- Chosen: Add Field descriptions to the two fields of AITaskOverride. The generator takes the description from the field, so one edit serves the doc and the config help.
- Rejected: Leave the descriptions empty. The doc rows would be empty and would not tell a person what the variable does.
- Does the live ConfigMap need a change before this change rolls out?: No. The change adds variables and removes no key. The models AITasksConfig and AITaskOverride keep extra forbid, but no key of config.yaml changes. The variables are optional, so a deployed config keeps its values. [sources: src/devops_cli/config/settings.py, k8s/README.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 9, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(config)scope of the title gives the scope.It is a prerequisite for the baseline eval in #3566 but does not block production or cause a failure today.It lets a baseline run set its own window without editing the live config, which #3566 and #4218 both need.The body states about 2 lines of code, 1 generated doc, and 1 test, roughly 30 minutes.Both concern the stage eval context window, but #3566 runs the baseline eval while the candidate adds the env variable that #3566 needs to set the window per run.devops-cli-service commentedon Nov 9, 2026
Status set to Ready at 111adc5 (see proposed design in issue body).
devops-cli-service commentedon Nov 9, 2026
Released in v0.101.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.101.0
devops-cli-service commentedon Nov 9, 2026
Live since 2026-11-09 15:38 UTC