osborn 0.9.233 → 0.9.234
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/claude-llm.js +12 -3
- package/package.json +1 -1
package/dist/claude-llm.js
CHANGED
|
@@ -1583,8 +1583,15 @@ export class ClaudeLLM extends llm.LLM {
|
|
|
1583
1583
|
if (msg.requestId) {
|
|
1584
1584
|
callbacks.eventEmitter.emit('query_request_id', { requestId: msg.requestId });
|
|
1585
1585
|
}
|
|
1586
|
-
// Stream assistant text → tts_say events
|
|
1587
|
-
|
|
1586
|
+
// Stream assistant text → tts_say events.
|
|
1587
|
+
// SUBAGENT GUARD (regression fix): the SDK surfaces a Task sub-agent's assistant
|
|
1588
|
+
// messages inline in THIS same stream, tagged with a non-null parent_tool_use_id
|
|
1589
|
+
// ("non-null when the message was produced inside a subagent" — SDK docs). Only the
|
|
1590
|
+
// MAIN orchestrator (parent_tool_use_id === null) may speak or post a chat bubble;
|
|
1591
|
+
// a sub-agent's raw narration must NOT reach TTS/UI (its work already shows via the
|
|
1592
|
+
// tool_use activity events). Without this, once verifiers/researcher became real Task
|
|
1593
|
+
// sub-agents their text "took over the mic" and leaked raw code/markdown into audio.
|
|
1594
|
+
if (msg.type === 'assistant' && msg.message?.content && !msg.parent_tool_use_id) {
|
|
1588
1595
|
// Assign a stable messageId for this turn (first block sets it, rest reuse)
|
|
1589
1596
|
if (!this.#currentTurnMessageId) {
|
|
1590
1597
|
this.#currentTurnMessageId = crypto.randomUUID();
|
|
@@ -2391,7 +2398,9 @@ class ClaudeLLMStream extends llm.LLMStream {
|
|
|
2391
2398
|
this.#onCheckpoint(checkpointId);
|
|
2392
2399
|
}
|
|
2393
2400
|
// Stream text chunks — send each assistant text block to TTS
|
|
2394
|
-
|
|
2401
|
+
// SUBAGENT GUARD (see the persistent-consumer loop above): skip sub-agent messages
|
|
2402
|
+
// (non-null parent_tool_use_id) so only the main orchestrator's text speaks/streams.
|
|
2403
|
+
if (message.type === 'assistant' && message.message?.content && !message.parent_tool_use_id) {
|
|
2395
2404
|
// Emit SDK requestId on first assistant message — identifies this query()
|
|
2396
2405
|
// in the JSONL for tracking which research task produced which output
|
|
2397
2406
|
const sdkRequestId = message.requestId;
|