Skip to content

feat(crew-log): bill subagent and background credits in the usage fold - #14966

Merged
iamwhatever merged 1 commit into
mainfrom
feat/subagent-credits
Sep 29, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
feat/subagent-credits

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: the crew log records what a session's subagents cost, so the usage fold answers "what did this session spend" instead of "what did its own turns spend".

A subagent's credits are measured. #14913 wired SubagentInfo.credits and the card shows it. But that number never reaches the crew log: subagent/completed and subagent/failed carry no credits field, and the entry type's own note still says the runtime cannot measure one. So the log of a session that dispatched twenty children says nothing about what those children cost.

The usage fold has the matching hole. It bills four entry types, all turn-shaped. background/completed has carried a credits field all along and no fold reads it. A session that spent most of its budget on a wave of subagents reads as cheap.

A third, smaller one: _timeline_step copies duration_ms, which is the turn entry's spelling. The subagent closers and steps call theirs ms, so a child's run duration never reached the timeline at all.

Why it matters

The crew log is the durable record. The card's number lives in runtime memory, goes out over a WebSocket frame, and is gone when the process ends -- so "what did last Tuesday's session cost" has no answer, and the panel's own credits stat under-reports every session that used subagents. Anyone reading the log to attribute spend gets a number that is quietly wrong rather than absent.

Not a goal

  • The card keeps reading the WebSocket frame. Moving it onto the fold is later work.
  • No subagents fold. This adds the number and the buckets; a fold that answers "which children ran" is separate.
  • No token counts for a child. Nothing in the subagent runtime measures them, so they stay absent.
  • No panel change for the new buckets. The fold publishes them; how CrewLogPanel draws them is a separate decision.

What changed (motivation → approach → change)

part before after
subagent/completed, subagent/failed no credits field credits, written only when positive
usage.credits turns only turns + subagents + background helpers
usage.credits_by_source -- turn / subagent / background, each with credits and reported
timeline moments copied duration_ms copies ms too
FOLD_STATE_VERSION 3 4

The measurement existed and the write did not, so the write is what this adds. subagent_manager/terminal.py is the one place a child closes, and it already reads info.elapsed there; it now reads info.credits beside it and hands it over as measured. crew_log/entry_types.py declares the two new fields and crew_log/emit.py writes them.

Both emitters drop a zero. A provider that does not bill in credits reports 0.0 through the shared TurnUsage contract, which at this seam looks exactly like a run that was free. Writing the zero would state a measurement nobody made, so absent keeps meaning unmetered -- the posture background/completed already takes.

_bill_credits states one invariant, about the RESULT of the addition rather than the charge: a spend total stays finite, and it never goes down. A charge is billed only if the total and its bucket still hold that afterwards.

Not a list of bad inputs, deliberately. NaN, each infinity, a negative, and two finite values that overflow on the way up are four inputs with one consequence, and that consequence is the part nothing can undo: round keeps a non-finite total non-finite and the savepoint persists it. Zero passes, because it does not move the total and a provider reporting 0.0 measured zero.

Two things sit beside it. float(credits) is exception-safe, since a JSON integer is unbounded and OverflowError is caught nowhere between _usage_step and fold_session. And by_model needs no check: every billed charge is non-negative, so a model's row is a sub-sum of a total already proved finite.

The subagent emitters also refuse a non-finite charge on the way in, guarding a different property -- json writes inf as Infinity, which is not valid strict JSON, so the writer protects the log file's parseability and the fold protects the total.

In crew_log/projection.py, one function, _bill_credits, adds every charge to the session total and to its own source bucket. Both in one place is the point: a bucket incremented where the total is not would make the two disagree, and a reader could not tell which half was wrong. turns.credits_reported and by_model stay turn-scoped -- a child's closer names no model, so charging the parent turn's model for a child's work would attribute one model's spend to another.

usage now stores a bucket per source, so FOLD_STATE_VERSION moves to 4. That retires every savepoint written against the turn-only state; each affected session pays one cold refold, which is the expected cost and the only in-product way to retire them.

The three system specs state the same shape: crew-log-emitter.md on why the field is written and why a zero is not, crew-log-projection.md on the closed bucket set, and injected-messages.md on the completion message and the entry reading one accumulator.

Backwards compatibility

Compatible: both new credits fields are optional additions to existing entry types, an old entry without one reads exactly as before (as unmetered, which is what it was), usage gains a key and no consumer loses one, and old savepoints are refused rather than misread, which is what the FOLD_STATE_VERSION bump is for.

