Skip to content

fix: filter out model thinking text from transcript#136

Merged
ComBba merged 1 commit into
mainfrom
fix/filter-thinking-text
Feb 26, 2026
Merged

fix: filter out model thinking text from transcript#136
ComBba merged 1 commit into
mainfrom
fix/filter-thinking-text

Conversation

@ComBba

@ComBba ComBba commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Filter out Gemini model's internal thinking/reasoning text from transcript display
  • Native audio models (gemini-2.5-flash-native-audio) output part.Thought=true for chain-of-thought reasoning before speaking
  • Previously this was shown to users (e.g. "Refining the Onboarding I've finalized the onboarding response...")
  • Now only non-thinking text parts are forwarded to the browser as transcript

Changes

File Change
internal/live/proxy.go Add !part.Thought check in handleServerContent

E2E Verification

Tested on deployed Cloud Run (missless-00020-4vc):

  • Before: Model thinking text like "Refining the Onboarding..." displayed as transcript
  • After: Clean session screen with no internal reasoning visible
  • Audio greeting plays normally
  • Mic recording indicator shows correctly

Local CI

  • Go vet passed
  • Go test -race passed (live, session, handler packages)

Test plan

  • Connect to the app, click "Begin Reunion"
  • Verify no internal reasoning text appears in the transcript overlay
  • Verify AI voice greeting plays as expected

🤖 Generated with Claude Code

Summary by CodeRabbit

릴리스 노트

  • 버그 수정
    • 트랜스크립트에서 모델의 내부 사고 과정 및 추론 부분이 더 이상 포함되지 않습니다. 이를 통해 트랜스크립트가 더욱 명확하고 관련 있는 콘텐츠만 캡처하도록 개선되었습니다.

Native audio models output internal reasoning as part.Text with
part.Thought=true. This was being shown to users as transcript
(e.g. "Refining the Onboarding I've finalized..."). Now only
non-thinking text is forwarded to the browser.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @ComBba, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request improves the user experience by preventing the display of internal reasoning or "thinking" text generated by the Gemini model in the live transcript. By filtering out these internal thoughts, the user interface now presents a cleaner and more focused conversation, ensuring that only spoken content is shown to the user.

Highlights

  • Transcript Filtering: Implemented filtering to prevent the Gemini model's internal thinking/reasoning text (where part.Thought is true) from being displayed in the user-facing transcript.
  • User Experience Improvement: Enhanced the user experience by ensuring only relevant, non-thinking text parts are forwarded to the browser as transcript, removing previously visible internal model reasoning.
Changelog
  • internal/live/proxy.go
    • Added a conditional check !part.Thought to the if part.Text != "" statement within the handleServerContent function, ensuring that model thinking text is not processed as part of the transcript.
    • Updated comments to reflect the new filtering logic for non-thinking transcript.
Activity
  • End-to-end verification was performed on a deployed Cloud Run instance, confirming that model thinking text is no longer displayed, while audio greetings and mic indicators function correctly.
  • Local CI checks, including Go vet and Go test -race for live, session, and handler packages, passed successfully.
  • A test plan was provided to guide manual verification of the fix.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai

coderabbitai Bot commented Feb 26, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4691e64 and 8786e3b.

📒 Files selected for processing (1)
  • internal/live/proxy.go

개요

handleServerContent 함수의 트랜스크립트 처리 로직이 수정되어, part.Text가 비어있지 않고 part.Thought가 거짓일 때만 트랜스크립트가 처리됩니다. 모델의 생각/추론 부분은 이제 제외되며, PCM 오디오 처리는 변경되지 않습니다.

변경사항

코호트 / 파일(들) 요약
트랜스크립트 처리 필터링
internal/live/proxy.go
handleServerContent에서 비어있지 않은 텍스트 부분과 생각 부분이 아닌 경우만 트랜스크립트를 처리하도록 조건부 로직 수정. 모델 추론 트랜스크립트는 더 이상 캡처 또는 전달되지 않음.

코드 리뷰 예상 소요 시간

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 생각하는 부분은 이제 빠져나가고,
진짜 말만 쏙쏙 남겨 두네요!
텍스트 확인, 생각 필터링,
깔끔한 흐름으로 변신~
작지만 정확한 수정이야! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and concisely describes the main change: filtering out model thinking text from the transcript, which is the primary objective of this changeset.
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 (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/filter-thinking-text

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request correctly filters out the Gemini model's internal thinking text from the user-facing transcript by adding a !part.Thought check. This is a good fix that prevents internal reasoning from being displayed to the user or used by other tools. The related code comments have also been updated to reflect this change. I've added one suggestion to improve test coverage for this new logic to ensure it's robust against future changes.

@ComBba ComBba merged commit 89088ce into main Feb 26, 2026
8 of 9 checks passed
@ComBba ComBba deleted the fix/filter-thinking-text branch February 26, 2026 02:05
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.

1 participant