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、支持任意模型,记忆和密码绝不离开设备。

chore: the default step limit is 40 on both bodies (was 25)

booboosui57f40204d663
diff --git a/CLAUDE.md b/CLAUDE.md
index 9d381b4..273627d 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -81,7 +81,7 @@ Four things in `LocalBrain` are correctness, not style:
`LocalPrompt.TEXT` is the system prompt, adapted from the *cloud* brain's text. Our mirror of that text (`brain/andee-system-prompt.md`) was deleted on 2026-09-29 — nothing loaded it and the two had already stopped needing to move together, so it was a file with no reader. Note what that did **not** do: the cloud mode is still in the code (`VoiceConfig.BRAIN_HUB` still exists; the local brain is the out-of-box default), and that side keeps its own copy of the prompt, which this repo never owned. The CRM sections and the commitment/playbook rituals are **gone rather than softened** from *this* prompt: `crm_*` does not exist here and nothing wakes this device up later, so a rule whose tools are absent just teaches the model to claim it did something it cannot do.
-Guards: `MAX_ITERATIONS = 25` and an identical-`(name, arguments)`-three-times cut-off, both of which end with a spoken final answer — a ball that simply stops is the one failure the user cannot interpret. **A turn either guard stops is not over, and 继续 has to find it** (`LocalBrain.Unfinished`, `stopUnfinished`). The sentence the user heard goes into the history as well as to the TTS, every tool call the model already made gets a reply, and the task's messages are kept by `trimHistory` (`HistoryTrim.dropIndexes(keepFrom)`), the harvest and topic folds even after another turn becomes newest — measured 10-22: a todo fired between the stop and 继续, the trim kept only "the newest turn", and 104 messages became 52 with the task gone. Every user message carries an `(unfinished: …)` line until a later turn acts and finishes, or an hour passes. `answerDangling` separately answers tool calls a turn the user stopped left hanging, which otherwise make the next request a 400. `ContinueAfterStepLimitTest` replays the whole thing against a scripted model. Neither replaces `ScreenController`'s per-location tap guard; that one counts coordinates, these count calls.
+Guards: the step limit (`VoiceConfig.DEFAULT_MAX_STEPS` = 40 on the phone, the same 40 in `DesktopBrainHost.maxSteps`; a `max_steps` setting overrides) and an identical-`(name, arguments)`-three-times cut-off, both of which end with a spoken final answer — a ball that simply stops is the one failure the user cannot interpret. **A turn either guard stops is not over, and 继续 has to find it** (`LocalBrain.Unfinished`, `stopUnfinished`). The sentence the user heard goes into the history as well as to the TTS, every tool call the model already made gets a reply, and the task's messages are kept by `trimHistory` (`HistoryTrim.dropIndexes(keepFrom)`), the harvest and topic folds even after another turn becomes newest — measured 10-22: a todo fired between the stop and 继续, the trim kept only "the newest turn", and 104 messages became 52 with the task gone. Every user message carries an `(unfinished: …)` line until a later turn acts and finishes, or an hour passes. `answerDangling` separately answers tool calls a turn the user stopped left hanging, which otherwise make the next request a 400. `ContinueAfterStepLimitTest` replays the whole thing against a scripted model. Neither replaces `ScreenController`'s per-location tap guard; that one counts coordinates, these count calls.
Not done on purpose: no streaming (an SSE parser plus incremental `tool_calls` reassembly, for a second or two of earlier TTS), no history on disk (service restart = new session), no context compaction, and `tools/boss.py` has no injection point in local mode because its whole mechanism is impersonating a device to the hub.
diff --git a/app/src/main/java/net/kuafuai/andee/config/VoiceConfig.kt b/app/src/main/java/net/kuafuai/andee/config/VoiceConfig.kt
index 2296ddc..78075f1 100644
--- a/app/src/main/java/net/kuafuai/andee/config/VoiceConfig.kt
+++ b/app/src/main/java/net/kuafuai/andee/config/VoiceConfig.kt
@@ -770,7 +770,7 @@ object VoiceConfig {
* (1..200) so a stray zero doesn't make the brain refuse everything
* and a stray thousand doesn't burn an unbounded bill.
*/
- const val DEFAULT_MAX_STEPS = 25
+ const val DEFAULT_MAX_STEPS = 40
fun maxSteps(context: Context): Int =
(context.getSharedPreferences(PREFS, Context.MODE_PRIVATE)
diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml
index 4745f09..c56c073 100644
--- a/app/src/main/res/values-en/strings.xml
+++ b/app/src/main/res/values-en/strings.xml
@@ -207,7 +207,7 @@
<string name="settings_section_diagnostics">Diagnostics</string>
<string name="settings_section_advanced">Advanced</string>
<string name="settings_max_steps">Max steps per task</string>
- <string name="settings_max_steps_note">The most tool calls the AI may make in a single task before stopping with a final answer. Guards against runaway loops and bills. Default 25 — a dozen steps is enough for most tasks.</string>
+ <string name="settings_max_steps_note">The most tool calls the AI may make in a single task before stopping with a final answer. Guards against runaway loops and bills. Default 40 — a dozen steps is enough for most tasks.</string>
<string name="settings_advanced_note">Show the cloud option, typing, diagnostics and factory reset. Nothing here for day-to-day use.</string>
<string name="settings_grounding">Grounding capture</string>
<string name="settings_grounding_note">Records coordinate taps and screenshots to files/grounding for offline analysis — it photographs whatever you are doing. Needs the accessibility service restarted to take effect.</string>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 372e052..acbff80 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -184,7 +184,7 @@
<string name="settings_section_diagnostics">诊断</string>
<string name="settings_section_advanced">高级</string>
<string name="settings_max_steps">单次任务最多步数</string>
- <string name="settings_max_steps_note">每轮任务里 AI 最多能调用多少次工具。超过就停下并给个结束语,防止死循环烧 token。默认 25,一般的任务十几步就够了。</string>
+ <string name="settings_max_steps_note">每轮任务里 AI 最多能调用多少次工具。超过就停下并给个结束语,防止死循环烧 token。默认 40,一般的任务十几步就够了。</string>
<string name="settings_advanced_note">显示云端选项、打字、诊断和恢复出厂设置。日常用不到,都藏在这里。</string>
<string name="settings_grounding">接地采集</string>
<string name="settings_grounding_note">把坐标点击和截图记到 files/grounding 供离线分析 —— 它会拍下你当时在做的事。改完要重开无障碍服务才生效。</string>
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/DesktopBrainHost.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/DesktopBrainHost.kt
index 5fd1796..e37099c 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/DesktopBrainHost.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/DesktopBrainHost.kt
@@ -47,7 +47,7 @@ class DesktopBrainHost(
override fun logWarn(tag: String, msg: String, t: Throwable?) = Log.w(tag, msg, t)
override fun logError(tag: String, msg: String, t: Throwable?) = Log.e(tag, msg, t)
- override fun maxSteps(): Int = Settings.get("max_steps").toIntOrNull()?.coerceIn(1, 200) ?: 25
+ override fun maxSteps(): Int = Settings.get("max_steps").toIntOrNull()?.coerceIn(1, 200) ?: 40
override fun activeSceneName(): String? = Settings.get("scene").ifEmpty { null }
?.takeIf { DesktopNotebook.book.scene(it) != null }
diff --git a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/SettingsScreen.kt b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/SettingsScreen.kt
index c9ac6a6..1db9be9 100644
--- a/desktop/src/main/kotlin/net/kuafuai/andee/desktop/SettingsScreen.kt
+++ b/desktop/src/main/kotlin/net/kuafuai/andee/desktop/SettingsScreen.kt
@@ -251,7 +251,7 @@ fun SettingsScreen(
}
// ---- 单次任务最多步数 ----
Section(st("settings_max_steps"), note = st("settings_max_steps_note")) {
- GlassField(st("settings_max_steps"), v["max_steps"].orEmpty(), { v["max_steps"] = it }, hint = "25")
+ GlassField(st("settings_max_steps"), v["max_steps"].orEmpty(), { v["max_steps"] = it }, hint = "40")
}
// ---- Mac only: the shell ----
diff --git a/desktop/src/main/resources/strings_en.properties b/desktop/src/main/resources/strings_en.properties
index c5b3b74..f28b9a8 100644
--- a/desktop/src/main/resources/strings_en.properties
+++ b/desktop/src/main/resources/strings_en.properties
@@ -166,7 +166,7 @@ s_settings_voice_google_note=Recognition runs on Gemini Live (so it needs the pr
s_settings_section_diagnostics=Diagnostics
s_settings_section_advanced=Advanced
s_settings_max_steps=Max steps per task
-s_settings_max_steps_note=The most tool calls the AI may make in a single task before stopping with a final answer. Guards against runaway loops and bills. Default 25 — a dozen steps is enough for most tasks.
+s_settings_max_steps_note=The most tool calls the AI may make in a single task before stopping with a final answer. Guards against runaway loops and bills. Default 40 — a dozen steps is enough for most tasks.
s_settings_advanced_note=Show the cloud option, typing, diagnostics and factory reset. Nothing here for day-to-day use.
s_settings_grounding=Grounding capture
s_settings_grounding_note=Records coordinate taps and screenshots to files/grounding for offline analysis — it photographs whatever you are doing. Needs the accessibility service restarted to take effect.
diff --git a/desktop/src/main/resources/strings_zh.properties b/desktop/src/main/resources/strings_zh.properties
index 33e7431..85138cf 100644
--- a/desktop/src/main/resources/strings_zh.properties
+++ b/desktop/src/main/resources/strings_zh.properties
@@ -166,7 +166,7 @@ s_settings_voice_google_note=识别走 Gemini Live(需要项目号和区域),合
s_settings_section_diagnostics=诊断
s_settings_section_advanced=高级
s_settings_max_steps=单次任务最多步数
-s_settings_max_steps_note=每轮任务里 AI 最多能调用多少次工具。超过就停下并给个结束语,防止死循环烧 token。默认 25,一般的任务十几步就够了。
+s_settings_max_steps_note=每轮任务里 AI 最多能调用多少次工具。超过就停下并给个结束语,防止死循环烧 token。默认 40,一般的任务十几步就够了。
s_settings_advanced_note=显示云端选项、打字、诊断和恢复出厂设置。日常用不到,都藏在这里。
s_settings_grounding=接地采集
s_settings_grounding_note=把坐标点击和截图记到 files/grounding 供离线分析 —— 它会拍下你当时在做的事。改完要重开无障碍服务才生效。