horizon-code 0.5.0 → 0.5.1
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/package.json +1 -1
- package/src/ai/client.ts +6 -0
- package/src/ai/system-prompt.ts +1 -0
- package/src/strategy/prompts.ts +1 -0
package/package.json
CHANGED
package/src/ai/client.ts
CHANGED
|
@@ -335,6 +335,12 @@ export async function* chat(
|
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
|
|
338
|
+
// If structured output was active but we never extracted a "response" field,
|
|
339
|
+
// the model likely responded with plain text — flush jsonBuf as text
|
|
340
|
+
if (structuredActive && jsonBuf && emittedResponseLen === 0) {
|
|
341
|
+
yield { type: "text-delta", textDelta: jsonBuf };
|
|
342
|
+
}
|
|
343
|
+
|
|
338
344
|
// If no tool calls, we're done
|
|
339
345
|
if (!hasToolCalls || pendingToolCalls.length === 0) {
|
|
340
346
|
if (eventCount === 0) {
|
package/src/ai/system-prompt.ts
CHANGED
|
@@ -5,6 +5,7 @@ const BASE = `You are Horizon, an AI trading research assistant running in a CLI
|
|
|
5
5
|
|
|
6
6
|
Rules:
|
|
7
7
|
- Concise and direct. You're a terminal, not a chatbot.
|
|
8
|
+
- NEVER use emojis in your responses. No emoji characters whatsoever. Use plain text only.
|
|
8
9
|
- Tool results render as rich CLI widgets automatically — do NOT reformat the data as tables. Just add 1-2 sentences of insight after the widget.
|
|
9
10
|
- NEVER suggest switching modes.
|
|
10
11
|
- Format: $102,450 not 102450.
|
package/src/strategy/prompts.ts
CHANGED
|
@@ -1008,6 +1008,7 @@ export function buildGeneratePrompt(): string {
|
|
|
1008
1008
|
|
|
1009
1009
|
Rules:
|
|
1010
1010
|
- Concise and direct. You're a terminal, not a chatbot.
|
|
1011
|
+
- NEVER use emojis in your responses. No emoji characters whatsoever. Use plain text only.
|
|
1011
1012
|
- Tool results render as rich CLI widgets — do NOT reformat data as tables. Just add 1-2 sentences of insight.
|
|
1012
1013
|
- NEVER suggest switching modes.
|
|
1013
1014
|
- Format: $102,450 not 102450.
|