y to approve or press Enter to deny.
Complete checkpoint
support.ts
Run it
Verify the result
When the model requests the tool, the terminal displays the proposed arguments. Approving should yieldSimulated refunds: 1; denying should leave the count at 0. Inspect this state, not just the model’s prose.
The default timeout action is denial. A callback that is still awaiting terminal input can remain pending after the SDK’s decision; the finally block closes the terminal when the run ends.
The Set prevents duplicate demo writes only within this process. A real refund needs provider idempotency, an authoritative eligibility check, a scoped approver, and reconciliation if the provider’s outcome is uncertain. See approval, execution policy, and recovery.
Try both outcomes in separate runs. A denied tool call can still produce a successfully completed conversational response explaining the denial.
Stream the result
Continue to the next chapter.