Replace XML tags with markdown formatting in chat prompts#205
Conversation
…t compatibility The chat engine's buildPrompt() method used <system> and <conversation> XML tags to wrap the system prompt and history. This caused OpenCode CLI (and potentially other agents) to timeout when processing the prompt via stdin, as the angle-bracket tags may be interpreted as protocol markers by the CLI tool's input parser. Replace with markdown headers (## Instructions, ## Conversation History, ## Current Request) which matches the format used by the ralph-tui run engine templates that work correctly with all agents. Fixes #204 https://claude.ai/code/session_014bffPdJT7UX84NpCw7zxig
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
WalkthroughPrompt assembly in the chat engine was reformatted from XML-like tags to Markdown sections ( Changes
Sequence Diagram(s)(omitted — changes are formatting and tests, no new multi-component control flow) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #205 +/- ##
==========================================
+ Coverage 44.23% 44.88% +0.65%
==========================================
Files 84 84
Lines 24229 24231 +2
==========================================
+ Hits 10718 10877 +159
+ Misses 13511 13354 -157
🚀 New features to boost your workflow:
|
Adds tests verifying the ChatEngine.buildPrompt() method uses markdown headers instead of XML tags for CLI agent compatibility: - Uses ## Instructions instead of <system> tags - Uses ## Conversation History instead of <conversation> tags - Uses ## Current Request for the user message - Does not end with bare Assistant: marker - Sections appear in correct order - Respects maxHistoryMessages limit - Includes User:/Assistant: role prefixes in history https://claude.ai/code/session_014bffPdJT7UX84NpCw7zxig
…-V8Zcy Replace XML tags with markdown formatting in chat prompts
Summary
Updated the prompt building logic in ChatEngine to use markdown formatting instead of XML tags for better compatibility with CLI agents that may interpret angle-bracket tags as protocol markers.
Changes
<system>XML tags with## Instructionsmarkdown header<conversation>XML tags with## Conversation Historymarkdown header## Current Requestmarkdown header for the current user messageAssistant:prompt suffix to allow agents more flexibility in response formattingImplementation Details
User:andAssistant:prefixes for clarity within the history sectionSummary by CodeRabbit
Refactor
Tests
✏️ Tip: You can customize this high-level summary in your review settings.