Skip to content

chore(telemetry): measure agent help size after release #6233

Open

Description

@devops-cli-service

Split from #5450.

Problem: The issue asks for a telemetry measurement 7 days after the release. The measurement needs a release that contains #5450 and 7 days of production data. It cannot run in the pull request that delivers #5450. Why deferred: It waits on an outside event, the release and the 7-day window. Acceptance criteria: After 7 days from the release, query devops_cli_help_requests_total for caller=agent per 1,000 commands. Compare the median help bytes of agent callers in the transcripts before and after the release. The median SHALL go down by 1.5 times or more. Record the query and the result in this issue.

Proposed design

Problem statement

Do not implement this issue in a pull request. It is a post-release measurement of the help text that agents receive. It reports the agent help rate per 1,000 commands and compares the median help bytes in the 168 hours before and after the first release that contains #5450. It waits on that release and on 7 days of production data.

Acceptance criteria

Requirement: Agent help rate after the release

The measurement SHALL report the agent help requests per 1,000 commands for the 168 hours after the first release that contains #5450.

Scenario: The per-1,000 rate query returns one row

  • WHEN A person runs uv run devops prometheus query --time <release published_at plus 7 days> '1000 * sum(increase(devops_cli_help_requests_total{caller="agent"}[7d])) / sum(increase(devops_cli_command_total[7d]))'.
  • THEN The command prints one row with the agent help requests per 1,000 commands for the 168 hours from the release, and prints the No results. warning when the counter holds no series.

Requirement: Median help bytes of the two windows

The measurement SHALL compare the median help bytes of agent callers in the 168 hours before and after the release.

Scenario: The two transcript windows give a median and a count

  • WHEN A person runs a jq pipeline over the JSONL files under ~/.claude/projects/<project>/ for this repository and each worktree under .data/agent/worktrees/. The pipeline joins each tool_result to its tool_use command by tool_use_id, keeps the results of commands that invoke devops with --help or the help subcommand, and takes the utf8bytelength of each result text for each 168-hour window.
  • THEN The pipeline prints the median UTF-8 byte length and the count of the kept help texts for each window.

Requirement: Help size reduction

The median help bytes of agent callers after the release MUST be at most two thirds of the median before it.

Scenario: The reduction reaches 1.5 times

  • WHEN A person divides the before median by the after median.
  • THEN The quotient is at least 1.5 and the criterion passes. A quotient below 1.5, or a window with no help text, fails the criterion and the record shows the count of that window.

Requirement: Pending a person after the merge

The owner SHALL record the measurement in one comment on this issue after the 168-hour window.

Scenario: The measurement is recorded

  • WHEN The owner has run the query and has read both transcript windows.
  • THEN One comment holds the release version, the bounds of both windows, the query, both medians with their counts, the per-1,000 rate and the threshold result.

Existing Tool Considered

No alternatives check has run. Prometheus with PromQL covers the per-1,000 rate; its increase function and devops prometheus query --time give the 7-day range. jq covers the median help bytes; it reads the JSONL transcripts, joins the tool results to the tool calls, and computes UTF-8 byte lengths and medians. Prometheus lacks byte size. jq lacks the release time, the window bounds and the transcript directory naming. devops ai agent-audit reads the transcripts but counts recurring problems, not bytes. The measurement adds no product code; the jq pipeline costs about 3,000 tokens to write, check and fix and about 30 minutes.

