-
-
Notifications
You must be signed in to change notification settings - Fork 8
Rename "planetary copilot" to "planet computer" and clear example prompts #645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1490bd8
23f65f1
099be07
b76695e
f3abcd7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,14 +34,15 @@ export async function getModel(requireVision: boolean = false) { | |
|
|
||
| if (selectedModel) { | ||
| switch (selectedModel) { | ||
| case 'QCX-Terra': | ||
| case 'Grok 4.2': | ||
| if (xaiApiKey) { | ||
| const xai = createXai({ | ||
| apiKey: xaiApiKey, | ||
| baseURL: 'https://api.x.ai/v1', | ||
| }); | ||
| try { | ||
| return xai('grok-4-fast-non-reasoning'); | ||
| return xai(requireVision ? "grok-vision-beta" : "grok-4-fast-non-reasoning"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify where getModel() is used with structured-output APIs.
# Expected: identify call sites where getModel(...) feeds streamObject/generateObject flows.
set -euo pipefail
echo "== getModel call sites =="
rg -n -C2 '\bgetModel\s*\(' --type ts --type tsx
echo
echo "== structured output API usage (streamObject/generateObject) =="
rg -n -C3 '\b(streamObject|generateObject)\s*\(' --type ts --type tsx
echo
echo "== resolution-search and related agents around model selection =="
rg -n -C4 'model:\s*await\s+getModel|model:\s*\(await getModel' lib --type ts --type tsxRepository: QueueLab/QCX Length of output: 128 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== getModel call sites =="
rg -n -C2 '\bgetModel\s*\(' lib -g'*.ts' -g'*.tsx'
echo
echo "== structured output call sites =="
rg -n -C3 '\b(streamObject|generateObject)\s*\(' lib -g'*.ts' -g'*.tsx'
echo
echo "== look for model: (await) getModel near structured output usage =="
rg -n -C4 'model:\s*\(?\s*(await\s+)?getModel' lib -g'*.ts' -g'*.tsx'Repository: QueueLab/QCX Length of output: 10620 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== lib/utils/index.ts around getModel =="
sed -n '1,140p' lib/utils/index.ts | nl -ba | sed -n '1,140p'
echo
echo "== lib/utils/index.ts: lines ~35-110 (for exact grok routing) =="
sed -n '35,110p' lib/utils/index.ts | nl -ba
echo
echo "== lib/agents/task-manager.tsx: generateObject block =="
sed -n '1,120p' lib/agents/task-manager.tsx | nl -ba | sed -n '1,120p'
echo
echo "== lib/agents/query-suggestor.tsx: streamObject block end (schema) =="
sed -n '1,120p' lib/agents/query-suggestor.tsx | nl -ba | sed -n '40,120p'
echo
echo "== lib/agents/inquire.tsx: streamObject block end (schema) =="
sed -n '1,120p' lib/agents/inquire.tsx | nl -ba | sed -n '1,120p'Repository: QueueLab/QCX Length of output: 158 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== lib/utils/index.ts (first 140 lines) =="
sed -n '1,140p' lib/utils/index.ts | cat -n
echo
echo "== lib/agents/task-manager.tsx (first 140 lines) =="
sed -n '1,140p' lib/agents/task-manager.tsx | cat -n
echo
echo "== lib/agents/query-suggestor.tsx (first 120 lines) =="
sed -n '1,120p' lib/agents/query-suggestor.tsx | cat -n
echo
echo "== lib/agents/inquire.tsx (first 120 lines) =="
sed -n '1,120p' lib/agents/inquire.tsx | cat -nRepository: QueueLab/QCX Length of output: 15644 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== lib/utils/index.ts: grok-4-fast-non-reasoning routing =="
rg -n "grok-4-fast-non-reasoning" lib/utils/index.ts
echo
echo "== structured output call sites using getModel() =="
rg -n -C2 "model:\s*\(await\s+getModel\(\)\)" lib -g'*.ts' -g'*.tsx' | rg -n -C2 "(streamObject|generateObject)"
echo
echo "== structured output call sites (streamObject/generateObject) that pass schema =="
rg -n -C2 "(streamObject|generateObject)\s*\(" lib -g'*.ts' -g'*.tsx' | rg -n -C2 "schema:"Repository: QueueLab/QCX Length of output: 2028 Route structured-output calls to a JSON-schema-compatible model (xAI grok-4-fast-non-reasoning is unsafe)
Per the guidance, structured-output workers must not use 🤖 Prompt for AI Agents |
||
| } catch (error) { | ||
| console.error('Selected model "Grok 4.2" is configured but failed to initialize.', error); | ||
| throw new Error('Failed to initialize selected model.'); | ||
|
|
@@ -57,7 +58,7 @@ export async function getModel(requireVision: boolean = false) { | |
| apiKey: gemini3ProApiKey, | ||
| }); | ||
| try { | ||
| return google('gemini-3.1-pro-preview'); | ||
| return google(requireVision ? "gemini-1.5-pro" : "gemini-3.1-pro-preview"); | ||
| } catch (error) { | ||
| console.error('Selected model "Gemini 3.1 Pro" is configured but failed to initialize.', error); | ||
| throw new Error('Failed to initialize selected model.'); | ||
|
|
@@ -86,7 +87,7 @@ export async function getModel(requireVision: boolean = false) { | |
| baseURL: 'https://api.x.ai/v1', | ||
| }); | ||
| try { | ||
| return xai('grok-4-fast-non-reasoning'); | ||
| return xai(requireVision ? "grok-vision-beta" : "grok-4-fast-non-reasoning"); | ||
| } catch (error) { | ||
| console.warn('xAI API unavailable, falling back to next provider:'); | ||
| } | ||
|
|
@@ -97,7 +98,7 @@ export async function getModel(requireVision: boolean = false) { | |
| apiKey: gemini3ProApiKey, | ||
| }); | ||
| try { | ||
| return google('gemini-3.1-pro-preview'); | ||
| return google(requireVision ? "gemini-1.5-pro" : "gemini-3.1-pro-preview"); | ||
| } catch (error) { | ||
| console.warn('Gemini 3.1 Pro API unavailable, falling back to next provider:', error); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: QueueLab/QCX
Length of output: 2454
🏁 Script executed:
Repository: QueueLab/QCX
Length of output: 669
🏁 Script executed:
Repository: QueueLab/QCX
Length of output: 12654
🏁 Script executed:
Repository: QueueLab/QCX
Length of output: 14997
🏁 Script executed:
Repository: QueueLab/QCX
Length of output: 6945
Fix empty system prompt persistence mismatch
The form schema allows an empty
systemPrompt(.min(0)with default""), butlib/actions/chat.ts’ssaveSystemPromptrejects it viaif (!prompt) return { error: 'Prompt is required' }, so clearing/saving an empty prompt fails.Chat/AI runtime is likely safe because
app/actions.tsxconvertsnullto'', andlib/agents/researcher.tsxfalls back togetDefaultSystemPrompt(...)whendynamicSystemPrompt.trim()is empty.Update
saveSystemPromptto accept empty strings (or convert empty string tonullfor storage) so UI behavior matches backend behavior.🤖 Prompt for AI Agents