Grok Build harness loops the last task after ACP tools
Author: vietgs03Created Sep 18, 2026Updated Sep 18, 2026
Summary
Grok Build through Jcode can re-run the same user task every ~25–30s after a tool call. Example: curl localhost:1424/api/v2/basic to print degrees, then the same print again and again.
Cause
- ACP tool results are stored as
role: usertool_resultmessages. build_promptused the latest user message including tool_result content as the next Grok prompt.- On resume it also re-sent Jcode's identity/system dump, which Grok wraps as a new
<user_query>.
The Grok session then sees a new user query that restates the previous task.
Expected
After a tool finishes, the turn ends (or continues with real user text). It must not feed the tool result / last task description back as a new prompt.
Actual
Journal shows the same model_usage_turn_id with injected user tool_result content like Print degrees from local BE /api/v2/basic, then another identical curl.
Source: 1jehuang/jcode