Agent
Four modes for different jobs — hand off work, plan first, ask questions, or debug a failure.
Describe the outcome in language, then inspect the trail of reads and edits. Rules and skills steer behavior; subagents can take focused jobs; MCP over stdio connects external tools; hooks run around agent events. You stay in the review loop.
Tool use follows your permission level. Command execution is never silent.
41 def charge(order, wallet): 42 tax = order.subtotal * 0.09 43 total = order.subtotal + tax 44 if wallet.balance < total: 45 raise InsufficientFunds(total) 46 wallet.debit(total) 47 return Receipt(order.id, total)
Split regional tax from the hardcoded rate, and check coverage before debit.
Read 6 files · 2 searches · 1 test
charge still hard-codes 0.09. tax_for(region) exists. I will wire can_cover to the wallet.
12-line patch across two files. Review the diff.
Before touching checkout, write the approach for multi-region tax.
Plan · product shell and edits are limited
Freeze the tax_for contract, then change charge, then update test_charge.
Plan is ready. I switch to Agent after you confirm.
Where does charge take tax from, and which test pins it?
Ask · read only
The rate is checkout.py:42. test_charge asserts the same 0.09.
Nothing was written.
InsufficientFunds also fires for tax-exempt orders. Evidence first.
Debug · reproduce before the fix
It fails when the region is exempt and wallet.can_cover still sees the flat rate.
Failure trail is ready. The fix waits for your OK.
- tax = order.subtotal * 0.09 + tax = order.tax_for(region) - if wallet.balance < total: + if not wallet.can_cover(total, region): wallet.debit(total)