Implementation Plan: P5-A5-WP3 — Wire normalization + campaign_id into fleet _api.py dispatch paths#2148
Merged
Trecek merged 1 commit intoMay 7, 2026
Conversation
…run_dispatch Add normalize_dispatch_token_usage to the lazy import block in _run_dispatch and thread it through both DispatchRecord constructor call sites (timeout path and normal outcome path). Also pass campaign_id=campaign_id on both call sites so the field is populated from tool_ctx.kitchen_id instead of defaulting to "". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Trecek
added a commit
that referenced
this pull request
May 8, 2026
…o fleet _api.py dispatch paths (#2148) ## Summary Update the two `DispatchRecord(...)` constructor call sites in `_run_dispatch()` (`src/autoskillit/fleet/_api.py`) so that (1) `token_usage` is passed through `normalize_dispatch_token_usage()` instead of raw, and (2) `campaign_id` is stored on each `DispatchRecord`. This requires adding `normalize_dispatch_token_usage` to the lazy import block and threading both values into the two existing constructor calls (timeout path and normal outcome path). Closes #1728 ## Implementation Plan Plan file: `/home/talon/projects/autoskillit-runs/impl-20260506-232817-331816/.autoskillit/temp/make-plan/P5-A5-WP3_wire_normalization_campaign_id_plan_2026-05-06_233300.md` 🤖 Generated with [Claude Code](https://claude.com/claude-code) via AutoSkillit <!-- autoskillit:pipeline-signature steps=prepare_pr,run_arch_lenses,compose_pr,annotate_pr_diff,review_pr --> ## Token Usage Summary | Step | Model | count | uncached | output | cache_read | peak_ctx | turns | cache_write | time | |------|-------|-------|----------|--------|------------|----------|-------|-------------|------| | plan | claude-opus-4-6 | 1 | 77 | 8.4k | 1.0M | 61.4k | 71 | 52.5k | 4m 10s | | verify | claude-opus-4-6 | 1 | 35 | 7.2k | 694.6k | 51.4k | 67 | 38.4k | 3m 25s | | implement | claude-sonnet-4-6 | 1 | 214 | 8.8k | 908.2k | 43.9k | 65 | 31.1k | 3m 9s | | prepare_pr | claude-sonnet-4-6 | 1 | 60 | 4.3k | 177.1k | 32.9k | 18 | 20.6k | 1m 16s | | compose_pr | claude-sonnet-4-6 | 1 | 59 | 1.9k | 159.7k | 26.0k | 15 | 13.0k | 7m 42s | | **Total** | | | 445 | 30.6k | 3.0M | 61.4k | | 155.6k | 19m 45s | ## Token Efficiency | Step | LoC Changed | cache_read/LoC | cache_write/LoC | output/LoC | |------|-------------|----------------|-----------------|------------| | plan | 0 | — | — | — | | verify | 0 | — | — | — | | implement | 7 | 129741.1 | 4439.1 | 1260.9 | | prepare_pr | 0 | — | — | — | | compose_pr | 0 | — | — | — | | **Total** | **7** | 422030.1 | 22222.0 | 4376.0 | ## Model Usage Breakdown | Model | steps | uncached | output | cache_read | cache_write | time | |-------|-------|----------|--------|------------|-------------|------| | claude-opus-4-6 | 2 | 112 | 15.6k | 1.7M | 90.9k | 7m 36s | | claude-sonnet-4-6 | 3 | 333 | 15.0k | 1.2M | 64.7k | 12m 8s | Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Update the two
DispatchRecord(...)constructor call sites in_run_dispatch()(src/autoskillit/fleet/_api.py) so that (1)token_usageis passed throughnormalize_dispatch_token_usage()instead of raw, and (2)campaign_idis stored on eachDispatchRecord. This requires addingnormalize_dispatch_token_usageto the lazy import block and threading both values into the two existing constructor calls (timeout path and normal outcome path).Closes #1728
Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/impl-20260506-232817-331816/.autoskillit/temp/make-plan/P5-A5-WP3_wire_normalization_campaign_id_plan_2026-05-06_233300.md🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
Token Efficiency
Model Usage Breakdown