Skip to content

fix(session): restore messages from completed archives when messages.jsonl is empty#3198

Open
fangtang0206 wants to merge 1 commit into
volcengine:mainfrom
fangtang0206:fix/session-context-empty-when-archived
Open

fix(session): restore messages from completed archives when messages.jsonl is empty#3198
fangtang0206 wants to merge 1 commit into
volcengine:mainfrom
fangtang0206:fix/session-context-empty-when-archived

Conversation

@fangtang0206

Copy link
Copy Markdown

Problem

When a session is archived (messages.jsonl cleared), get_session_context() returns empty messages because _get_pending_archive_messages() only reads archives with index > latest_completed_index (pending archives).

This causes the OV Studio panel to show empty session history for archived sessions.

Fix

Added a fallback in get_session_context() that reads messages from completed archives when merged_messages is empty, ensuring the session panel shows the full conversation history.

Files

  • openviking/session/session.py: +15 lines in get_session_context()

Verification

curl call to /api/v1/sessions/{id}/context with the session API key returns the archived messages correctly.

Fixes #1550

…jsonl is empty

When a session is archived (messages.jsonl cleared), get_session_context()
was returning empty messages because _get_pending_archive_messages() only
reads archives with index > latest_completed_index (pending archives).

This adds a fallback in get_session_context() that reads from completed
archives when merged_messages is empty, ensuring the session panel shows
the full conversation history.

Fixes Issue volcengine#1550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Session API reports zero message/commit counts even though archive and fallback files are written

1 participant