Skip to content

chore(k8s): keep the model call concurrency in the ConfigMap template #4870

Open

Description

@dan-petty

Problem or Motivation

devops k8s deploy-stack renders the ConfigMap devops-cli-config from k8s/devops/configmap.example.yaml and the active config. A live value of service.model_call_concurrency that only the ConfigMap holds goes back to 1 at the next deploy-stack run.

Proposed Solution & Architectural Design

After the 24 h check of the live change passes, set service.model_call_concurrency: 2 in k8s/devops/configmap.example.yaml and state the reason and the check in k8s/README.md.

Target Subsystem

Kubernetes manifests (k8s/devops/configmap.example.yaml) and k8s/README.md.

Existing Tool Considered

The ConfigMap template that devops k8s deploy-stack renders. No code. Cost to build: about 50,000 tokens, 30 minutes.

Acceptance Criteria

  • The rendered ConfigMap of deploy-stack holds model_call_concurrency 2.
  • k8s/README.md states the value, the check and the revert rule.

Dependencies

The live change service.model_call_concurrency: 2 passes its 24 hour check (gateway refusals at or below 1% of calls).

Related: #4446 puts ai.decision_model in the same template.

Source: #4843

Alternatives check of 2026-11-14: not-applicable.
Class: chore, no search.
Tool: none found.

Proposed design

Problem statement

A live service.model_call_concurrency: 2 in ConfigMap devops-cli-config returns to 1 at the next devops k8s deploy-stack run. The renderer replaces the whole service section with _service_block, so a template value never reaches the cluster today. The change keeps the template's service settings in the render. It copies service.model_call_concurrency from the active config when a source sets it. It sets service.model_call_concurrency: 2 in the template. It states the value, the 24 hour gateway-refusal check and the revert rule in k8s/README.md. The work waits for the live 24 hour check.

Acceptance criteria

Requirement: The render keeps the template service settings

src/devops_cli/k8s/configmap.py SHALL keep every setting of the template's service section that the active config does not supply, so a value in k8s/devops/configmap.example.yaml reaches the rendered ConfigMap.

Scenario: A template service setting survives the render

  • WHEN A test renders a template whose service block sets model_call_concurrency: 2 with an active config that sets no such key.
  • THEN uv run pytest tests/k8s/test_k8s_configmap.py -q passes and the rendered service block holds model_call_concurrency: 2.

Requirement: The active config overrides the template value

src/devops_cli/k8s/configmap.py SHALL copy service.model_call_concurrency from the active settings into the rendered service section when a source sets it, as it copies service.github_requests_per_hour.

Scenario: A live revert to 1 reaches the rendered ConfigMap

  • WHEN A test renders the template with ServiceConfig(model_call_concurrency=1) and reads the service section.
  • THEN uv run pytest tests/k8s/test_k8s_configmap.py -q passes and the rendered service block holds model_call_concurrency: 1.

Requirement: The template sets the model call concurrency

k8s/devops/configmap.example.yaml SHALL set service.model_call_concurrency to 2 under a comment that names the reason and the 24 hour gateway-refusal check.

Scenario: The k8s check accepts the template

  • WHEN A person runs uv run devops ci --check --only k8s on the change.
  • THEN The command exits 0 and the k8s row reports no error for k8s/devops/configmap.example.yaml.

Requirement: The README states the value, the check and the revert rule

k8s/README.md SHALL state in Homelab Values at Deploy Time that service.model_call_concurrency is 2 from the template, the 24 hour check of the gateway refusals at or below 1% and the revert to 1 with devops config set and devops k8s deploy-stack.

Scenario: The docs check accepts the README change

  • WHEN A person runs uv run devops ci --check --only docs on the change.
  • THEN The command exits 0 with the new table row and paragraph of k8s/README.md.

Requirement: Pending a person after the merge

After the merge, a person SHALL run uv run devops k8s deploy-stack --stack devops, and the live ConfigMap MUST hold service.model_call_concurrency: 2.

Scenario: The deployed ConfigMap holds 2

  • WHEN After the merge, a person runs uv run devops k8s deploy-stack --stack devops, then kubectl -n devops get configmap devops-cli-config -o jsonpath='{.data.devops-cli\.yaml}'.
  • THEN The live check prints a service block with model_call_concurrency: 2.

