Skip to content

Conversation

@ry2009
Copy link
Contributor

@ry2009 ry2009 commented Dec 5, 2025

  • Treats finish_reason: "tool_calls" as stop when no tool-call deltas were seen (prevents hangs when providers return an empty tool_calls list).
  • Keeps tool-calls when actual tool-call chunks were emitted.
  • Added a regression test for the mapping.

@rekram1-node
Copy link
Collaborator

I don't think this does what you think it does

@rekram1-node
Copy link
Collaborator

Are you solely doing this for codex models specifically through the github copilot subscription? It seems unlikely that is your intention given lack of description saying this much. But this change would ONLY affect those models.

@ry2009
Copy link
Contributor Author

ry2009 commented Dec 6, 2025

Yes, sorry I was more interested in making sure this fix works at the base level as this is a bigger abstraction:

I was curious how to continue if we want to add the same tool_calls into stop when no deltas mapping to the upstream @ai-sdk/openai-compatible path we use elsewhere (or wrap the finishReason after any OpenAI-compatible response).

Or we can PR change upstream to ai-sdk and remove the divergence in our fork so every OpenAI-compatible flow gets the fix.

@rekram1-node
Copy link
Collaborator

what providerr were u seeing this issue w/?

@ry2009
Copy link
Contributor Author

ry2009 commented Dec 8, 2025

I saw it with LM Studio’s OpenAI‑compatible local server (model: qwen2.5‑coder‑7b‑instruct). It returned finish_reason:"tool_calls" but never streamed any tool_call deltas (tool_calls: []), so the mapper yielded unknown and the session waited forever. It isn’t a Copilot‑only problem; that’s just wherethe fork is.

@rekram1-node
Copy link
Collaborator

Yeah this code wouldn't have done anything in that case then. we should fix this in processor.ts

@rekram1-node
Copy link
Collaborator

@ry2009 can you send me the session for this? opencode export > session.json

Because I think this may be a bug on LMStudio and they should fix it on their end

@ry2009
Copy link
Contributor Author

ry2009 commented Dec 8, 2025

session.json

Let me know if this loads or use the gist:

https://gist.github.com/ry2009/4559c3f9b4350a1bf4853cc20acd1993

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

Successfully merging this pull request may close these issues.

2 participants