Bug: ACP prompt delivery timeout still insufficient for BYO-LLM proxies
Description
After increasing the JSON-RPC timeout from 15s to 60s in #3225, session creation via the API (POST /v1/sessions) still times out on the initial session/prompt delivery when using BYO-LLM proxies (z.ai/glm-5.1).
Server log evidence:
[ACP prompt timeout] session=aaebbbfd method=session/prompt timeout=60000ms
The session is eventually created and goes idle, but the HTTP response is delayed by the full 60s timeout. With ag run CLI, this works because the prompt delivery is async/streaming — the CLI doesn't block on the initial prompt response.
Reproduction
curl -X POST -H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"prompt":"echo hello","workDir":"/home/bubuntu/projects/aegis","permissionMode":"default"}' \
http://127.0.0.1:9100/v1/sessions
With z.ai/glm-5.1 proxy, this takes 60s+ and often hits the timeout.
Impact
Proposed fix (two parts)
Short-term (hotfix): Increase default acpPromptTimeoutMs from 60s to 120s. The proxy latency for initial prompt delivery on cold starts can exceed 60s.
Long-term (proper fix): Make session creation async. Return 202 Accepted immediately after creating the CC process, then let the client poll for readiness or use SSE for status updates. The ag run streaming path already works this way — the REST API should match.
Environment
- Aegis: 0.6.7-preview.1
- CC model: glm-5.1 via z.ai proxy (
https://api.z.ai/api/anthropic)
- Node: v22.22.1
Bug: ACP prompt delivery timeout still insufficient for BYO-LLM proxies
Description
After increasing the JSON-RPC timeout from 15s to 60s in #3225, session creation via the API (
POST /v1/sessions) still times out on the initialsession/promptdelivery when using BYO-LLM proxies (z.ai/glm-5.1).Server log evidence:
The session is eventually created and goes
idle, but the HTTP response is delayed by the full 60s timeout. Withag runCLI, this works because the prompt delivery is async/streaming — the CLI doesn't block on the initial prompt response.Reproduction
With z.ai/glm-5.1 proxy, this takes 60s+ and often hits the timeout.
Impact
ag runworks (different code path) but direct API usage is brokenProposed fix (two parts)
Short-term (hotfix): Increase default
acpPromptTimeoutMsfrom 60s to 120s. The proxy latency for initial prompt delivery on cold starts can exceed 60s.Long-term (proper fix): Make session creation async. Return
202 Acceptedimmediately after creating the CC process, then let the client poll for readiness or use SSE for status updates. Theag runstreaming path already works this way — the REST API should match.Environment
https://api.z.ai/api/anthropic)