Existing Tool Considered

The alternatives check of 2026-11-14 records not-applicable and names no tool. Its comment says the check makes no search for a chore. devops k8s deploy-stack already renders ConfigMap devops-cli-config with PyYAML (src/devops_cli/k8s/configmap.py). Kustomize or Helm cannot read the active config.yaml. The change edits the renderer, the template and the README. Cost to build, keep and fix: about 3,000 tokens and 30 minutes. It adds no new dependency.

Key questions

  • Where does service.model_call_concurrency go in k8s/devops/configmap.example.yaml?: It goes in the service: block (k8s/devops/configmap.example.yaml), after github_app, as model_call_concurrency: 2. ServiceConfig declares the key as an integer of at least 1 with default 1 (src/devops_cli/config/settings.py:1874). [sources: k8s/devops/configmap.example.yaml, src/devops_cli/config/settings.py:1874, docs/CONFIGURATION.md]
  • Does a service key that only the template sets reach the rendered ConfigMap today?: No. render_devops_configmap_content replaces the whole service section with _service_block (src/devops_cli/k8s/configmap.py:85). That block holds only repos, github_app, poll_interval_seconds and github_requests_per_hour (src/devops_cli/k8s/configmap.py:51). tests/k8s/test_k8s_configmap.py:161 asserts that exact section. A service.model_call_concurrency in the template alone is dropped today. The change must edit the renderer as well as the template. [sources: src/devops_cli/k8s/configmap.py:85, src/devops_cli/k8s/configmap.py:51, tests/k8s/test_k8s_configmap.py:161]
  • How does the template value reach the rendered ConfigMap, and how does a live revert override it?: The render keeps the template's service settings. It updates them with the values that the active config supplies: repos, github_app, poll_interval_seconds, github_requests_per_hour and model_call_concurrency when a source sets it. The template's 2 then reaches the cluster. devops config set service.model_call_concurrency 1 plus deploy-stack overrides it for a revert. (best practice) [sources: src/devops_cli/k8s/configmap.py:85, k8s/README.md]
    • Chosen: Keep the template's service settings and override the homelab values from the active config. The template is the product base for the cluster config (k8s/README.md). A product capacity setting belongs there. The active setting still gives the fast live change and revert that k8s/README.md asks for.
    • Rejected: Copy the value only from the active settings, as fix(service): the ConfigMap carries github_requests_per_hour and the high-request alert follows the limit #2755 did for the budget. The template would still not hold the value the issue names. A checkout whose config.yaml sets no key would run 1.
    • Rejected: Keep the template value and read no active setting. A revert would need a template pull request. The README live-value rule changes the value with devops config set.
  • Which value does the template set?: The template sets 2. The issue's live change under test sets 2. The 24 hour check of the gateway refusals gates it. The Service keeps two model calls in flight. (best practice) [sources: src/devops_cli/config/settings.py:1874, docs/CONFIGURATION.md]
    • Chosen: 2. It is the value of the live change that the 24 hour gateway-refusal check gates.
    • Rejected: 1. The default keeps one call in flight. The live change has no effect after a deploy.
    • Rejected: 4 or more. No measurement supports a higher value. The gateway refusals are the risk.
  • Which revert rule does k8s/README.md state?: When the gateway refuses more than 1% of the calls over 24 hours, run devops config set service.model_call_concurrency 1. Then run devops k8s deploy-stack --stack devops. Write the comment on the issue of the change that the live-value rules ask for. (best practice) [sources: k8s/README.md, src/devops_cli/config/settings.py:1874]
    • Chosen: Revert with devops config set service.model_call_concurrency 1 and deploy-stack when more than 1% of calls are refused over 24 hours. It uses the same measurement and limit as the gate and the live-value rule that k8s/README.md states. The revert needs no template pull request.
    • Rejected: Revert with a pull request that sets the template back to 1. A merge and a deploy are slow in an incident. The README already changes a live value with devops config set.
    • Rejected: Revert on the first refused call. The gateway refuses some calls in normal work. The rule would always fire.
    • Rejected: State no revert rule. The issue asks for a revert rule. A value with no undo is a trap.
  • Which part of k8s/README.md holds the value, the check and the revert rule?: Use the Homelab Values at Deploy Time section. Add a row for service.model_call_concurrency to the table. Add a short paragraph beside the live-value rules. Do not add a new top-level section. (best practice) [sources: k8s/README.md]
    • Chosen: Homelab Values at Deploy Time. It already names ConfigMap devops-cli-config, the deploy-stack rules and the rules for a change of a live value.
    • Rejected: A new top-level section. A new section repeats the deploy and live-value rules that the existing section holds.
    • Rejected: Capacity targets. It holds the performance targets of the cluster. It names no ConfigMap key.
  • How does the repository stop the value from going back to 1?: Add two tests in tests/k8s/test_k8s_configmap.py. One test renders a template with model_call_concurrency: 2 and no active value. The other test renders it with an active 1. The live check in the acceptance criteria reads the deployed ConfigMap after deploy-stack. (best practice) [sources: tests/k8s/test_k8s_configmap.py:161, src/devops_cli/k8s/configmap.py:85]
    • Chosen: Renderer tests in tests/k8s/test_k8s_configmap.py plus the live check after deploy-stack. The render is the code that drops the value. The live check shows the template value in the cluster.
    • Rejected: uv run devops k8s deploy-stack --stack devops --dry-run in the acceptance criterion. The dry run lists the manifests. It prints no ConfigMap content.
    • Rejected: A test that reads the template file only. It passes while the render drops the value.
  • Is the 24 hour check a dependency or a suspected block?: A suspected block. It is a live observation outside the roadmap. No issue delivery settles it. (best practice) [sources: CONTEXT.md]
    • Chosen: Suspected block. The 24 hour check is a live observation. No issue delivery settles it.
    • Rejected: Dependency. No item delivery blocks the change. The check is an observation.