Key questions

  • Which metric name and label does the query use?: Use devops_cli_help_requests_total{caller="agent"} for the numerator. Use devops_cli_command_total for the denominator. The repository map lists devops_cli_help_requests_total in src/devops_cli/telemetry/instruments.py and src/devops_cli/telemetry/usage_errors.py. The query must match the caller values that feat(cli): agent callers get plain help with full descriptions #5450 ships. [sources: src/devops_cli/telemetry/instruments.py:1084, src/devops_cli/telemetry/usage_errors.py, docs/TELEMETRY.md]
  • Which counter gives the denominator of the per-1,000 rate?: The denominator is sum(increase(devops_cli_command_total[7d])) with no caller filter. The counter counts every command by command and status. The item asks per 1,000 commands, not per 1,000 agent commands. (best practice) [sources: src/devops_cli/telemetry/instruments.py:1084, docs/TELEMETRY.md]
    • Chosen: Use the existing devops_cli_command_total. It counts every command, it needs no new metric, and the item asks per 1,000 commands.
    • Rejected: Add a new counter for agent commands. It adds code and a release, and the existing counter counts the commands.
    • Rejected: Use devops_cli_usage_error_total. It counts usage errors only, not commands, so it cannot be the denominator.
  • What does a reduction of 1.5 times mean for the two medians?: The before median divided by the after median is at least 1.5. The after median is at most two thirds of the before median. The project records a reduction as the old value divided by the new one. A window with no help text has no median, so the criterion fails and the record shows the count. (best practice) [sources: CHANGELOG.md, src/devops_cli/ai/inspection.py]
    • Chosen: The before median divided by the after median is at least 1.5. One quotient from the two medians settles the threshold, and the project records a reduction as the old value divided by the new one.
    • Rejected: The after median is at most 1.5 times the before median. It passes when the help grows, so it measures no reduction.
    • Rejected: The after median is at most the before median minus 1.5 bytes. A change that small is below the noise of one help text.
  • Which windows do the before and the after medians use?: The before window is the 168 hours before the release published_at. The after window is published_at to published_at plus 168 hours. The two windows are equal. The after window ends at the same instant as the Prometheus [7d] range at --time equal to published_at plus 7 days. (best practice) [sources: docs/commands/prometheus.md:27, src/devops_cli/commands/prometheus.py]
    • Chosen: 168 hours before and 168 hours after the release time. Equal windows end at the release and at the release plus 7 days, the same instant as the Prometheus [7d] range.
    • Rejected: 7 full UTC calendar days before and after. A calendar boundary does not match the [7d] range that ends at the release time plus 7 days.
    • Rejected: All history before the release and all history after it. Older releases and other traffic change the before median.
    • Rejected: 30 days before and 7 days after. Unequal windows compare different traffic mixes.
  • Does devops prometheus query accept --time, and does the PromQL increase function give the 7-day rate?: Yes. devops prometheus query takes --time and -t, the evaluation timestamp of an instant query, and passes the value as the Prometheus API time parameter. It prints the No results. warning when the query returns no series. tests/commands/test_prometheus.py holds that output. The Prometheus query functions page is the reference for the range-vector functions, increase included. [sources: docs/commands/prometheus.md:27, src/devops_cli/commands/prometheus.py, src/devops_cli/lang/en/messages.py, tests/commands/test_prometheus.py]
  • How does a person get the release time of the first release that contains feat(cli): agent callers get plain help with full descriptions #5450?: The person reads the published_at field of that GitHub release with devops gh api repos/dan-petty/devops-cli/releases/tags/<tag> --jq .published_at. devops gh api passes --jq through to gh. The release-publication spec uses this live check for published_at. The person adds 7 days to that value to get the --time argument and the end of the after window. [sources: openspec/specs/release-publication/spec.md, CONTRIBUTING.md, docs/CLI_REFERENCE.md]
  • How does a person identify the help texts in the Claude Code transcripts?: A jq pipeline reads the transcript JSONL files. It joins each tool_result to its tool_use command by tool_use_id. It keeps the results of commands that invoke devops with --help or the help subcommand. It takes utf8bytelength of the result text, one text for each such result. It reads the same transcript fields that devops ai agent-audit reads: the tool_use block of an assistant record, the tool_result block of the user record that answers it, and the timestamp. The files sit under ~/.claude/projects/<project>/, where <project> is the absolute path of the repository with each character that is not a letter or a digit replaced by a hyphen, and the same for each worktree under .data/agent/worktrees/. The pipeline changes no product code. (best practice) [sources: docs/commands/ai.md, src/devops_cli/ai/agent_audit/transcript.py, src/devops_cli/ai/agent_audit/sources.py]
    • Chosen: A jq pipeline over the transcript JSONL files. It is reproducible, it uses the transcript fields that the project already reads, and it adds no product code.
    • Rejected: Manual reading of the transcripts. It is not reproducible, and a person may miss help texts.
    • Rejected: A new product metric for the help bytes. It adds code, a release and a second 7-day wait.

Fit

Fits in one pull request.

Suspected block

The first release that contains #5450, and the 168 hours of production data after its published_at.

Dependencies

#5450

Activity

  1. added
    type/chore
    scope/telemetry
    source/agent
    status/new
    value/medium
    effort/low
    on Nov 18, 2026
  2. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    ContributorAuthor
  3. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: Who runs the measurement, and how does the item close? (a person decides)

    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

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

    @devops-cli-service
    ContributorAuthor

    Owner question: See the first point of Open questions and Watched files 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

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

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.

  7. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    ContributorAuthor

    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/telemetrysource/agentstatus/newtype/chorevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions