Hi everyone,
I am reporting a highly reproducible and somewhat hilarious edge-case bug I encountered while interacting with the model. The model consistently crashes or truncates its streaming output whenever it attempts to generate the standard Java main method signature, specifically the array notation.
This issue occurs in the Gemini 3.1 Pro Preview model from Google AI Studio.
Issue 1: Streaming Output Abruptly Halts
Whenever the model tries to output the phrase public static void main(String[] args), the streaming generation abruptly stops right after String or exactly at the left bracket [.
- This happened 4 consecutive times in a single session. The model completely loses its ability to finish the sentence and the stream just dies.
- My Hypothesis: This looks like a severe Markdown parsing issue in the frontend (where a standalone left bracket
[might be interpreted as the start of an unclosed markdown link, breaking the AST), a JSON serialization error in the backend, or a bizarre Tokenizer / EOS collision.
Issue 2: Chain of Thought (CoT) Containment Breach (Leakage)
After the model kept truncating, I explicitly instructed it: “Analyze why it crashed in your internal thoughts, but DO NOT output the bracket symbol in the final response.”
- Result: The model tried to obey and placed the cursed Java signature inside its hidden CoT process. However, the presence of the
[symbol inside the CoT apparently broke the CoT’s containment tags! The raw internal Chain of Thought process completely spilled out into the visible user response area.
Steps to Reproduce:
- Ask the model to: “type the exact Java main method signature:
public static void main(String[] args).” - Watch the output stream completely freeze and truncate.
- Next, instruct the model: “Put the Java signature in your hidden thoughts but don’t output it in the main text.”
- Observe the raw CoT text leaking into the UI.
Has anyone else experienced this specific “cyber curse” of the Java array symbol causing truncation and CoT leakage? I would love to hear any insights from the engineering team on what exactly is breaking under the hood!
Thank you!