Skip to content

fix(roadmap): scoped updates send requests with no row scope #4522

Closed

Description

@dan-petty

Problem Description

A scoped intake update (an issues webhook delivery) sends its model requests outside a row scope. Thus the AI request, token, spend and answer series of that intake work get row="other", not row="intake". Issue #4475 (pull request #4484) expects each Service series to carry the row whose work sent the request.

run_scoped_update in src/devops_cli/roadmap/run.py calls update.runner(...) with no request_scope(row=update.job). The only row scope is with request_scope(row=row.name) in the round loop. ScopedRoadmap in src/devops_cli/server/service.py wraps the scoped function in request_scope(repo=self.repo) only. _intake_one builds build_intake_model(), and its spend goes through track_request_spend in src/devops_cli/ai/spend/ledger.py, which reads request_labels()["row"].

For the same work, _count_job(delivery.repo, update.lane, update.job, ...) counts the job under row intake. Thus the job counter and the AI series do not agree. The same gap applies to devops_cli_github_requests_total (#2475).

docs/TELEMETRY.md says: "In the Service, the rows intake, refine, retitle, stage and alternatives send model requests". This is not true for the scoped path.

Reproduction Steps

  1. On main at 9b14af0, send a scoped issues.opened delivery through run_scoped_update with a model fake that answers the intake call, and record the OTLP points with the FakeCollector of the otlp test fixture.
  2. Read the row attribute of the devops_cli_ai_tokens_total points.

Expected vs Actual Behavior

Expected: the points carry row="intake", the same row as the job counter of the scoped update.

Actual: the points carry row="other", because no request_scope(row=...) encloses update.runner(...).

Proposed fix

In run_scoped_update, wrap the update.runner(...) call in request_scope(row=update.job) (from devops_cli.github.request_scope, which run.py already imports). Add a test that sends a scoped issues.opened delivery with a model fake and the otlp FakeCollector, and expects row intake on devops_cli_ai_tokens_total. No new library is needed.

Environment Diagnostics

Logs, Traces, or Terminal Output

src/devops_cli/roadmap/run.py:920  outcome = update.runner(   # no request_scope(row=...)
src/devops_cli/roadmap/run.py:1490 with request_scope(row=row.name):   # round loop only
src/devops_cli/server/service.py:633 with request_scope(repo=self.repo):   # repo only
src/devops_cli/ai/spend/ledger.py:1054 "row": request_labels()["row"],

Found in the review of #4484.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 11, 2026
  2. 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/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Metrics show wrong row for scoped intake, affecting observability but not user-facing functionality.
    • Value: Medium. Correct row labels are needed for accurate cost attribution and debugging of scoped intake work.
    • Effort: Low. The fix is one request_scope wrapper plus one test case, no new library needed.
    • Related: fix(roadmap): stage and refine send no answer count or row #4475, which asks for a different change. Both fix missing row labels on AI metrics in the roadmap, but #4475 covers stage/refine/alternatives rows while the candidate covers the scoped intake path.
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 11, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 11, 2026
  5. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-11 14:13 UTC

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/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions