feat: inject session mode into persona system prompt

context_loader.load_context() now accepts a mode param ("chat"|"otr").
In OTR mode, the --- System --- block gains a second line:

  Current mode: Off The Record — this conversation is private
  and will not be logged or included in memory distillation

routers/chat.py passes mode="otr" when req.off_record is True.
Normal chat and all orchestrator calls stay at mode="chat" (no change
to the System block). The System block consolidates date/time and mode
in one place, matching the existing timestamp pattern.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-05-09 14:35:09 -04:00
parent 3a4f518300
commit 128d8a7c1e
2 changed files with 12 additions and 2 deletions

View File

@@ -95,6 +95,7 @@ async def _stream_chat(req: ChatRequest):
include_long=req.include_long,
include_mid=req.include_mid,
include_short=req.include_short,
mode="otr" if req.off_record else "chat",
)
history = load_session(session_id)
history.append({"role": "user", "content": req.message})