Skip to content

perf(session): skip live content loading for deferred and terminal commits - #6180

Closed
OnePerson2020 wants to merge 1 commit into
volcengine:mainfrom
OnePerson2020:perf/defer-queued-session-load
Closed

OnePerson2020 wants to merge 1 commit into
volcengine:mainfrom
OnePerson2020:perf/defer-queued-session-load

Conversation

@OnePerson2020

@OnePerson2020 OnePerson2020 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Description

Every SessionCommit redelivery currently loads the live conversation before checking whether the archive is already terminal or is waiting for its predecessor. Long-running predecessors therefore cause repeated message reads and parsing for work that cannot run yet. Load the session inside resume_queued_commit only after the terminal and predecessor checks pass.

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

Related to #6083, which addresses lock-contention requeue and retry pacing. This patch independently removes unnecessary live-content loading; it does not change retry timing or exception policy.

Type of Change

  • Performance improvement
  • Test update

Changes Made

  • Move session.load from the queue processor to the ready-to-run path in resume_queued_commit.
  • Cover waiting, completed, failed, and ready archives through the actual queue processor and Session resume method.
  • Keep task registration, identity binding, Phase 1 reconciliation, and archive recovery checks intact.

Testing

  • The new parameterized test fails on main for waiting, completed, and failed deliveries, and passes for a ready delivery before the fix; all four cases pass after it.
  • Deferred-load, processor identity, and session-resume suites: 24 passed on macOS.
  • Ruff check and git diff --check passed.

Additional Notes

CI follow-up (2026-10-16): the API/CLI job in run 38899528099 fails in five filesystem/test_fs_cp.py cases while preparing source files. With HAS_SECRETS=false, those setup writes wait for embedding and receive HTTP 500 wrapping an HTTP 401 from the dummy model key. The same failures occur on #6179 and #6181. Existing PR #6162 fixes the no-secret prerequisites and its integration run 38864737070 passed. Plugin, plugin-version, and dependency checks passed here; this integration check remains failed pending that independent CI fix.

Based on main 7c34e43, including #6175. No new configuration, queue schema, background scheduler, or timing change. The optimization removes per-redelivery loading; it does not eliminate requeues themselves.

@OnePerson2020

Copy link
Copy Markdown
Contributor Author

Superseded by #6332, which removes the live session load from Phase 2 entirely. After rebasing onto main this branch would only add a load back, so closing.

@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Nov 2, 2026
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.

2 participants