src/llm/client.ts
Comment on lines +2492 to +2500
let amountIn = (args.amountEth as string) || "";
const amountOut = (args.amountOut as string) || "";
// Reject ambiguous input: only one of amountEth or amountOut may be provided.
if (amountIn && amountOut) {
throw new Error(
"Provide amountEth (native token input) OR amountOut (token output to receive), not both."
);
}
The refresh_oracle_feed tool now has several new branches (amountOut-based estimation, viaVault routing, EOA simulation/estimateGas, and defaulting amountEth to 0.001). There are existing unit tests for other src/llm/client.ts helpers, but none exercising this tool’s argument validation and branching; adding targeted tests would help prevent regressions (e.g., amountEth+amountOut rejection, amountOut requires vault+RPC, viaVault requires vault, negative/zero oracle estimates).
src/llm/client.ts
Comment on lines +2492 to +2500
The refresh_oracle_feed tool now has several new branches (amountOut-based estimation, viaVault routing, EOA simulation/estimateGas, and defaulting amountEth to 0.001). There are existing unit tests for other src/llm/client.ts helpers, but none exercising this tool’s argument validation and branching; adding targeted tests would help prevent regressions (e.g., amountEth+amountOut rejection, amountOut requires vault+RPC, viaVault requires vault, negative/zero oracle estimates).