mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-29 21:01:27 +00:00
dev: oh my Claude
Docker Image CI / build-and-push-image (push) Waiting to run
Maintain Release Merge PR / update-release-pr (push) Waiting to run
release-please / release-please (push) Waiting to run
test / test (18.x) (push) Waiting to run
test / test (20.x) (push) Waiting to run
test / test (22.x) (push) Waiting to run
Docker Image CI / build-and-push-image (push) Waiting to run
Maintain Release Merge PR / update-release-pr (push) Waiting to run
release-please / release-please (push) Waiting to run
test / test (18.x) (push) Waiting to run
test / test (20.x) (push) Waiting to run
test / test (22.x) (push) Waiting to run
Sometimes tool use requests are streamed as JSON, but sometimes they're streamed as an empty string (causing the JSON parser to error). Had they not streamed anything we actually would've responded correctly, but what they stream implies "this empty string is the JSON input" which is incorrect. Oh well.
This commit is contained in:
@@ -209,6 +209,13 @@ class ClaudeService extends BaseService {
|
||||
on_event: (event) => {
|
||||
if ( event.type === 'content_block_stop' ) {
|
||||
state = STATES.ready;
|
||||
|
||||
// Yeah... claude will send an empty string instead of
|
||||
// an empty object when there's no input. So we have to
|
||||
// check for that. Good job, Anthropic.
|
||||
if ( buffer === '' ) {
|
||||
buffer = '{}';
|
||||
}
|
||||
const str = JSON.stringify({
|
||||
tool_use: {
|
||||
...content_block,
|
||||
|
||||
Reference in New Issue
Block a user