Skip to content

fix tool calls with empty streamed arguments#156

Open
mavaa wants to merge 1 commit intocharmbracelet:mainfrom
mavaa:fix/copilot-empty-tool-args
Open

fix tool calls with empty streamed arguments#156
mavaa wants to merge 1 commit intocharmbracelet:mainfrom
mavaa:fix/copilot-empty-tool-args

Conversation

@mavaa
Copy link

@mavaa mavaa commented Mar 3, 2026

I'm having a very specific issue with using Claude (through GitHub Pro) in crush and it calling the List command without any parameters (Tested with Opus 4.6 and Haiku 4.5). It will just hang forever, and this happens a lot for me, cause Claude seems to be doing this any time it wants to look in the current dir:

1

Also tested with GPT-5.2 (also Copilot Pro), and it doesn't seem to have the same issue:

2

I vibed/discussed it in crush itself, and we found out the issue seems to be that Claude models somehow sends a "" as argument while it should be "{}", and it causes a crash in the fantasy lib. Now, we managed to fix this with the change in this PR, where the parameter is corrected if it's just an empty string. This works perfectly for me now, but it feels kinda like a hack, so after some discussion in Discord, I'm posting it here (a bit late).

I have verified that I'm still having this issue on the latest version of crush as well, 0.46.2 as of this writing.

@mavaa
Copy link
Author

mavaa commented Mar 3, 2026

Update, as discussed, I wanted to test using anthropic directly, and while I'm not 100% certain (this issue doesn't always trigger), it seems like this only happens when using Claude models through Github Copilot Pro. This test with Anthropic api directly worked fine, but I don't have many api tokens left there, and don't want to buy more:

image

Here's the exact same prompt through Copilot (and some bickering...):

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants