Skip to content

[Bug]: Session search context contract mismatch (summary/summaries key + List[str]/str type) #493

@lixingjia77

Description

@lixingjia77

Bug Description

Description
There is an end-to-end contract mismatch in session-aware search.

Session.get_context_for_search() produces summaries (plural) as a list:

# openviking/session/session.py
return {
    "summaries": summaries,
    "recent_messages": recent_messages,
}

But VikingFS.search() reads summary (singular):

# openviking/storage/viking_fs.py
session_summary = session_info.get("summary") if session_info else None
recent_messages = session_info.get("recent_messages") if session_info else None

And the downstream analyzer expects a string, not a list:

# openviking/retrieve/intent_analyzer.py
async def analyze(
    self,
    compression_summary: str,
    messages: List[Message],
    ...
) -> QueryPlan:

So there are two issues:

  1. Key mismatch (summaries vs summary) causes session summary context to be skipped.
  2. Even after key alignment, value type still mismatches (List[str] -> expected str) unless normalized before calling IntentAnalyzer.

Impact
Session summary context may be ignored or inconsistently passed into intent analysis, degrading multi-turn retrieval quality.

Expected behavior
Use one consistent contract across producer/consumer:

  • unified key name
  • unified value type (or explicit normalization at the boundary before IntentAnalyzer.analyze).

Steps to Reproduce

as described above

Expected Behavior

as described above

Actual Behavior

as described above

Minimal Reproducible Example

Error Logs

OpenViking Version

0.2.5

Python Version

3.12.9

Operating System

Linux

Model Backend

None

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions