Compare commits

..
Author SHA1 Message Date
Peter Steinberger 551685351f fix: sanitize assistant session text (#1456) (thanks @zerone0x) 2026-01-23 07:05:31 +00:00
Peter Steinberger 3fbbac07fe fix: prioritize Anthropic token auth option 2026-01-23 07:04:18 +00:00
zerone0xandClaude 03bec49299 fix: sanitize tool call text in sessions-helpers extractAssistantText
Adds sanitization to extractAssistantText in sessions-helpers.ts to
prevent tool call text from leaking to users. Previously, messages
retrieved from chat history via sessions-helpers.ts could expose:

- Minimax XML tool calls (<invoke>...</invoke>)
- Downgraded tool call markers ([Tool Call: name (ID: ...)])
- Thinking tags (<think>...</think>)

This fix:
- Exports the stripping functions from pi-embedded-utils.ts
- Adds a new sanitizeTextContent helper in sessions-helpers.ts
- Updates extractAssistantText to sanitize before returning
- Updates extractMessageText in commands-subagents.ts to sanitize

Fixes #1269

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-23 07:03:26 +00:00
Peter Steinberger 6779ba2367 fix(tui): hide off think/verbose in footer 2026-01-23 07:02:56 +00:00
2 changed files with 11 additions and 6 deletions

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ const AUTH_CHOICE_GROUP_DEFS: {
value: "anthropic", value: "anthropic",
label: "Anthropic", label: "Anthropic",
hint: "Claude Code CLI + API key", hint: "Claude Code CLI + API key",
choices: ["claude-cli", "token", "apiKey"], choices: ["token", "claude-cli", "apiKey"],
}, },
{ {
value: "minimax", value: "minimax",
+10 -5
View File
@@ -452,11 +452,16 @@ export async function runTui(opts: TuiOptions) {
const reasoning = sessionInfo.reasoningLevel ?? "off"; const reasoning = sessionInfo.reasoningLevel ?? "off";
const reasoningLabel = const reasoningLabel =
reasoning === "on" ? "reasoning" : reasoning === "stream" ? "reasoning:stream" : null; reasoning === "on" ? "reasoning" : reasoning === "stream" ? "reasoning:stream" : null;
footer.setText( const footerParts = [
theme.dim( `agent ${agentLabel}`,
`agent ${agentLabel} | session ${sessionLabel} | ${modelLabel} | think ${think} | verbose ${verbose}${reasoningLabel ? ` | ${reasoningLabel}` : ""} | ${tokens}`, `session ${sessionLabel}`,
), modelLabel,
); think !== "off" ? `think ${think}` : null,
verbose !== "off" ? `verbose ${verbose}` : null,
reasoningLabel,
tokens,
].filter(Boolean);
footer.setText(theme.dim(footerParts.join(" | ")));
}; };
const { openOverlay, closeOverlay } = createOverlayHandlers(tui, editor); const { openOverlay, closeOverlay } = createOverlayHandlers(tui, editor);