[Bug] session_commit intermittently fails: streaming calls to Ark time out after retries exhaust — large commits hit it most
Issue Origin
Observed in a real local deployment (OpenViking v0.4.22, macOS, local server, Doubao VLM doubao-seed-2.1-lite via Ark plan gateway /api/plan/v3), 2026-09-30, ~15:30–20:30 CST.
Bug Description
session_commit tasks intermittently fail with ArkAPITimeoutError during Phase 2 (long_term / archive_summary, incl. the WM streaming path). The streaming response stalls beyond the client read timeout; retries exhaust; the whole commit task is marked failed.
Key characteristics:
- Dominant failure class: of ~37 Phase-2 step failures in the observed window, 35 were
Request timed out(the rest: 1 parse_error, 1 unrelated TypeError). - Non-deterministic: the same session that failed at 19:56 succeeded on a manual re-commit 25 min later (48.8 s, extracted 4 memories).
- Size-correlated: commits archiving 100–218 messages fail frequently; an 18-message commit passed in 49 s.
- Duration pattern ≈ read-timeout × attempts: 67 s / 120 s / 653 s / 869 s observed (vlm
timeout=180,max_retries=2). - Recoverable: failed sessions succeed when re-committed (verified), so impact is "memories missing until re-commit", not permanent loss.
- Queue amplification: SessionCommit queue is a single worker — a stalled commit blocks subsequent commits.
Evidence
Error (repeated, request ids differ):
volcenginesdkarkruntime._exceptions.ArkAPITimeoutError: Request timed out.,
request_id: ToB-direct,OpenViking_Service,openviking-service_cn-beijing,<hex>Traceback tail: streaming_batcher.flush → policy_trainer._process_batch → model_retry.retry_async → ark client request → httpcore.ReadTimeout (http11._receive_event)
Sample task ids (all session_commit, 2026-09-30 CST): 181463a7… (failed 10m53s, session with 51 archived msgs), 30df2d3a… (failed 527s, 218 archived msgs), 6044222c… (failed 869s), plus 32 more within GET /api/v1/tasks?status=failed.
Reproduction pointer: submit a large session commit while the upstream is slow; retries exhaust in model_retry.retry_async and the task ends failed (Result timed out).
Environment
- OpenViking v0.4.22 (uv tool install), Python 3.13 runtime
ov.conf:vlm.timeout=180,vlm.max_retries=2, provider volcengine,api_base=https://ark.cn-beijing.volces.com/api/plan/v3- Direct network for
*.volces.com/*.siliconflow.cn(NO_PROXY set), other traffic via local proxy
Ask
- Recommended
timeout/max_retriesfor the WM streaming path — any tuned defaults for large commits? - Is anything like the resource-aware scheduling in #4028 (and queue priority in #4578) on the roadmap? Long stalls blocking the single worker amplify this.
- Would it be reasonable to treat these as retryable at the phase level with backoff rather than failing the whole commit?
(Related: #4028, #4578. Happy to provide fuller logs via a private channel if useful.)
Source: volcengine/OpenViking