You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7e1033b
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: argi-agent/argi-agent-api/src/main/java/io/github/agentic/ai/agent/budget/ApproximateRequestTokenEstimator.java
+20-12Lines changed: 20 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -36,10 +36,14 @@
36
36
* disclosed tool schemas and the reserved output.
37
37
*
38
38
* <p>
39
-
* The tool schemas are counted for the bindings the request actually discloses. When
40
-
* the request carries an explicit tool selection, only the selected bindings are
41
-
* counted; the dynamic bindings of the request are always counted because they are
42
-
* disclosed next to the selected ones.
39
+
* The tool schemas are counted for the bindings the request actually dispatches,
40
+
* matching the selection semantics of the dispatch path: the static and the dynamic
41
+
* registry are merged with the static binding winning a name conflict, and an
42
+
* explicit tool selection (including an empty one, which disables tools) filters the
43
+
* merged set. Schemas of bindings the dispatch will not send are not counted, so an
44
+
* empty selection or a large dynamic catalog cannot reject a request whose dispatch
45
+
* carries none of them. Tool descriptions are not counted: they feed the auxiliary
46
+
* selection call, never the dispatched request.
43
47
*
44
48
* <p>
45
49
* When the request carries an explicit {@code maxTokens} output limit, the estimate
@@ -124,18 +128,22 @@ else if (part.data() != null) {
Copy file name to clipboardExpand all lines: argi-agent/argi-agent-api/src/test/java/io/github/agentic/ai/agent/budget/ContextBudgetInterceptorTest.java
0 commit comments