fix(agent): prevent "..." fallback when iteration budget exhausted

Add early detection and graceful degradation when the model exhausts its
iteration budget without producing a text response:

- Inject 75% budget nudge telling model to start summarizing
- Strip all tool schemas on final iteration to force text-only response
- Adaptive web_fetch maxChars (60K→20K→10K) via iteration progress context
- Bump DefaultMaxIterations 20→30 for web-research workloads
This commit is contained in:
viettranx committed 2026-03-20 17:55:51 +07:00
1 parent 84650c5c14
commit dba3f4e4e6
4 files changed
+59 -3

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ const (
DefaultContextWindow = 200000
DefaultMaxTokens = 8192
DefaultMaxMessageChars = 32000
DefaultMaxIterations = 20
DefaultMaxIterations = 30
DefaultTemperature = 0.7
DefaultHistoryShare = 0.75
)