Summary
cost_micro_usd on the routine/flight path is never measured. Every flight — landed, held, or stuck — reads 0 because nothing anywhere writes a real cost. This has been misread as "stuck flights have cost 0"; the truth is that a successfully landed flight also has cost 0, and always will.
Verified 2026-08-10 against origin/main @ 36a0cdf, prompted by flight c4579364, which landed cleanly (status: landed, score: 1, 468s of real work, proposal accepted) with cost_micro_usd: 0 against a budget_micro_usd of 50000.
The chain, in order
1. Dispatch logs fabricated token counts, before any work happens.
src/routines/dispatch.ts:590-596:
await logSubagentTokenUsage(env.DB, {
subagentId: selected.agentId,
parentAgentId: 'mupot-routines',
modelSubstrate: selected.agentId.includes('river') ? 'claude-sonnet-4.6' : 'deepseek-v4-flash',
promptTokens: 1250,
completionTokens: 380,
taskId: task.id,
})
1250 / 380 are constants. This runs at dispatch time — before the agent has executed anything — so they cannot be measurements of the work. modelSubstrate is inferred by substring-matching 'river' in the agent id, so every non-river seat is recorded as deepseek-v4-flash regardless of what actually ran.
2. That telemetry has no cost column anyway.
subagent_token_usage stores prompt_tokens / completion_tokens only (src/telemetry/subagent-usage.ts:55-56). No cost, no price table, no join to one.
3. The governed landing hardcodes zero.
src/routines/actions.ts:835-841, landControlFlight:
const landed = await landGovernedFlight(env, flight.id, {
cost_micro_usd: 0,
score: 1,
…
})
No TODO, no comment. score: 1 is also unconditional — every governed flight lands with a perfect score by construction.
4. The run derives its cost from the flight, closing the loop with no input.
src/routines/actions.ts:1044-1050:
cost_micro_usd = (
SELECT COALESCE(SUM(f.cost_micro_usd), 0) FROM flights f
WHERE f.tenant = routine_runs.tenant AND (f.id = routine_runs.flight_id OR f.id IN (…))
)
So run.cost = SUM(flight.cost) = SUM(0) = 0. The run reads its cost from the flight; the flight's cost is a literal zero. There is no input to this loop.
A real meter exists — it is just not connected to this path
recordTokens (src/agents/meter.ts:217-239) does accumulate cost_micro_usd into execution_meter, and src/agents/execute.ts:453 writes a real cost onto tasks. So the agent-execute path has metering. The routine-control path does not use it.
Why this matters beyond a wrong number
budget_micro_usd is enforced at dispatch but never debited. A budget that is never spent against is not a budget.
- Every "cost 0" flight on the board has been read as evidence of a stall. It is not evidence of anything. That misreading cost real debugging time this week.
score: 1 unconditional means flight score carries no signal on the governed path either.
What would close this
landControlFlight must receive a measured cost rather than a constant — sourced from execution_meter / recordTokens for the assigned agent over the run's window, or from real usage reported by the runtime that executed the goal. That requires the runtime to report actual token usage, which today it does not: step 1 is a placeholder, not a feed.
Until then, no flight can honestly satisfy a "lands with cost_micro_usd > 0" acceptance criterion, and any non-zero value written there would be fabricated. Flagging that explicitly because that exact criterion is currently on the F-03 / flight-execution goal.
Related: #874 (receipt), #895 (executor install blocked), #894 (situation_digest exposure).
Summary
cost_micro_usdon the routine/flight path is never measured. Every flight — landed, held, or stuck — reads0because nothing anywhere writes a real cost. This has been misread as "stuck flights have cost 0"; the truth is that a successfully landed flight also has cost 0, and always will.Verified 2026-08-10 against
origin/main@36a0cdf, prompted by flightc4579364, which landed cleanly (status: landed,score: 1, 468s of real work, proposal accepted) withcost_micro_usd: 0against abudget_micro_usdof 50000.The chain, in order
1. Dispatch logs fabricated token counts, before any work happens.
src/routines/dispatch.ts:590-596:1250/380are constants. This runs at dispatch time — before the agent has executed anything — so they cannot be measurements of the work.modelSubstrateis inferred by substring-matching'river'in the agent id, so every non-river seat is recorded asdeepseek-v4-flashregardless of what actually ran.2. That telemetry has no cost column anyway.
subagent_token_usagestoresprompt_tokens/completion_tokensonly (src/telemetry/subagent-usage.ts:55-56). No cost, no price table, no join to one.3. The governed landing hardcodes zero.
src/routines/actions.ts:835-841,landControlFlight:No TODO, no comment.
score: 1is also unconditional — every governed flight lands with a perfect score by construction.4. The run derives its cost from the flight, closing the loop with no input.
src/routines/actions.ts:1044-1050:So
run.cost = SUM(flight.cost) = SUM(0) = 0. The run reads its cost from the flight; the flight's cost is a literal zero. There is no input to this loop.A real meter exists — it is just not connected to this path
recordTokens(src/agents/meter.ts:217-239) does accumulatecost_micro_usdintoexecution_meter, andsrc/agents/execute.ts:453writes a real cost onto tasks. So the agent-execute path has metering. The routine-control path does not use it.Why this matters beyond a wrong number
budget_micro_usdis enforced at dispatch but never debited. A budget that is never spent against is not a budget.score: 1unconditional means flight score carries no signal on the governed path either.What would close this
landControlFlightmust receive a measured cost rather than a constant — sourced fromexecution_meter/recordTokensfor the assigned agent over the run's window, or from real usage reported by the runtime that executed the goal. That requires the runtime to report actual token usage, which today it does not: step 1 is a placeholder, not a feed.Until then, no flight can honestly satisfy a "lands with cost_micro_usd > 0" acceptance criterion, and any non-zero value written there would be fabricated. Flagging that explicitly because that exact criterion is currently on the F-03 / flight-execution goal.
Related: #874 (receipt), #895 (executor install blocked), #894 (situation_digest exposure).