Repository navigation
Studio: do not run Gemma tool call examples written inside code blocks - #11153
Conversation
…, not a tool call
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d81ecee61
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0946729625
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Confirmed that on main the bare Gemma |
…call arguments A raw Gemma call body can contain a fence or backtick run, and the markdown code gate scanned it as prose, so the next bare call was treated as quoted: parsed as nothing and left visible. The parser and the display strip now rescan code spans from the end of a promoted call whenever a span runs out of its arguments, which keeps the common case linear. Also covers tilde fences quoting backtick fences and vice versa, drops a no-op lookahead from the fence pattern, and tightens the related docstrings.
# Conflicts: # tests/studio/playwright_queue_localization.py
|
Pushed a follow-up fix and merged the latest Fix: a fence or backtick run inside a promoted Gemma call's own arguments was scanned as markdown code, so the next wrapper-less call in the same turn was treated as a quoted example: it did not run and stayed visible. For example, Also:
Validation: |
|
@codex review |
Lyxot
left a comment
There was a problem hiding this comment.
LGTM. Fixes a real issue: Gemma call syntax quoted in markdown code no longer runs a tool, and parsing, display stripping and streaming detection agree on it. Verified locally and on staging CI; remaining Codex notes are out-of-scope tokenizer edge cases, answered in the threads.
unslothai#11153) * Studio: treat Gemma call syntax inside markdown code as documentation, not a tool call * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Studio: close nested code fences correctly and keep inline Gemma examples streaming * Studio: match inline backtick runs by length when holding streamed Gemma examples * fix(studio): keep sibling Gemma calls promotable past code opened in call arguments A raw Gemma call body can contain a fence or backtick run, and the markdown code gate scanned it as prose, so the next bare call was treated as quoted: parsed as nothing and left visible. The parser and the display strip now rescan code spans from the end of a promoted call whenever a span runs out of its arguments, which keeps the common case linear. Also covers tilde fences quoting backtick fences and vice versa, drops a no-op lookahead from the fence pattern, and tightens the related docstrings. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lyxot <[email protected]>
If you asked Gemma 4 to show the tool call syntax, it wrote call:web_search{...} inside a code block and Studio ran a real search. The example was also removed from the reply, leaving an empty code block.
A bare call inside a fenced block or inline code is now treated as text. It is not run, not picked up while streaming, and stays visible. Real tool calls with Gemma's own tokens are unchanged.
Tested with new unit tests and with Gemma 4 E4B in the chat UI: the code block stays and no search runs, while a normal search request still works.