Skip to content

Implementation Plan: P5-A5-WP3 — Wire normalization + campaign_id into fleet _api.py dispatch paths#2148

Merged
Trecek merged 1 commit into
developfrom
p5-a5-wp3-wire-normalization-campaign-id-into-fleet-api-py-d/1728
May 7, 2026
Merged

Implementation Plan: P5-A5-WP3 — Wire normalization + campaign_id into fleet _api.py dispatch paths#2148
Trecek merged 1 commit into
developfrom
p5-a5-wp3-wire-normalization-campaign-id-into-fleet-api-py-d/1728

Conversation

@Trecek
Copy link
Copy Markdown
Collaborator

@Trecek Trecek commented May 7, 2026

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 via AutoSkillit

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

…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 Trecek added this pull request to the merge queue May 7, 2026
Merged via the queue into develop with commit c25359d May 7, 2026
2 checks passed
@Trecek Trecek deleted the p5-a5-wp3-wire-normalization-campaign-id-into-fleet-api-py-d/1728 branch May 7, 2026 07:52
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>
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