Skip to content

race condition on error #332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DinoChiesa opened this issue Mar 24, 2025 · 0 comments
Open

race condition on error #332

DinoChiesa opened this issue Mar 24, 2025 · 0 comments

Comments

@DinoChiesa
Copy link
Contributor

DinoChiesa commented Mar 24, 2025

When the Google API returns an error, there appears to be a race condition in shell-maker.el, which co-mingles error messages from shell-maker with error messages from the remote API.

the API returns:

{
  "error": {
    "code": 400,
    "message": "Developer instruction is not enabled for models/gemma-3-27b-it",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.DebugInfo",
        "detail": "[ORIGINAL ERROR] generic::invalid_argument: Developer instruction is not enabled for models/gemma-3-27b-it [google.rpc.error_details_ext] { message: \"Developer instruction is not enabled for models/gemma-3-27b-it\" }"
      }
    ]
  }
}

Curl returns:

curl: (22) The requested URL returned error: 400

The error is expected (See #333). But the output shown in chatgpt-shell sort of mangles those two error messages together, and confuses things:

Gemini(2.0-flash/General)> 
<shell-maker-interrupted-command>


Gemini(gemma-3-27b-it/General)> hello there
<shell-maker-end-of-prompt>
curl: (22) The requestedDeveloper instruction is not enabled for models/gemma-3-27b-itURL returned error: 400


<shell-maker-failed-command>
Gemini(gemma-3-27b-it/General)> hello there

curl: (22) The requested URL returned error: 400Developer instruction is not enabled for models/gemma-3-27b-it


<shell-maker-failed-command>
Gemini(gemma-3-27b-it/General)> hello there
<shell-maker-end-of-prompt>
Developer instruction is not enabled for models/gemma-3-27b-itcurl: (22) The requested URL returned error: 400


<shell-maker-failed-command>
Gemini(gemma-3-27b-it/General)> 

In the first case above , I had no debugger. In the 2nd and 3rd, I had been using edebug within shell-maker-execute-command

Maybe the race condition is between on-output and on-finished in that fn.

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

No branches or pull requests

1 participant