diff --git a/bin/deploy b/bin/deploy index 148e3430..c7239ca2 100755 --- a/bin/deploy +++ b/bin/deploy @@ -212,7 +212,7 @@ if [ "$DEPLOY" == "1" ]; then esac echo "deployed $PROJECT $REMOTE/ai-$PROJECT:$TAG" else - YAML=$(sed "s#image: dexorder/ai-$PROJECT*#image: $REMOTE/ai-$PROJECT:$TAG#" deploy/k8s/$KUBERNETES.yaml) + YAML=$(sed "s#image: dexorder/ai-$PROJECT*#image: $REMOTE/ai-$PROJECT:$TAG#" deploy/k8s/base/$KUBERNETES.yaml) echo "$YAML" | kubectl apply -f - || { echo "$YAML"; echo "kubectl apply failed"; exit 1; } echo deployed $KUBERNETES.yaml $REMOTE/ai-$PROJECT:$TAG fi diff --git a/gateway/src/harness/agent-harness.ts b/gateway/src/harness/agent-harness.ts index 6e39e0f5..ff9ab22d 100644 --- a/gateway/src/harness/agent-harness.ts +++ b/gateway/src/harness/agent-harness.ts @@ -505,8 +505,6 @@ export class AgentHarness { const messagesCopy = [...messages]; let iterations = 0; - // Track last char of last yielded text chunk to detect missing spaces between tokens - let lastChunkTail = ''; while (iterations < maxIterations) { if (signal?.aborted) break; @@ -525,24 +523,15 @@ export class AgentHarness { try { const stream = await model.stream(messagesCopy, { signal }); for await (const chunk of stream) { - const contents: string[] = []; if (typeof chunk.content === 'string' && chunk.content.length > 0) { - contents.push(chunk.content); + yield { type: 'chunk', content: chunk.content }; } else if (Array.isArray(chunk.content)) { for (const block of chunk.content) { - if (block.type === 'text' && block.text) contents.push(block.text); + if (block.type === 'text' && block.text) { + yield { type: 'chunk', content: block.text }; + } } } - for (const content of contents) { - // DeepInfra/GLM streams tokens without leading spaces; inject one when - // both the tail of the previous chunk and the head of this chunk are - // word characters (\w), which would otherwise merge two words. - if (lastChunkTail && /\w/.test(lastChunkTail) && /\w/.test(content[0])) { - yield { type: 'chunk', content: ' ' }; - } - lastChunkTail = content[content.length - 1]; - yield { type: 'chunk', content }; - } response = response ? response.concat(chunk) : chunk; } } catch (invokeError: any) { @@ -700,7 +689,6 @@ export class AgentHarness { // After all tool calls complete, emit a space separator before the next LLM streaming pass yield { type: 'chunk', content: ' ' }; - lastChunkTail = ' '; } // Max iterations reached - yield done with apology diff --git a/web/src/App.vue b/web/src/App.vue index e488af44..f6082c41 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,7 +1,5 @@ @@ -140,35 +134,28 @@ onBeforeUnmount(() => { />