fix(wizard): move LLM test into Rust core & add no_reasoning_control option#60
Merged
missuo merged 2 commits intoApr 6, 2026
Merged
Conversation
…runtime (missuo#56) The wizard's Test Connection previously used a separate Obj-C HTTP implementation that sent a minimal "Hi" message with a hardcoded 15s timeout — completely different from what the runtime actually sends. This caused the test to pass while real LLM correction silently failed (e.g. timeout on reasoning models like GLM-5-turbo). Move the test logic into koe-core so it shares the exact same code path as runtime correction: same correct() function, same config-driven timeout/temperature/top_p, same system_prompt and user_prompt template loaded from disk, same dictionary. Elapsed time is always reported, including on timeout.
Add LlmNoReasoningControl enum with three modes:
- reasoning_effort (default): sends "reasoning_effort": "none" for OpenAI
- thinking: sends "thinking": {"type": "disabled"} for GLM and similar
- none: sends nothing
This lets users disable reasoning on non-OpenAI models like GLM-5-turbo,
which ignore reasoning_effort and waste 15+ seconds on thinking tokens.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #56 — LLM correction silently falls back to raw ASR text when the LLM call times out, but the wizard's Test Connection passes because it uses a completely different code path.
Root cause: The wizard sent a minimal
"Hi"message via Obj-C with a hardcoded 15s timeout, while the runtime sends full system/user prompts through Rust with a default 8s timeout. Reasoning models like GLM-5-turbo take 15+ seconds (ignoringreasoning_effort: "none"), so the runtime always timed out while the test always passed.Changes
sp_llm_test()FFI function that shares the exact samecorrect()code path as runtime: same prompts, dictionary, timeout, temperature, top_p. The Obj-C wizard just calls this and displays the JSON result.test_correction()returns(Result<String>, Duration)so elapsed time is available even on timeout/error (e.g., "LLM correction timed out (8.0s)" instead of "(0.0s)").no_reasoning_controlconfig option — NewLlmNoReasoningControlenum:reasoning_effort(default): sends"reasoning_effort": "none"— works for OpenAI o-seriesthinking: sends"thinking": {"type": "disabled"}— works for GLM and similar modelsnone: sends nothingTest plan
cargo buildsucceedstimeout_ms: 1000shows timeout error with correct elapsed timeno_reasoning_control: thinkingwith GLM-5-turbo responds in ~2s instead of 15s+no_reasoning_control: nonesends no reasoning parameters