Skip to content

feat(fleet-queue): default completion telemetry in repo-queue complete (#4919) - #10704

Merged
dezren39 merged 1 commit into
mainfrom
queue/16872-4919-completion-telemetry-default
Nov 16, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/16872-4919-completion-telemetry-default

Conversation

@dezren39

@dezren39 dezren39 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Summary

repo-queue complete now fills completion telemetry itself instead of relying on the worker to pass --telemetry.

 complete(task_id)
   read --result / --result-file
   merge --telemetry (caller values win)
   dominant_model_for_task()
+  fill_completion_telemetry(task_id)
+    claim = /list {rich, task}          # claim_model, claim_variant, progress.session_id
+    session = GET /api/session/<id>     # OPENCODE_SESSION_ID, else the claim row's session
+    derived = {
+      model:    claim_model, else serving leaf
+      effort:   claim_variant (never "default"), else serving variant
+      pool:     session's declared opencode-route model
+      cost_usd: null                    # no source; never invented
+    }
+    merge: entry(field).or_insert(derived)  # explicit caller value always wins
   POST /complete {result}

Out of scope, per the task packet: editing the goal-workspace worker instruction (outside the repo) and backfilling historical completions.

Evidence

Before: adoption of pool/model/effort/cost_usd was 1 of 846 completions in the measured window — the fields existed only if a worker passed --telemetry.

After:

cargo test -p fleet-queue --features queue-broker
test result: ok. 331 passed; 0 failed; 0 ignored       (lib)
test result: ok. 1 passed; 0 failed; 0 ignored         (tests/chunked_list.rs)

cargo test -p fleet-queue --features queue-broker completion_
test client::tests::completion_telemetry_reads_model_and_effort_from_the_claim_stamp ... ok
test client::tests::completion_telemetry_falls_back_to_the_session_serving_leaf_and_route ... ok
test client::tests::completion_telemetry_claim_wins_and_default_variant_is_absence ... ok
test client::tests::completion_telemetry_always_carries_all_four_keys ... ok
test client::tests::completion_telemetry_merge_never_overwrites_the_caller ... ok
test client::tests::completion_session_id_prefers_env_then_the_claim_row ... ok

The six new tests cover: claim-stamp derivation, session-leaf + route (pool) derivation, caller override with "default" treated as absence, all-four-keys-present with explicit nulls, non-overwriting merge, and session-id resolution order.

Merge Danger

Door: Two-way — the change only adds fields to completion results and is fail-soft at every derivation step; reverting restores the prior behavior exactly.

Blast Radius: Contained to repo-queue complete results (one extra /list and one session read per completion) plus schema documentation. No broker, claim, or validation behavior changes.

Refs #4919


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Completion telemetry (pool/model/effort/cost_usd) was optional and
adoption stayed near zero because passing it was pure worker
discipline. complete now derives each absent field from records the
queue already holds — the claim stamp (serving-leaf model and
variant), the completing session's record (declared opencode-route
model as pool, serving leaf as fallback), and always writes all four
keys, null when unsourceable. Explicit --result/--telemetry values
keep winning; cost_usd is never invented.

Refs #4919
@dezren39
dezren39 requested a review from a team as a code owner November 16, 2026 10:54
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T10:54:26.744618Z
We couldn’t complete this review. Comment @codex review to try again.
f15abc8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e4dd1224-66a5-401d-99f1-990d12059128
Commits

Reviewing files that changed from the base of the PR and between 2f5d9cb and f15abc8.

Files selected for processing: 2

  • pkgs/fleet/crates/fleet-queue/src/client.rs
  • pkgs/fleet/repo-task-v1.schema.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit 56d907c into main Nov 16, 2026
1 check passed
@dezren39
dezren39 deleted the queue/16872-4919-completion-telemetry-default branch November 16, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant