eca icon indicating copy to clipboard operation
eca copied to clipboard

Switching between GitHub Copilot and Azure Open AI gives below error

Open ChetanKoneru opened this issue 6 months ago • 8 comments

Describe the bug

Switching between GitHub Copilot and Azure Open AI gives below error.

[OPENAI] Unexpected response status: %s body: %s 400 {
  "error": {
    "message": "Invalid 'input[3].id': '649b3310-b1ed-44aa-8727-b7577d4f3f4c'. Expected an ID that begins with 'rs'.",
    "type": "invalid_request_error",
    "param": "input[3].id",
    "code": "invalid_value"
  }
}
{:message OpenAI response status: 400 body: {
  "error": {
    "message": "Invalid 'input[3].id': '649b3310-b1ed-44aa-8727-b7577d4f3f4c'. Expected an ID that begins with 'rs'.",
    "type": "invalid_request_error",
    "param": "input[3].id",
    "code": "invalid_value"
  }
}, :status 400, :body {
  "error": {
    "message": "Invalid 'input[3].id': '649b3310-b1ed-44aa-8727-b7577d4f3f4c'. Expected an ID that begins with 'rs'.",
    "type": "invalid_request_error",
    "param": "input[3].id",
    "code": "invalid_value"
  }
}}
:db/upsert-cache 21ms

To Reproduce

Steps to reproduce the behavior:

  1. Use GitHub Copilot for a while. (use Claude sonnet to code)
  2. switch to Azure OpenAI (gpt-5.5 to the changes) [same chat buffer]
  3. User input , enter, and the error appears

Expected behavior

Switching providers should not cause this error.

Doctor

ECA version: 0.134.2

Server cmd: /Users/ck/.local/share/mise/installs/eca/0.134.2/eca server

Workspaces: /Users/ck/GitRepos/strimzi-backup-operator

Default model: github-copilot/gpt-5-mini (Subscription (oauth), expires 2026-05-19 21:30)

Logged providers: 
openai: Subscription (oauth), expires 2026-05-17 09:26 --- I have Azure OpenAI, apart from Openai - FYI
github-copilot: Subscription (oauth), expires 2026-05-19 21:30 

Relevant env vars: 


Credential files:
  /Users/ck/.netrc:
    Readable: true
    Permissions: secure
    Credentials: 1

Screenshots

Image

ChetanKoneru avatar May 20 '26 01:05 ChetanKoneru

I don't think we can fix that, same issue as #209, the thing is providers expect ids for their reasoning to match with what they have on server, if you change conversation in the mid, you lose those since each provider does that differently, a workaround would be throw away those thinkings or summarize the converastion but would lose a lot of context.

We would need to think in a feature to work cross provider solving that, if it's possible. c/c @zikajk

ericdallo avatar May 20 '26 14:05 ericdallo

So using /compact and then switching providers work?

ChetanKoneru avatar May 20 '26 17:05 ChetanKoneru

We could probably take a same approach like OpenCode does and transform the conversation to one long message (and probably throw away all thinking blocks). But I think it shouldn't happen automatically after you switch the model. Maybe a command with an optional parameter that controls if thinking should be preserved in xml tags?

zikajk avatar May 20 '26 17:05 zikajk

@zikajk not sure, it's almost like calling compact and switch model right?

ericdallo avatar May 20 '26 17:05 ericdallo

Compact removes a lot of stuff, this wouldn't. But the main difference is the situation where you don't have enough credits to do compact and you want to continue the conversation with another model 😅.

zikajk avatar May 20 '26 17:05 zikajk

True, that's a good point, something that didn't need LLM intervation would be best, doing on eca server side

ericdallo avatar May 20 '26 18:05 ericdallo

Here is a crazy though -

Can we use available hooks like preRequest to verify if the provider has switched and clean "thinking"(or problematic content) from the context?

Is it possible? do we need to track provider switching to achieve this? or are we already tracking provider switching?

ChetanKoneru avatar May 21 '26 18:05 ChetanKoneru

I'm working on some hook improvements, so I could add provider/model as an input, but the problem is that it wouldn't work universally. However, I can imagine it could theoretically work; on the other hand, it might be more complicated than just creating a script that modifies the saved chat in the transit JSON if you want to go down that route.

I still think that having an internal command to transform the chat into one long message might be good enough, but I haven't had the time to explore this further yet.

zikajk avatar May 21 '26 18:05 zikajk