Fix the bug we discussed earlier.Fix the crash in src/cart/total.ts when the cart is empty.
Repro: cartTotal([]) throws 'Cannot read properties of undefined'.
Do not change the public API.
Return a short summary of the fix and the files changed.The sub-agent cannot see the parent's chat, so the task must carry the context, the limits and the expected summary.
To keep the main context small: a sub-agent explores in its own context and returns only a summary. Independent sub-agents can also run in parallel.
No. Each starts with a fresh context and gets only its task prompt, its own instructions and its tools.
For small tasks or work that needs the full conversation. Each handoff loses detail and costs extra tokens.