Composed role bodies span 7x with no budget, and the biggest one lands on a chat lane #275
Labels
No labels
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
coherence-core
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
qa-fixture
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-flight-deck/agent-compose#275
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Agent Compose has size budgets on its sources (the
agent-compose-sizeandagent-compose-deduphooks) but none on its output. The composed body is what a consumer pays for on every single turn, and nothing measures or bounds it.The numbers
From
coilyco-bridge/deployservices/sirens-echo/rendered/sirens-deep-bundle.txt, the eight roles available to the Sirens Deep lane:Six roles sit under 9 KB.
creatoris 7x the median and 3x the next largest, carried mostly by a block ofaos-public/personal-preference-*skills.Why this surfaced
agent-proxy#101 measured Sirens Deep shipping a 53,133 byte system prompt against a four byte user turn, on all 46 turns of the window.
53,133 is very close to
creator's 46,942 composed body plus its 2,487 identity card plus harness framing. No other role is within 35 KB of that figure. I have not confirmed which role Deep runs at runtime and the bundle enumerates all eight rather than naming one, so please treat the attribution as an inference from arithmetic and confirm it before acting.Why prompt caching does not close this
The obvious reading of #101 was "enable prompt caching". It was already on. DeepSeek caches repeated prefixes automatically and a synthetic back to back probe through Agent Proxy measured a 94.8% hit rate.
Caching makes the prefix cheaper. It does not make it smaller, and it leaves the following untouched:
sirens-echo/defaultagainstornith:35bthe derivednum_ctxis roughly 39k, so a 15k token prefix consumes better than a third of the window before any conversation exists.The question
Should a composed body carry a budget that varies by consumer class? An unattended coding harness with a large window and a long task can absorb 47 KB. An interactive chat lane answering a four byte ping cannot, and pays it on every turn forever.
Concretely, worth deciding:
creatorat 47 KB intentional, or is it accumulated drift? Thepersonal-preference-*block is the obvious place to look first.Measurement is already in place
Agent Proxy now records
gen_ai.request.system_bytes,gen_ai.request.tool_count, andgen_ai.request.tool_byteson everyrequest.chatspan, plus provider prompt cache accounting. So the before and after of any change here is measurable at the proxy without new instrumentation. See agent-proxy#103.Related
Measured this on the live
sirens-echo/deepseekroute through Agent Proxy, using a synthetic 53,133 byte system prompt matching the size #101 reported. Five calls, varying only where the prompt changes:Two results worth carrying into the design.
Caching is prefix-based, not request-based. B and E change the user turn entirely and still hit 99.1%. So a stable composed body is cached across every turn that shares it, which is the good news.
Position dominates size. C and D are the same nine bytes. At the front they destroyed 10,624 cached tokens. At the tail they cost nothing. Causal attention means a token's K/V depends on everything before it, so the first byte that differs invalidates the entire remainder.
That gives composition a second requirement beyond any byte budget: order the composed body by stability, most stable first. Anything that varies per session, per date, or per invocation has to land at the end, or it silently converts a 99% hit into a 0% hit for every consumer on every turn.
Worth auditing whether anything variable is currently emitted near the top of a composed body, since the failure mode is invisible: no error, no warning, just a bill and a latency floor that never improve.
Method note: these are synthetic probes I generated on Deep's production route, tagged
x-request-id: synthetic-cache-probe-*. They will appear in the Sirens Deep Console alongside organic turns.Correction. Organic traffic has now been measured and one of the arguments in this issue does not survive it.
Sirens Deep ran ~17 real turns through the instrumented build. Measured:
The cold-start argument was wrong. I claimed the first turn after each gap would pay a full uncached prefix, and that the recurring cost would concentrate there. A full cold start would appear as a single miss of 10,000 to 15,000 tokens. Total misses across the entire window were 1,897. It did not happen. Either the cache survived from earlier traffic or DeepSeek's retention is longer than I assumed, but either way I asserted it more confidently than the evidence supported, and it should be struck from the reasoning here.
Consequence for this issue. At 99.17%, the 53 KB composed body is close to free in spend. The cost case for reducing it is largely gone. What remains is real but narrower:
num_ctxis roughly 39k.Those are context budget and model quality arguments, not spend arguments. This issue should be prioritized accordingly, which is lower than I originally pitched it.
What is unaffected. The two structural findings stand on their own:
creatorat 46,942 against a median under 9 KB, and 23 skills including two role melds and a duplicatedpersonality-editorial. That is a design and drift question independent of what caching costs.