Skip to content

Add client-managed chat history to RAO interactions#30

Open
carlesonielfa wants to merge 2 commits into
mainfrom
client-managed-chat-history-v2
Open

Add client-managed chat history to RAO interactions#30
carlesonielfa wants to merge 2 commits into
mainfrom
client-managed-chat-history-v2

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)

@carlesonielfa carlesonielfa requested a review from a team June 5, 2026 06:21
@shortcut-integration

Copy link
Copy Markdown

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

bloodbare
bloodbare previously approved these changes Jun 12, 2026
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.

4 participants