Skip to content

armgit / andee

Public Imported from GitHub
0

Andee lives on your phone or Mac and uses any app like you do—no integrations, no root, any model; memory and passwords never leave your device | Andee 住进你的手机或 Mac,像你一样操作任何 App——无需集成、无需 Root、支持任意模型,记忆和密码绝不离开设备。

fix(brain): ask silent reviews without thinking

booboosui7e9373e9da69
diff --git a/core/src/main/kotlin/net/kuafuai/andee/brain/LlmClient.kt b/core/src/main/kotlin/net/kuafuai/andee/brain/LlmClient.kt
index 8dce551..2f7e498 100644
--- a/core/src/main/kotlin/net/kuafuai/andee/brain/LlmClient.kt
+++ b/core/src/main/kotlin/net/kuafuai/andee/brain/LlmClient.kt
@@ -138,8 +138,9 @@ class LlmClient(
/**
* @param messages the full conversation, system message first.
* @param tools OpenAI-format function specs — see [toolSpecs].
+ * @param noThinking ask without reasoning whatever the user's setting is.
*/
- fun complete(messages: List<JSONObject>, tools: JSONArray): Reply {
+ fun complete(messages: List<JSONObject>, tools: JSONArray, noThinking: Boolean = false): Reply {
val msgArr = JSONArray()
for (m in messages) msgArr.put(m)
val body = JSONObject()
@@ -149,7 +150,7 @@ class LlmClient(
if (tools.length() > 0) {
body.put("tools", tools).put("tool_choice", "auto")
}
- if (thinking) {
+ if (thinking && !noThinking) {
body.put("thinking", JSONObject().put("type", "enabled"))
body.put("reasoning_effort", reasoningEffort)
} else {
diff --git a/core/src/main/kotlin/net/kuafuai/andee/brain/LocalBrain.kt b/core/src/main/kotlin/net/kuafuai/andee/brain/LocalBrain.kt
index 4b7065e..ac7abc6 100644
--- a/core/src/main/kotlin/net/kuafuai/andee/brain/LocalBrain.kt
+++ b/core/src/main/kotlin/net/kuafuai/andee/brain/LocalBrain.kt
@@ -708,7 +708,12 @@ class LocalBrain(
// reads, not only the next one. A string compare, free when nothing
// moved.
if (step > 1) reseatPersona()
- val reply = llm.complete(history, tools)
+ // Silent reviews ask without thinking. In thinking mode the
+ // backend wants every earlier assistant turn's reasoning sent back,
+ // and a review replays a long history whose reasoning was never
+ // kept, so it failed with HTTP 400 (seen 2026-10-20 and 10-21). A
+ // review is bookkeeping and loses little without it.
+ val reply = llm.complete(history, tools, noThinking = internal)
if (gen != generation.get()) return
turnTokens += reply.promptTokens + reply.completionTokens