From 99a481bda57ab18fce7bb4988fe8fb82d9633f51 Mon Sep 17 00:00:00 2001 From: Brummel Date: Sun, 3 May 2026 20:42:42 +0200 Subject: [PATCH] Fix: Adjust LLM token budget and navigation flow Increase `max_completion_tokens` for `gpt_oss_120b` from 8192 to 16384 to prevent incomplete responses. Navigate to the detail screen before the recording screen when starting a new case, ensuring correct back navigation. --- .../sessions/kotlin-compiler-10087412367400182703.salive | 0 .../main/java/com/doctate/watch/presentation/AppNav.kt | 7 +++++++ clients/wearos/run.sh | 8 ++++++-- server/src/analyze/backend.rs | 7 ++++--- 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 clients/wearos/.kotlin/sessions/kotlin-compiler-10087412367400182703.salive diff --git a/clients/wearos/.kotlin/sessions/kotlin-compiler-10087412367400182703.salive b/clients/wearos/.kotlin/sessions/kotlin-compiler-10087412367400182703.salive new file mode 100644 index 0000000..e69de29 diff --git a/clients/wearos/app/src/main/java/com/doctate/watch/presentation/AppNav.kt b/clients/wearos/app/src/main/java/com/doctate/watch/presentation/AppNav.kt index 09a8113..669b307 100644 --- a/clients/wearos/app/src/main/java/com/doctate/watch/presentation/AppNav.kt +++ b/clients/wearos/app/src/main/java/com/doctate/watch/presentation/AppNav.kt @@ -42,6 +42,9 @@ fun AppNav(pendingCommand: StateFlow) { } NavCommand.NewCase -> { val id = app.caseStore.createLocal() + // Push DETAIL under RECORDING so popBackStack on stop lands + // on the case page, ready for another recording. + navController.navigate(Routes.detail(id)) navController.navigate(Routes.recording(id)) } is NavCommand.ContinueCase -> { @@ -64,6 +67,10 @@ fun AppNav(pendingCommand: StateFlow) { onNewCase = { coroutineScope.launch { val id = app.caseStore.createLocal() + // Same backstack shape as NavCommand.NewCase: + // [LIST, DETAIL, RECORDING] so stop returns to + // the case page rather than the list. + navController.navigate(Routes.detail(id)) navController.navigate(Routes.recording(id)) } }, diff --git a/clients/wearos/run.sh b/clients/wearos/run.sh index fb178a7..95a6b97 100755 --- a/clients/wearos/run.sh +++ b/clients/wearos/run.sh @@ -384,8 +384,12 @@ start_emulator_and_wait() { local emulator_bin="$1" local avd="$2" - info "Starting AVD '$avd' (background)..." - nohup "$emulator_bin" -avd "$avd" >/dev/null 2>&1 & + # -no-snapshot-load forces a cold boot. Quick Boot's RAM snapshot freezes + # the wallclock from the last session, and Wear OS in-AVD NTP often does + # not catch up — case timestamps end up days in the past. Cold boot + # picks up the host RTC at startup, no in-app correction needed. + info "Starting AVD '$avd' (cold boot, background)..." + nohup "$emulator_bin" -avd "$avd" -no-snapshot-load >/dev/null 2>&1 & disown info "Waiting for ADB to see the device..." diff --git a/server/src/analyze/backend.rs b/server/src/analyze/backend.rs index 51c40db..077f6ba 100644 --- a/server/src/analyze/backend.rs +++ b/server/src/analyze/backend.rs @@ -157,14 +157,15 @@ pub fn backends() -> &'static [LlmBackend] { // gpt-oss-120b: schema OFF on purpose. Reasoning tokens count // against `max_completion_tokens`; with `high` reasoning the // CoT alone can eat several thousand tokens, so the budget is - // doubled to 8192 to leave room for the actual answer. Without - // headroom the model returns `choices[0].message.content == null` + // raised to 4x the default to leave room for the actual answer. + // Without headroom the model returns + // `choices[0].message.content == null` (finish_reason="length") // — the LlmError::Parse path. Pre-multi-backend (commit bf6464d) // gpt-oss ran without schema and worked fine; this restores // that body byte-for-byte except for the larger budget. ionos_backend("gpt_oss_120b", "GPT OSS 120b", "openai/gpt-oss-120b") .with_reasoning_effort("high") - .with_max_completion_tokens(8192) + .with_max_completion_tokens(16384) .with_use_json_schema(false), ionos_backend( "llama_3_1_405b",