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
[Bug]: Compact over-budget Harness requests at the iteration limit #4271
When a Harness agent reaches its ReAct iteration limit, the fallback appends a closing instruction and sends a SUMMARY request using the working conversation. SUMMARY preparation skips conversation compaction and tool-result offloading. If the last tool result or the closing instruction pushes the request over the input budget, preparation raises ContextBudgetExceededException before the fallback model can answer.
To reproduce
Configure a Harness agent with a small input budget and a low iteration limit.
Use a tool that returns enough text on the last iteration to push the fallback request over the budget.
Let the agent reach its iteration limit and inspect the SUMMARY request outcome.
Expected behavior
Apply the configured tool-result offloading and history compaction before sending the fallback request. Keep the closing instruction in the request, including when both keepTokens and keepMessages are set to zero. If the prepared request still exceeds the budget, reject it before invoking the fallback model.
Activity
fix(harness): compact iteration-limit summary requests (agentscope-ai…