Skip to content

Add client-managed chat history to RAO interactions#27

Closed
carlesonielfa wants to merge 12 commits into
mainfrom
client-managed-chat-history
Closed

Add client-managed chat history to RAO interactions#27
carlesonielfa wants to merge 12 commits into
mainfrom
client-managed-chat-history

Conversation

@carlesonielfa

Copy link
Copy Markdown

Description

Allows clients to supply the full conversation history on each request via a new chat_history field, enabling ephemeral sessions where the client owns conversation state rather than relying on server-side session storage.

  • InteractionRequest and StartInteraction gain a chat_history: Optional[List[HistoryQuestionAnswer]] field (default None, backward compatible). If it is supplied, even as an empty list, it overrides any server-side memory
  • QuestionMemory stores the client history and short-circuits context_history() and get_chat_history() to return it when set, overriding any server-side session history
  • Extracted _qa_list_to_context_string / _qa_list_to_chat_messages module-level helpers to eliminate duplication across session memory classes
  • Wired the field end-to-end: API → broker message → SessionManager.activate()start_question()engine.main()

[sc-14897]

How was this PR tested?

  • Unit test covering the override and fallback behaviour (test_memory_chat_history.py)
  • VCR integration test running rephrase + static context + summarize with client-supplied history, verifying the rephrased question incorporates the history and the final answer reflects it (test_chat_history_workflow.py)

@shortcut-integration

Copy link
Copy Markdown

This pull request has been linked to Shortcut Story #14897: Add chat history parameter in interaction.

@bloodbare bloodbare closed this Jun 4, 2026
@bloodbare bloodbare deleted the client-managed-chat-history branch June 4, 2026 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants