Re: b4 review available in master

Michael S. Tsirkin
2026-02-28T20:23:41Z

On Sat, Feb 28, 2026 at 03:06:34PM -0500, Konstantin Ryabitsev wrote:
> On Sat, Feb 28, 2026 at 01:31:04PM -0500, Michael S. Tsirkin wrote:
> > Amazing, thanks for working on this.
> >
> >
> > But I could not get it to work with gemini:
> > I have:
> >
> > [b4]
> > review-agent-command = gemini --sandbox --allowed-tools 'Bash(git:*) Read Glob Grep Write(.git/b4-review/**) Edit(.git/b4-review/**)'
> > review-agent-prompt-path = .git/agent-reviewer.md
>
> Thanks for testing it out. My most salient recent experience with gemini-cli
> is staring at:
>
> Trying to reach gemini-flash-3-preview (Attempt 6/10)
>
> and
>
> Agent reached max turns limit (10)
>
> (Sorry, Google people -- just stating facts.)
>
> However, I know the following things:
>
> 1. Gemini really doesn't like reading from the .git dir of the repository.
> 2. It also doesn't like writing to that dir.
> 3. In fact, it only likes writing to the toplevel of the git dir you're in,
> and into ~/.gemini/tmp/dirname/
>
> Gemini itself just recommended me to run with "gemini --approval-mode=yolo"
> which seems like a pretty terrible ideas.

On that, I'll send another message)

> However, I'm now looking at more
> RESOURCE_EXHAUSTED stack traces from gemini, so cannot test this further. If
> someone with a more reliable access to gemini-cli can recommend what is a
> better approach, I'm happy to implement it, otherwise I'll try again later
> when Gemini is less cranky.
>
> -K

The following seems to fix it.
I am also testing different models and some of them
interpet "Read the prompt" quite literally and just read it.
I think it's better to change that to "Read and execute".

-->

review: fix review with gemini cli

Gemini does not take -- before prompt. the prompt we supply can not
be mistaken for a flag, so it is not needed by any agents.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

---

diff --git a/src/b4/review_tui/_review_app.py b/src/b4/review_tui/_review_app.py
index e1c988e..12eb146 100644
--- a/src/b4/review_tui/_review_app.py
+++ b/src/b4/review_tui/_review_app.py
@@ -1313,7 +1313,7 @@ class ReviewApp(App[None]):
self.notify(f'Agent prompt file not found: {agent_prompt}',
severity='error')
return
- cmdargs += ['--', f'Read the prompt from {prompt_path}']
+ cmdargs += [f'Read the prompt from {prompt_path}']

with self.suspend():
logger.info('Running review agent: %s', ' '.join(cmdargs))