feat(grok-cli): wire usage capture into the run (session id + post-run extract)

The provider pins a fixed session id (ROBOCO_AGENT_SESSION_ID, reused from the
agent session id as on the Claude path); the entrypoint passes it to
'grok -p -s <id>' so the run's session store is locatable, then runs the usage
reader post-run (best-effort) to write the captured tokens + cost. The
orchestrator-side finalize that reads that file follows.
This commit is contained in:
Renn F
2026-06-19 03:32:32 +02:00
parent 579dfb997b
commit c139e2d017
3 changed files with 19 additions and 0 deletions
+2
View File
@@ -213,6 +213,8 @@ async def test_grok_spawn_wires_gateway_env_and_image_last() -> None:
assert "ROBOCO_MCP_CONFIG=/app/mcp-config.json" in cmd
assert "ROBOCO_AGENT_ID=be-dev-1" in cmd # renderer computes per-role flags
assert "ROBOCO_AGENT_MODEL=grok-build" in cmd
# Fixed session id so usage capture can locate the run's session store.
assert "ROBOCO_AGENT_SESSION_ID=sess-1" in cmd
# Identity wiring from the shared host helpers is present.
assert "ROBOCO_AGENT_TOKEN=hmac-be-dev-1" in cmd
# The image is the final docker-run argument.