fix(dialectic): pass custom_instructions to the dialectic prompt#906
fix(dialectic): pass custom_instructions to the dialectic prompt#906JoshKappler wants to merge 1 commit into
Conversation
The dialectic chat path fetched the resolved configuration but only ever read peer_card.use from it, so workspace/session custom_instructions were dropped before the prompt was built. The deriver already honors the same field, which meant instructions shaped how conclusions were written but not how the chat endpoint answered. Thread custom_instructions through DialecticAgent into agent_system_prompt and render it as a CUSTOM INSTRUCTIONS section, following the deriver's pattern. The section is built as a plain f-string rather than with cleandoc, since multi-line instructions drop the common margin to zero and would leave the surrounding block indented.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughDialectic chat now forwards workspace or session custom instructions into ChangesDialectic custom instructions
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
|
Finn-loop review of 60d23f6 CI: not configured ReviewThis PR threads 1. Must fix before merge
2. Should fix soonNone. 3. Safe to mergeYes on code merits — the change is focused (4 files, ~30 lines of logic + 134 lines of thorough tests). Both chat paths are updated consistently with the deriver's pattern. Tests cover rendering, omission (None/empty/whitespace), multiline formatting, agent propagation, workspace forwarding, and session-vs-workspace precedence. No security concerns, no scope creep. Labels to apply: |
Fixes #874. The dialectic chat path calls
get_configuration()but only readspeer_card.usefrom it, so workspace and sessioncustom_instructionsget dropped before the prompt is built. The deriver already honors that field, so instructions shaped how conclusions were written but had no effect on what the chat endpoint actually answered.This threads
custom_instructionsthroughDialecticAgentintoagent_system_promptand renders a CUSTOM INSTRUCTIONS section following the deriver's pattern, on both the streaming and non-streaming paths. I built the section as a plain f-string rather than withcleandoc, since multi-line instructions drop the common margin to zero and would leave the surrounding block indented.Tested with
uv run pytest tests/dialectic(11 passed) andtests/routes/test_peers.py(45 passed), with ruff and basedpyright clean. The two new chat-level tests fail if the kwarg is removed fromchat.py, and one of them pins session config overriding workspace config.Summary by CodeRabbit
New Features
Bug Fixes
Tests