Skip to content

Conversation

@abrugaro
Copy link
Contributor

@abrugaro abrugaro commented Feb 10, 2026

Resolves #1129

Summary by CodeRabbit

  • Bug Fixes
    • Improved extraction and processing of text content from structured AI-generated streaming responses, ensuring more reliable handling of streamed messages.
    • Reduces serialized artifacts and missing fragments in streams for smoother, more accurate text display during live AI replies.
    • Users will see fewer formatting glitches and better continuity in streamed reply text.

@abrugaro abrugaro self-assigned this Feb 10, 2026
@abrugaro abrugaro requested a review from a team as a code owner February 10, 2026 16:52
@snyk-io
Copy link

snyk-io bot commented Feb 10, 2026

Snyk checks have failed. 1 issues have been found so far.

Status Scanner Critical High Medium Low Total (1)
Open Source Security 0 0 1 0 1 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

The handler for KaiWorkflowMessageType.LLMResponseChunk in processMessage now treats chunk.content arrays by filtering elements with type === "text" and string text values, then concatenating those text fields into a single string. Previously non-string array items were serialized with JSON.stringify; now only textual parts are extracted and joined, aligning array-based streaming content with existing string handling.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description only contains 'Resolves #1129' without providing details about the change, implementation approach, or reasoning beyond referencing the linked issue. Expand the description to explain what was changed and how it addresses the issue (e.g., the array filtering logic added to handle text-only content).
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title ':bug: Avoid displaying Gemini tool calls' clearly describes the main change and follows the repository's emoji prefix convention for patch fixes.
Linked Issues check ✅ Passed The code change filters array content to extract only text parts, which directly addresses the issue of displaying Gemini tool calls by suppressing non-text debug information.
Out of Scope Changes check ✅ Passed The modification to processMessageByType is narrowly scoped to filtering LLMResponseChunk array content for text parts only, directly supporting the issue's objective of suppressing tool call display.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@vscode/core/src/utilities/ModifiedFiles/processMessage.ts`:
- Around line 304-308: In processMessage, when handling the
Array.isArray(chunk.content) branch, guard against arrays that contain only
non-text tool-call parts: compute the filtered list (e.g., filteredTexts =
chunk.content.filter(...).map(...)) and if filteredTexts.length === 0 then skip
creating/using content (e.g., return early or continue so no empty string is
propagated), otherwise set content = filteredTexts.join(""); ensure this uses
the existing chunk.content and content variables so downstream code (message
append logic) never receives an empty "" chat message.

Signed-off-by: Alejandro Brugarolas <[email protected]>
@abrugaro abrugaro force-pushed the 1129-agent-tool-calls branch from 645da7c to 91d4c9a Compare February 11, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent mode messages display tool calls when using Gemini

1 participant