One interim mismatch, named here rather than hidden. usage.credits now covers three spenders while turns.credits_reported beside it stays turn-scoped, and CrewLogPanel pairs the two: measured(value.credits, turns.credits_reported) at CrewLogPanel.tsx:338 and the collapsed summary_usage line both render -- when the count is zero. So a session whose turn closers reported no cost, but whose child or title call did, shows a dash where the fold holds a real number. Reaching it takes a synthesized turn closer (a crash-repair close) or a session billed only for a background call; the fold's number stays correct and readable through GET /api/sessions/{id}/crew-log/projection/usage. Gating and labelling that stat on a session-wide count is stage 2's work, in the same PR that gives the panel its subagents section -- doing it here would widen this PR into CrewLogPanel.tsx plus 13 locale files and a surface another stage owns.

Tests

  • test_crew_log_emit.py -- a completed child records credits; a child that billed nothing writes no credits key; both again for failed and stopped; a non-finite charge is written for no outcome.
  • test_crew_log_projection.py -- turn 2.0 + subagent 1.0 + background 0.5 folds to a total of 3.5 with each bucket right; a stopped child bills the subagent bucket; a closer with no credits leaves that bucket at zero with reported: 0; a child's ms reaches the timeline.
  • The invariant is pinned from both ends. NaN, inf, -inf, -0.5 and -1e9 are each driven through all four writers -- both child closers, a background helper, and the turn path that predates the buckets -- and must leave the total and every bucket untouched. A 10 ** 400 charge must skip its own line and not fail the fold. Two 1e308 charges must leave the total finite at 1e308 with the second refused, which is the case no input check can see. An explicit 0.0 must stay counted as reported.
  • test_crew_log_checkpoint.py -- a savepoint written under the previous FOLD_STATE_VERSION is refused and the fold runs cold. The digest fixture also grew the two non-turn spenders, so the state pin covers the new buckets rather than only the turn path.
  • test_crew_log_resolver.py -- the existing closer-ordering test's stand-in SubagentInfo gained credits, which the closer now reads.

Every test above was watched fail before its fix existed. Six mutations were each caught: relaxing the drop-zero gate to >= 0 on both emitters, removing ms from the timeline key list, routing subagent charges into the turn bucket, and deleting either half of the invariant on its own. The FOLD_STATE_VERSION obligation is enforced by the existing state-digest pin, which went red on the state change before the bump.

One result is worth stating because it is what shows the invariant replaced the earlier guards rather than joining them: the NaN, inf, -inf and negative cases still pass with every per-input magnitude check deleted from the function. They are caught by the finite-and-never-decreasing test on the result.

Manual verification

N/A -- unit coverage sufficient. Every changed path is a pure function over log entries or a single emitter call, and each is driven directly by a test.

Related Issues

no linked issue: stage 1 of a three-stage plan; the later stages move the card onto the fold.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@chenmingwei23
chenmingwei23 requested a review from a team as a code owner September 29, 2026 07:14
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Intent: make the crew log the durable record of what a session's subagents and background helpers cost, so usage answers "what did this session spend" rather than "what did its own turns spend".
Not a goal: moving the subagent card onto the fold, adding a subagents fold, measuring a child's tokens, or drawing the new buckets in CrewLogPanel.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 7a8bcd522121a2c61c3a1e2ede6f04007a67b461 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify stage 2 is tracked: CrewLogPanel.tsx:338 now labels a three-source total with a turn-only count, the interim mismatch the description defers.

[DESIGN-REVIEWED] 7a8bcd5

Description read

[DESCRIPTION-READ] de90e5418d316d07023f9c74c2f10ba95c80047522800ee9c08bc13a6d79c915

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 7a8bcd522121a2c61c3a1e2ede6f04007a67b461 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 7a8bcd5

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 7a8bcd522121a2c61c3a1e2ede6f04007a67b461: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 7a8bcd522121a2c61c3a1e2ede6f04007a67b461 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

credits_by_source ships in the public usage projection with zero consumers; its first reader is deferred to a stage-2 panel PR by the author's own plan.

