OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

feat: Add force parameter to commit to skip blocking failed archives

Open njuboy11 opened this issue 5 months ago • 1 comments

Problem

A single transient failure (VLM timeout, SSL error, etc.) during Phase 2 (memory extraction) writes a .failed.json marker that permanently blocks all future commits on that session. There is no auto-recovery, no retry, and no admin API to clear it.

Reproduction

  1. Session commits successfully through Phase 1 (archive)
  2. Phase 2 memory extraction fails (e.g. VLM 180s timeout, SSL cert error)
  3. .failed.json is written to the archive directory
  4. All subsequent POST /sessions/{id}/commit calls return FAILED_PRECONDITION
  5. The session is permanently locked — only manual deletion of .failed.json fixes it

Impact

Any transient infrastructure failure (network, LLM timeout, SSL) permanently kills the session until manual intervention.

Proposed Solution

Add a force: bool = False parameter to the commit flow that skips the blocking-failed-archive check. When force=True, commit proceeds despite unresolved .failed.json markers.

Changes Required

  1. session.py — commit_async(force=False): skip _get_blocking_failed_archive_ref() when force=True
  2. session.py — _run_memory_extraction(force=False): skip _wait_for_previous_archive_done() when force=True (this is the Phase 2 check that was missed in the initial fix)
  3. session_service.py — commit_async(force=False): pass through to session
  4. sessions.py router — CommitRequest: add force: bool = False field

The default force=False preserves existing behavior. Clients that understand the failure mode can opt-in to force=True.

Additional Context

This is particularly impactful when used as an OpenClaw context engine plugin, where the afterTurn hook auto-commits. A single VLM timeout locks the session forever with no user-visible way to fix it.

njuboy11 avatar Jun 06 '26 05:06 njuboy11

Fixed by https://github.com/volcengine/OpenViking/pull/2775.

The final implementation does not add a force parameter. Instead, failed session archives are now treated as a skippable terminal state: a .failed.json archive no longer blocks later commits, and subsequent POST /sessions/{id}/commit calls can proceed normally.

Closing this as resolved.

Mijamind719 avatar Jun 23 '26 13:06 Mijamind719