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.
This commit is contained in:
@@ -42,6 +42,9 @@ fun AppNav(pendingCommand: StateFlow<NavCommand.Pending>) {
|
||||
}
|
||||
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<NavCommand.Pending>) {
|
||||
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))
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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..."
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user