Skip to content

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

@njuboy11

Description

@njuboy11

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.pycommit_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.pycommit_async(force=False): pass through to session
  4. sessions.py routerCommitRequest: 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions