Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(desktop): hide internal logs from session chat (#87527)

Peter Kirkhame63020dc5845
diff --git a/products/desktop/packages/ui/src/features/sessions/components/buildConversationItems.test.ts b/products/desktop/packages/ui/src/features/sessions/components/buildConversationItems.test.ts
index 2e728e01d5cb..175d4b4db8aa 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/buildConversationItems.test.ts
+++ b/products/desktop/packages/ui/src/features/sessions/components/buildConversationItems.test.ts
@@ -801,10 +801,12 @@ describe("buildConversationItems", () => {
});
});
- it("hides debug-level console logs by default and renders them inline when showDebugLogs is true", () => {
+ it("hides internal console logs by default and renders them inline when showDebugLogs is true", () => {
const events: AcpMessage[] = [
progressMsg(1, "sandbox", "in_progress", "Setting up sandbox"),
consoleMsg(2, "sandbox provisioned", "debug"),
+ consoleMsg(3, "handoff skipped", "warn"),
+ consoleMsg(4, "checkpoint captured", "info"),
];
const hidden = buildConversationItems(events, null);
@@ -819,11 +821,11 @@ describe("buildConversationItems", () => {
showDebugLogs: true,
});
expect(
- shown.items.some(
+ shown.items.filter(
(i) =>
i.type === "session_update" && i.update.sessionUpdate === "console",
),
- ).toBe(true);
+ ).toHaveLength(3);
});
it("emits no progress group for a conversation without progress notifications", () => {
diff --git a/products/desktop/packages/ui/src/features/sessions/components/buildConversationItems.ts b/products/desktop/packages/ui/src/features/sessions/components/buildConversationItems.ts
index dcba0fdf6b17..73199a0ef44e 100644
--- a/products/desktop/packages/ui/src/features/sessions/components/buildConversationItems.ts
+++ b/products/desktop/packages/ui/src/features/sessions/components/buildConversationItems.ts
@@ -774,7 +774,7 @@ function handleNotification(
const params = msg.params as { level?: string; message?: string };
if (!params?.message) return;
const level = params.level ?? "info";
- if (level === "debug" && !options?.showDebugLogs) return;
+ if (!options?.showDebugLogs) return;
ensureImplicitTurn(b, ts);
pushItem(b, {
sessionUpdate: "console",