Not justified as shipped

  • Item 3 — zero consumers: grep for credits_by_source outside the defining module hits only its tests and specs, and website/src has 0 hits; the description defers the reader ("No panel change for the new buckets… a separate decision"). The base spec invariant (crew-log-projection.md:80, "every total rides beside the count of turns that contributed") derives a coverage count, not a three-bucket rendered split.
    Subtraction: defer the rendered credits_by_source key to the stage-2 PR that draws it, keeping the fold's internal buckets; a session-wide reported count is the smaller published form.
    Clears when: a counted consumer of credits_by_source lands (the panel's subagents section), or the key is deferred to that PR.

What this change ships

Inventory (8 items) — 7 justified

Intent: make the crew log's usage fold answer what a session spent, children and background helpers included — an ADDITION.

  1. Child closers (subagent/completed/failed) now record credits when billed — justified
  2. usage.credits sums turns + subagents + background (background credits were carried but never folded) — justified
  3. usage.credits_by_source split published in the projection response — zero consumers, first reader deferred to stage 2
  4. Fold refuses negative/non-finite/overflowing charges, including on the pre-existing turn path — justified
  5. Emitters drop a non-finite child charge before it reaches the log file — justified
  6. Child run durations (ms) now reach the timeline moments — justified
  7. FOLD_STATE_VERSION 3→4; each session pays one cold refold — justified
  8. Three system specs updated in the same commit — justified

The rewritten "nothing measures either" pin is reversed with evidence: SubagentInfo.credits exists (subagent_manager/terminal.py:106,291), wired by linked #14913, and the description names the reversal.

[FIRST-PRINCIPLES-REVIEWED] 7a8bcd5

Description read

[DESCRIPTION-READ] 5e9e1df428dc3af770d11f0ace9cd9f2a3e4cf44eac6c04fd4130d7ae9584915

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

Reviewed 7a8bcd522121a2c61c3a1e2ede6f04007a67b461 — this comment is updated in place on each push.

Review details

Advisory only — nothing blocks; usage.credits now sums three sources while the only reporter count the consumer gates on stayed turn-scoped.

FINDING — src/kiro_crew/crew_log/projection.py:1472 — "credits_reported": state["credits_by_source"]["turn"]["reported"] is the sole presence gate CrewLogPanel has for the now-three-source credits total (measured(value.credits, turns.credits_reported) at CrewLogPanel.tsx:338 and the collapsed summaryFor at :573), so a session still inside its first turn whose dispatched children have already closed with credits renders the credits tile and the one-line usage summary as — ("nobody measured") while the fold holds the real charge — and once a turn does report, the tile prints the all-source total under the label credits · across {turns} turns while the by_model rows beneath it still sum the turn bucket alone → Fix: publish a whole-session reporter count beside the total (sum of the three buckets' reported) and gate the tile and the collapsed summary on that instead of turns.credits_reported; the second half lands in website/src/pages/chat/CrewLogPanel.tsx, which this PR does not touch, so the remedy cannot be completed inside this diff.

[OPUS-REVIEWED] 7a8bcd5

Verdict parsed from the review's SHA-scoped output markers for commit 7a8bcd522121a2c61c3a1e2ede6f04007a67b461.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 7a8bcd522121a2c61c3a1e2ede6f04007a67b461: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 29, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: _bill_credits and both subagent emitters now refuse a non-finite charge outright rather than folding or writing it.

  • span=edc024cbb4a9 -- Reject non-finite credit charges: fixed in 477c670

Legitimate and reachable. credits arrives from a log line, and json.loads round-trips NaN, Infinity and -Infinity without complaint, so a broken provider report or a hostile writer lands one in the fold.
The consequence is not a wrong number a later entry corrects: every sum after it is non-finite, round keeps it non-finite, and the savepoint persists it, so the fold serves a poisoned total for the life of the unit.
Fixed on both sides. _bill_credits returns early on not math.isfinite(billed), so the charge is refused exactly as an absent one is and reported does not count it -- a value that cannot be added is not a measurement. The two subagent emitters gained and math.isfinite(credits), because inf > 0 is True and the positive-only gate alone would have written it.
The reader-side guard is the load-bearing half: it covers every writer of these types and every line already on disk, not just this PR's own.
Three tests per side pin it, parameterised over nan, inf and -inf, each watched fail before the guard existed: test_usage_refuses_a_non_finite_credit_charge asserts the total stays finite and the bucket unreported, test_a_non_finite_charge_is_not_written_at_all asserts no key is written.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author
  • span=deb4c60e9e40 -- Item 2, undeclared compatibility claim: fixed in 477c670

The finding is right and the claim was false: usage.credits changed meaning, so "both of which keep their meaning" was contradicted by the table three sections above it. Taking the second clearing path -- the description now names the mismatch instead of asserting it away.
## Backwards compatibility states it directly: the total covers three spenders, turns.credits_reported stays turn-scoped, and CrewLogPanel pairs them at CrewLogPanel.tsx:338 and in the collapsed summary_usage line, so a session whose turn closers reported no cost but whose child or title call did renders -- where the fold holds a real number.
It also names what bounds the cost: reaching it takes a synthesized turn closer or a session billed only for a background call, and the number stays correct through GET /api/sessions/{id}/crew-log/projection/usage.
Tracked for the first path as #14985, assigned and dated, to land in stage 2's PR -- the one that already touches CrewLogPanel.tsx and the 13 locale files. Fixing the gate here would widen a backend PR into a surface another stage owns and would collide with that worker.
turns.credits_reported stays turn-scoped deliberately: it answers how many TURNS reported a cost, which a session-wide count cannot. The panel is asking the wider question and should read the wider field.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Accepted as a real defect, not rebutted. measured returns -- when the count is zero, and the collapsed summary_usage line applies the same rule, so the panel can hide a number the fold holds.
Deferred rather than fixed here because the remedy is entirely in the frontend: two call sites in CrewLogPanel.tsx, the stat_credits string across 13 locale files, and the CrewLogPanel.test.tsx fixtures. Stage 2 of this plan already opens that file to add the panel's subagents section, so landing it there is one review of one contract instead of two PRs editing the same lines.
Bounded while it stands: it needs a synthesized turn closer (a crash-repair close) or a session billed only for a background call, the consequence is a dash instead of a number rather than a wrong number, and GET /api/sessions/{id}/crew-log/projection/usage carries the correct value throughout.
#14985 carries the deferred-finding label, an assignee and a Due: date, and names both call sites and the locale files.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 29, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: _bill_credits bills a charge only when it is finite AND non-negative, one rule for all four writers; the redundant screen in subagent_manager/terminal.py is removed.

  • span=edc024cbb4a9 -- Negative background charges reduce usage totals: fixed in 9e03b28

Legitimate, and this is the other side of the invariant the previous round half-closed: I guarded the value that cannot be summed and left the one that can be summed the wrong way. Same span, so it is treated as an incomplete fix rather than a second round, and the rule is now stated once instead of extended again.
A negative charge is worse than a poisoned one in one respect: it is plausible. It reduces the session total, so the log reads as having spent less than it did, and no later entry corrects it. Spend does not run backwards and this vocabulary has no refund entry.
Every shape is now decided in one place, and each branch is pinned by a test rather than by this sentence: positive finite is billed; exactly 0.0 is billed AND counted as reported, because a provider reporting zero measured zero and that is a different fact from reporting nothing; absent or non-numeric is refused; NaN/inf/-inf is refused as unsummable; negative is refused.
Driven through all four writers -- both child closers, a background helper, and the turn path that predates the buckets -- because a rule that depends on which spender wrote the line is not one rule, and the turn path produces the same poisoned total. Eight parameterised cases were watched fail before the guard existed; the non-finite cases stayed green, which is what shows the two halves are separate.
Also subtracted rather than added to: the clamp in subagent_manager/terminal.py is gone. The emitter already refuses anything not positive and finite, so screening in the caller put one rule in two places and only one of them is the writer.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 29, 2026
A child's spend was measured but never written down: the subagent closers
carried no `credits`, and the `usage` fold billed turns alone, so a session
that spent most of its budget on a wave of children read as cheap. The
credits `background/completed` already carried were folded by nothing.

Both closers now carry `credits`, written only when positive so absent
keeps meaning unmetered. `usage` bills all three spenders into one total
and keeps `credits_by_source` beside it. `FOLD_STATE_VERSION` moves to 4,
retiring every savepoint written against the turn-only state.

`_timeline_step` also copies `ms`, the spelling the subagent closers and
steps use for a measured duration, so a child's run time reaches the
timeline at all.
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 29, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: the stacked per-input magnitude guards in _bill_credits are replaced by ONE post-accumulation invariant plus an exception-safe conversion; nothing new is added.

  • span=edc024cbb4a9 -- Credit arithmetic can crash or corrupt the usage fold: fixed in 7a8bcd5

Both halves confirmed and both fixed. float(credits) ran before the gate, so a 400-digit JSON int raised OverflowError with no handler anywhere on _usage_step -> _fold_attempt -> fold_session, costing the whole projection over one line. And the add was never re-checked, so two finite 1e308 charges summed to inf and the savepoint kept it.
This is the third finding in this span, which triggered a retrospective before any repair rather than a fourth clause. Its conclusion is the one acted on here: every round guarded an INPUT shape while every consequence was about the ACCUMULATED TOTAL, so the guards kept reopening because the shapes outnumbered them.
The function now states one invariant on the RESULT -- a spend total stays finite and never goes down -- and bills a charge only if the total and its bucket still hold it afterwards. Conversion is wrapped for OverflowError/ValueError, so an unrepresentable charge costs its own line and nothing else.
This SUBTRACTS rather than adds: the math.isfinite(billed) and billed < 0.0 input checks are deleted. The evidence that the invariant subsumes them is that both earlier rounds' tests -- NaN, inf, -inf, -0.5, -1e9, driven through all four writers -- still pass with zero per-input magnitude checks left in the function.
by_model needs no guard of its own and gets none: every billed charge is non-negative, so a model row is a sub-sum of a total this rule has already proved finite. Stating that is cheaper than checking it.
Deleting either half of the invariant on its own was measured: dropping never-decreases reds 8 cases, dropping stays-finite reds 9. Neither half is redundant and neither is doing the other's work.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 29, 2026
@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Grep confirmed, not argued with: credits_by_source has 0 hits under website/src and 0 under src/ outside projection.py itself. I also checked whether this repo already ships rendered usage fields with no reader, because that would make the item a new bar rather than the standard -- it does not. by_source, estimated_turns, models_omitted_saturated, credits_reported, duration_reported, names_omitted every one has a frontend reader. So the item is applying the repo's own standard and the observation is correct.
Deferred rather than actioned, for one reason I can state precisely: the counted consumer is CrewLogPanel, and it is the same file and the same 13 locale strings that the deferred stage also needs in order to fix the gate defect already deferred to #14985. Landing the consumer here means editing a surface another stage owns and colliding with its worker; landing it there means one review of one contract.
The subtraction it proposes -- defer the render, keep the state -- I judge to be a false saving and worse than either whole option. Keeping the state still moves FOLD_STATE_VERSION and still forces the checkpoint digests to be re-recorded, so the cost is paid in full while the result is invisible: unrendered state has no reader at all, not even through the API. A field that renders is at least reachable by GET /api/sessions/{id}/crew-log/projection/usage today, without a frontend change.
What I cannot settle alone is the shape itself: whether usage should carry the split in this change is a published-API question the intent comment did not settle, and it was given to me as a fixed contract. That is recorded upward rather than decided here.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Re-verified on this head, not carried forward: credits_by_source still has 0 hits under website/src and 0 under src/ outside the defining module. The observation is correct and I am not arguing it.
This is the third head on which this lane has raised the same fact under a third span id. The content has not moved, so the span churn carries no new information: the fact is true and stays true until either the consumer lands or the key goes. Repeating the argument each round would be the wrong use of a review.
Deferring rather than actioning, on the same grounds as before and now with one measurement behind it: I checked whether this repository already ships rendered usage fields with no reader, which would have made this a new bar rather than the standard. It does not -- by_source, estimated_turns, models_omitted_saturated, credits_reported, duration_reported and names_omitted each have a frontend reader. So the lane is applying the repo's own invariant.
The counted consumer is CrewLogPanel, which is the same file and the same 13 locale strings the deferred panel-gate defect needs, tracked as #14985. Landing it here edits a surface another stage owns; landing it there is one review of one contract.
The second clearing path -- defer the key itself -- is live and is being decided upstream rather than unilaterally, because the bucket split was handed to this change as a fixed contract. If that ruling does not arrive before the board is otherwise clean, the key ships as contracted and the consumer lands with the panel section.

@chenmingwei23

Copy link
Copy Markdown
Contributor Author

Re-affirmed on this head rather than treated as new. Accepted as a real defect: measured returns a dash when the count is zero, the collapsed summary line applies the same rule, so the panel can hide a number the fold holds. Nothing about that changed in this round's restructure, which touched only how a charge is validated.
Still deferred for the same reason, which is about where the fix can land and not about its size: the remedy is two call sites in CrewLogPanel.tsx, the stat_credits string across 13 locale files and the panel's test fixtures. The deferred stage already opens exactly those files to add the panel's subagents section, so it lands there as one change with its consumer instead of two PRs editing the same lines.
Bounded while it stands, and this is what makes deferral honest rather than convenient: reaching it needs a synthesized turn closer (a crash-repair close) or a session billed only for a background call, the consequence is a dash instead of a number rather than a wrong number, and GET /api/sessions/{id}/crew-log/projection/usage carries the correct value the whole time.
#14985 carries the deferred-finding label, an assignee and a Due: date, and names both call sites and the locale files, so the fix does not depend on anyone rediscovering this thread.

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 29, 2026
@iamwhatever
iamwhatever merged commit 1f37820 into main Sep 29, 2026
145 of 146 checks passed
@iamwhatever
iamwhatever deleted the feat/subagent-credits branch September 29, 2026 15:21
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 29, 2026
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.

2 participants