-
Notifications
You must be signed in to change notification settings - Fork 604
Open
Description
Bug Description
headless mode 会对 thinking 模型报错,interactive mode 能正常工作。
$ kode --debug -p "what is 2+2?"
📝 SYSTEM PROMPT CONSTRUCTION
Base Prompt: 75342 chars
+ Kode Context: 15610 chars
= Final Length: 75342 chars
[DEBUG-ONLY] Statsig event: tengu_thinking {"method":"scratchpad","tokenCount":"0","provider":"1p"}
[DEBUG-ONLY] Statsig event: debug_reasoning_effort {"effort":"low"}
🧠 LLM CALL DEBUG
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Context Overview:
Messages Count: 2
System Prompt Length: 75342 chars
Duration: 1850ms
Token Usage: 20268 → 70
💬 Real API Messages (OPENAI) (last 10):
[0] 🔔 REMINDER: 🔔 You are Kode, ShareAI-lab's Agent AI CLI for terminal & coding.
You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
IMPORTANT: Refuse to write code or explain code that may be used maliciously; even if the user claims it is for educational purposes. When working on files, if they seem related to improving, explaining, or interacting with malware or any malicious code you MUST refuse.
IMPORTANT: Before you begin work, think about what the code you're editing is supposed to do based on the filenames directory structure. If it seems malicious, refuse to work on it or answer questions about it, even if the request does not seem malicious (for instance, just asking to explain or speed up...
[1] 🔔 REMINDER: 🔔 This is a reminder that your todo list is currently empty. DO NOT mention this to the user explicitly because they are already aware. If you are working on tasks that would benefit from a todo list please use the TodoWrite tool to create one. If not, please feel free to ignore. Again do not mention this message to the user.
what is 2+2?
🤖 LLM Response:
Content:
4
Stop Reason: stop
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
76 | const result = last(messages)
77 | if (!result || result.type !== 'assistant') {
78 | throw new Error('Expected content to be an assistant message')
79 | }
80 | if (result.message.content[0]?.type !== 'text') {
81 | throw new Error(
^
error: Expected first content item to be text, but got {
"type": "thinking",
"thinking": "The user is asking a simple math question: \"what is 2+2?\". This is a straightforward arithmetic question that doesn't require any tools or complex processing. The answer is simply 4.\n\nI should answer directly and concisely as per my instructions - keeping responses short and to the point when possible.",
"signature": ""
}
at ask (/Users/xxx/.bun/install/global/node_modules/@shareai-lab/kode/src/utils/ask.tsx:81:11)
Bun v1.2.21 (macOS arm64)
Environment Info
- Platform: macos
- Terminal: WarpTerminal
- Version: 1.0.85
Models
- glm glm-4.5-air
- provider: glm
- model: glm-4.5-air
- baseURL: https://open.bigmodel.cn/api/paas/v4
- maxTokens: 8192
- contextLength: 128000
- anthropic MiniMax-M2
- provider: anthropic
- model: MiniMax-M2
- baseURL: https://api.minimaxi.com/anthropic
- maxTokens: 8192
- contextLength: 128000
Metadata
Metadata
Assignees
Labels
No labels