feat: off the record mode (OTR)

Adds a third input mode toggle alongside Note and Agent. When active:
- Textarea gets a subtle purple tint with dashed border
- OTR button highlights purple
- Placeholder reads "Off the record — not logged or distilled…"
- off_record=True is sent to /chat; session_logger is skipped
- In-memory session context is preserved within the session

Switching to Note or Agent mode deactivates OTR, and vice versa.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-03-26 21:07:21 -04:00
parent b3f40cf437
commit fa04b5e6b0
4 changed files with 53 additions and 1 deletions

View File

@@ -80,11 +80,35 @@
agentModeBtnEl.addEventListener('click', () => {
agentMode = !agentMode;
if (agentMode) { otr_mode = false; update_otr_ui(); }
localStorage.setItem('agentMode', agentMode);
updateAgentModeUI();
inputEl.focus();
});
// ── Off the record mode ──────────────────────────────────────
let otr_mode = false;
const otr_btn_el = document.getElementById('otr-btn');
function update_otr_ui() {
otr_btn_el.classList.toggle('active', otr_mode);
inputEl.classList.toggle('otr-mode', otr_mode);
updateInputPlaceholder();
}
otr_btn_el.addEventListener('click', () => {
otr_mode = !otr_mode;
if (otr_mode) {
agentMode = false;
noteMode = false;
localStorage.setItem('agentMode', false);
updateAgentModeUI();
updateInputMode();
}
update_otr_ui();
inputEl.focus();
});
// ── Note mode ────────────────────────────────────────────────
let noteMode = false;
let notePublic = false;
@@ -124,6 +148,8 @@
inputEl.placeholder = ctrlEnterMode
? `Task for ${personaLabel}… (Gemini tool loop — Ctrl+Enter to run)`
: `Task for ${personaLabel}… (Gemini tool loop)`;
} else if (otr_mode) {
inputEl.placeholder = `Off the record — not logged or distilled…`;
} else {
inputEl.placeholder = ctrlEnterMode
? `Message ${personaLabel}… (Ctrl+Enter to send)`
@@ -133,6 +159,7 @@
noteBtnEl.addEventListener('click', () => {
noteMode = !noteMode;
if (noteMode) { otr_mode = false; update_otr_ui(); }
updateInputMode();
inputEl.focus();
});
@@ -690,6 +717,7 @@
include_long: memLong,
include_mid: memMid,
include_short: memShort,
off_record: otr_mode,
user: CORTEX_USER,
persona: CORTEX_PERSONA,
}),