Skip to content

CB TE cannot create new conversations — add "new" conversation_id support #1

Description

@rmdevpro

Problem

The CB TE has no way to create a new conversation via the OpenAI endpoint. If no conversation_id is passed, it always falls back to the single persistent Imperator conversation. The get_context response includes a conversation_id but the Imperator ignores it, and the chat response never returns it to the client.

Context

The pMAD template is being split into two base TE packages:

  • base-pmad-te-ncb — PostgresSaver-backed, no CB dependency (default)
  • base-pmad-te-cb — CB-backed, calls get_context/store_message

Both will support three modes via the conversation_id field on the OpenAI endpoint:

  1. Pass an ID → resume that conversation
  2. Pass nothing → resume the default Imperator thread
  3. Pass "new" → create a new conversation, return its ID in the response

The nCB variant handles this natively via LangGraph PostgresSaver thread_ids. The CB variant needs to:

  • When receiving "new", call get_context without a conversation_id so the CB creates one
  • Capture the returned conversation_id from the get_context response (currently ignored at imperator_flow.py init_context_node)
  • Return the conversation_id in the chat completions response (currently missing)

What needs to change in context-broker

  1. The TE init_context_node must read and propagate the conversation_id from the get_context response
  2. The chat response must include the conversation_id so clients can continue the conversation
  3. Support the "new" sentinel value to trigger new conversation creation

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions