feat: conversation history threading in ModelCompletionRequest#6
feat: conversation history threading in ModelCompletionRequest#6
Conversation
…tion_history Add conversation_history field to ModelCompletionRequest so providers receive multi-turn context. KernelRuntime::build_conversation_history() reads the event journal and reconstructs user/assistant turns from DeliberationProposed, Message, TextDelta, and RunFinished events. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… adapter Thread prior conversation turns (from aiOS ConversationTurn) into ChatMessage array sent to the LLM. Inserts history between system prompt and current objective. Depends on: broomva/aiOS#6 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe pull request extends the protocol to include conversation history tracking. A new Changes
Sequence Diagram(s)sequenceDiagram
participant Runtime as KernelRuntime
participant EventStore as Event Store
participant Provider as Model Provider
Runtime->>Runtime: tick_on_branch(session_id, branch_id)
Runtime->>EventStore: read_events(session_id, branch_id, seq: 0, limit: 10000)
EventStore-->>Runtime: events[]
Runtime->>Runtime: build_conversation_history()
Note over Runtime: Extract user turns from<br/>DeliberationProposed<br/>Extract assistant text from<br/>Message & TextDelta<br/>Aggregate into turns<br/>Cap at 50 most recent
Runtime->>Runtime: Create ModelCompletionRequest<br/>with conversation_history
Runtime->>Provider: complete(request)
Provider-->>Runtime: response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Adds ConversationTurn type and build_conversation_history() to KernelRuntime. Fixes multi-turn memory loss.
Generated with Claude Code
Summary by CodeRabbit