Gemini reject function call on exit 1?

The interactive chat can run my go tests. However the function call is rejected if the test itself fails, the result is “Please, explain the reason for rejecting the last function call. I need to understand why it was rejected to improve my responses.”

This behaviour is shown in the screenshot:

If the test is successful it works well. If I run the test as go test -v ./... || true

I believe it is related to the exit code of the terminal, Gemini thinks the test failed because the exit code indicates an fail.

My workaround is to write it to a file and ask Gemini to read the file. Or run the command as bash -c '(set -o pipefail && go test -v ./... 2>&1 | tee /tmp/ai.1.log); exit 0'

Is there a better way/can we make Gemini understand that a faild test is not a rejected call?

2 Likes

I do not know the answer here, but I just wanted to say that this is an extremely interesting question. I say this, because most solutions now are looking for the user asking the agent what the reason for the failure is. Am I even reading your screenshot correctly? Is it actually the agent asking you to explain to the agent the failure?

1 Like

It is this behaviour:

In my case the test fails with an exit 1 and I believe that Gemini sees that as a rejected function call and does not read the output.

1 Like

Well that shows that same red X, which is corroboration that the UI is linked to the exit code (as expected). But what that doesn’t show is Gemini asking you to explain to Gemini the reason for the failure. That’s what’s really surprising to me, because the bleeding edge with “vibe coding” - and really the industry trend in general - is the precise opposite.

Looking into it more, I’m wondering if this is an interactive Gemini issue or if it’s more related to how the vscode fork runs tasks. Hard to say without it being open source. Regardless, you’ll probably get more Google eyeballs on this tomorrow. I just thought the Gemini response was so weird though.

1 Like

Tagging our AI experts, @ali and @ksat to see what we can do here.

2 Likes