* Settle a tool without producing provider-visible output. Runtime-owned * nested calls use this path because their result is consumed by Code Mode, * not sent as a provider tool-result part; materializing it could spend * turn-scoped provider resources such as the image budget.
(call: ResolvedMakaToolCall)
| 724 | * turn-scoped provider resources such as the image budget. |
| 725 | */ |
| 726 | async settleToolCallRaw(call: ResolvedMakaToolCall): Promise<RawToolSettlement> { |
| 727 | const settlement = this.performToolSettlement(call); |
| 728 | // Tracked so endTurn can wait out unwinds already in flight (#2253): |
| 729 | // their T2 outcomes must land before the stop path settles the run's |
| 730 | // terminal fact, and nested Code Mode calls route through here too. |
| 731 | // The caller observes the settlement itself; the tracking handler only |
| 732 | // removes the entry. |
| 733 | this.activeToolSettlements.add(settlement); |
| 734 | const untrack = () => this.activeToolSettlements.delete(settlement); |
| 735 | void settlement.then(untrack, untrack); |
| 736 | return settlement; |
| 737 | } |
| 738 | |
| 739 | private async performToolSettlement(call: ResolvedMakaToolCall): Promise<RawToolSettlement> { |
| 740 | const result = await this.executeTool( |
no test coverage detected