Skip to content

bug(acp): prompt delivery timeout still insufficient for BYO-LLM proxies (60s → 120s) #3243

Description

@OneStepAt4time

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2backendbugSomething isn't workingciin-developCode is merged to develop, not yet on mainperformancereleasedIncluded in a published release

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions