Repository navigation
Conversation
edward-ly
left a comment
There was a problem hiding this comment.
Hey, sorry for the delay, but it looks great, thanks so much!
89e6e5d to
3b7ae07
Compare
edward-ly
left a comment
There was a problem hiding this comment.
Actually, the CI tests are now failing due to some other recent changes that have been merged. Would you be able to take a look and fix them really quickly?
edward-ly
left a comment
There was a problem hiding this comment.
Thanks! By the way, since this is your first contribution here at Nextcloud, I just wanna remind you to check out our AI policy and contribution policy in case you haven't seen them already. Two last changes I require (both merely administrative):
- Squash both commits into one (I'm not sure if it makes sense to keep the fix commit separately).
- Add an
Assisted-by:trailer to the commit as detailed in our AI policy.
9ffbcd3 to
e29c367
Compare
Mistral and possibly other OpenAI-compatible providers repeat "name": "" in every tool call delta after the first one. The empty string overwrote the name received earlier, so the assembled tool call had no function name. Fixes nextcloud#461 Signed-off-by: Michael Tièche <115039460+Guezli@users.noreply.github.com> Assisted-by: ClaudeCode:claude-opus-5-5
e29c367 to
0a25ea6
Compare
|
Thanks for the pointers! I squashed both commits into one and added the Assisted-by: trailer. I also replaced the agent-added sign-off with my own, and updated the PR description with an AI disclosure. Could you approve the workflows again? Please excuse my English, it is not my first language. If anything is unclear, just let me know. Assisted by ClaudeCode:claude-opus-5-5 |
Fixes #461
Some OpenAI-compatible providers (seen with Mistral,
https://api.eu.mistral.ai/v1) send the function name only in the first streamed tool call delta and repeat it as"name": ""in every later delta.StreamingService::mergeToolCalls()assigned the name from every delta, so the empty string overwrote the real one and the Context Agent received tool calls without a name.This change ignores an empty name in a delta. A non-empty name still overwrites as before, so behaviour with OpenAI (which omits
namein later deltas) is unchanged.Tests: added
testEmptyToolNameInLaterDeltaDoesNotOverwriteTheNametotests/unit/Service/StreamingServiceTest.php. It fails without the fix ('name' => '') and passes with it. Also verified on a Nextcloud 35.0.2 instance with Context Agent 2.11.0: the agent then recognisesschedule_eventwith the correct arguments.AI disclosure: The fix, the test and this description were drafted with Claude Code (Claude Opus 5.5). I reviewed the change and tested it on a live Nextcloud 35.0.2 instance with Context Agent 2.11.0.