Fit

Fits in one pull request.

Suspected block

The live change service.model_call_concurrency: 2 must pass its 24 hour check: the gateway refuses at or below 1% of calls over 24 hours.

Dependencies

None.

Activity

  1. added
    source/agent
    on Nov 11, 2026
  2. added
    type/chore
    scope/k8s
    status/new
    value/medium
    effort/low
    on Nov 11, 2026
  3. dan-petty commented on Nov 11, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/chore. The chore prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. A live value reverts on every deploy, but the impact is limited to one concurrency setting.
    • Value: Medium. Prevents silent loss of a tuned concurrency value on each deploy-stack run.
    • Effort: Low. One YAML value change and a short README note; the candidate estimates 30 minutes.
    • Related: chore(k8s): put ai.decision_model in the ConfigMap template #4446, which asks for a different change. Both preserve a live value in k8s/devops/configmap.example.yaml so deploy-stack does not revert it, but #4446 sets ai.decision_model while the candidate sets service.model_call_concurrency.
  4. added
    priority/p2-medium
    on Nov 11, 2026
  5. removed
    priority/p2-medium
    on Nov 11, 2026
  6. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. The template drift reverts a tuned live value at each deploy, but the live change must first pass its 24 hour check.
    • Value: Medium. The change keeps the tuned concurrency of 2 after a deploy-stack run and records the reason for operators.
    • Effort: Low. The change edits one value in a YAML template and adds a short README note.
    • Related: chore(k8s): put ai.decision_model in the ConfigMap template #4446, which asks for a different change. Both edit k8s/devops/configmap.example.yaml, but #4446 adds the key ai.decision_model and the candidate sets service.model_call_concurrency.
  7. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: chore. The check makes no search and no model call for an item of this class.

    Tool: none found

    Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.

  8. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Owner question: The live change service.model_call_concurrency: 2 must pass its 24 hour check: the gateway refuses at or below 1% of the calls over 24 hours.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  9. devops-cli-service commented on Nov 20, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  10. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    Contributor

    Owner question: See the first point of Open questions in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  11. devops-cli-service commented on Nov 26, 2026

    @devops-cli-service
    Contributor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agentstatus/newtype/chorevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions