Skip to content

fix(session): never write a failure marker next to .done - #6080

Closed
OnePerson2020 wants to merge 1 commit into
volcengine:mainfrom
OnePerson2020:fix/archive-done-no-failed-marker
Closed

OnePerson2020 wants to merge 1 commit into
volcengine:mainfrom
OnePerson2020:fix/archive-done-no-failed-marker

Conversation

@OnePerson2020

Copy link
Copy Markdown
Contributor

Description

_run_memory_extraction writes .done and then records the task result in the same try; if anything after .done fails (e.g. the task store), the except handler writes .failed.json next to it. terminal_state reads .done first, so the archive is completed, but the failure marker remains as a contradictory record. _write_failed_marker, which every failure path goes through, now skips (with a warning) an archive that already has .done.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Fixes #6078

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Session._write_failed_marker: return early when the archive has .done.
  • New test test_phase2_failure_after_done_does_not_mark_archive_failed (Phase 2 completes, tracker.complete raises).

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows
echo '{}' > /tmp/min.conf
OPENVIKING_CONFIG_FILE=/tmp/min.conf uv run --extra test pytest tests/unit/session tests/session -q --no-cov --ignore=tests/session/test_session_commit_race.py
uv run --extra dev ruff check openviking/session/session.py tests/unit/session/test_session_commit_resume.py
uv run --extra dev ruff format --check openviking/session/session.py tests/unit/session/test_session_commit_resume.py
git diff --check
  • Without the code change the new test fails (.failed.json written next to .done); with it, it passes.
  • tests/unit/session + tests/session: 1561 passed with the change; the only difference from main is the new test (the 37 failed / 116 errors are identical before and after in my environment — vectordb engine / full-config tests; test_session_commit_race.py hangs on main locally, so it is excluded). Ruff and git diff --check clean.

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Additional Notes

No API or data-format change; no new dependency.

🤖 Generated with Claude Code

@ZaynJarvis ZaynJarvis added the kernel Core server, runtime, storage, retrieval, SDK, and CLI. label Oct 15, 2026
@qin-ctx

qin-ctx commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Thanks for reporting this! The task-result persistence failure is now addressed by merged PR #6153: the existing .done write runs after the task result is saved.

Skipping only .failed.json would still allow the task to be marked failed while the archive is marked completed. Closing this PR in favor of #6153.

@qin-ctx qin-ctx closed this Oct 16, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Oct 16, 2026
OnePerson2020 pushed a commit to OnePerson2020/OpenViking that referenced this pull request Oct 16, 2026
…ne#6153, upgrade notes for main 2026-10-16

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OnePerson2020 pushed a commit to OnePerson2020/OpenViking that referenced this pull request Oct 16, 2026
…ine#6153)

Cherry-pick of volcengine#6153 (merged 2026-10-16, replaces our
closed volcengine#6080). A failure saving the task result used to leave .done next to a
failed task. .done still lands before the queue work is released, so
_can_run_archive's predecessor re-check is unaffected. Test fails on the
previous order. Drop on the next upgrade past volcengine#6153.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kernel Core server, runtime, storage, retrieval, SDK, and CLI.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: A completed archive can get .failed.json next to .done

3 participants