Skip to content

[Bug]: Leftover debug console.log statements leak tool-call data in production in ai-chat-panel.tsx` #459

@Rishabhworkspace

Description

@Rishabhworkspace

Short summary

Two console.log calls used to debug AI SDK v3 tool-call integration were never removed from ai-chat-panel.tsx and remain active in production, logging internal tool data on every message update.

Steps to reproduce

  1. Open any playground in Editron.
  2. Open the AI Chat panel (Ctrl+Shift+A or via sidebar).
  3. Open browser DevTools → Console tab.
  4. Send a message that triggers a tool call (e.g. "Read my package.json").
  5. Observe console output.

Expected behavior

No debug logs should appear in the browser console in a production build. Internal tool call details (tool names, call IDs, file paths, partial file content) should not be exposed.

Actual behavior

The following two logs fire inside a hot useEffect on every messages state update:

  • Line 176 — logs the full serialised tool-parts array for every assistant message:
    [AIChatPanel] Tool parts in last message: [{ "type": "tool-read_file", "toolCallId": "...", ... }]
    
  • Line 302 — logs every tool execution result including file path and a content snippet:
    [AIChatPanel] Executed tool read_file (call_abc123), result: // contents of src/index.ts...
    

This fires dozens of times per streaming response, serialising potentially large JSON strings per render.

Affected area

AI chat or completion

Environment

Any browser. Reproducible in both local development and production deployments whenever the AI Chat panel is open and a tool-calling message is sent.

Screenshots, logs, or recordings

No response

Confirmation

  • I searched existing issues before opening this report.
  • I included enough detail for reproduction.

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions