← Back to PRs

#3678: TUI: fix /reasoning by supporting stream + normalization-Mark as AI-assisted-lightly tested

by AaronWander open 2026-01-29 01:38 View on GitHub →
This change fixes a mismatch between the TUI /reasoning command and the project’s canonical reasoning enum. What was wrong before The core enum is ReasoningLevel = "off" | "on" | "stream" ([thinking.ts](https://file+.vscode-resource.vscode-cdn.net/Users/aaron/.vscode/extensions/openai.chatgpt-0.4.67-darwin-arm64/webview/#)), and the Gateway session patch logic validates the same set (on|off|stream). The TUI, however: Only advertised /reasoning <on|off> (help text). Only offered on/off in autocomplete. Passed the raw argument through to patchSession without normalization/validation. What this fixes Adds stream to TUI autocomplete for /reasoning. Updates /reasoning help text to include stream. Normalizes user input via normalizeReasoningLevel() so common inputs like streaming become stream before calling patchSession. If you didn’t make this change, when would it fail and how If a user tries to enable streaming reasoning in TUI (e.g. /reasoning stream or /reasoning streaming): The TUI would either not guide them to the correct value (no autocomplete, wrong usage). For /reasoning streaming specifically, the TUI would send reasoningLevel: "streaming" to the Gateway, which rejects it as invalid (Gateway expects exactly on|off|stream). Result: the command fails (you’d see a “reasoning failed: …” message in the TUI), and the session would not enter reasoning:stream, so the user cannot enable streaming reasoning from TUI reliably. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the TUI `/reasoning` command to match the canonical `ReasoningLevel` enum (`off|on|stream`). It adds `stream` to `/reasoning` autocomplete, updates the command description, and normalizes user input via `normalizeReasoningLevel()` before calling `client.patchSession`, with tests covering autocomplete and normalization behavior. The main integration point is `src/tui/tui-command-handlers.ts`, where slash command arguments are parsed and translated into gateway `patchSession` calls; the TUI’s slash command registry in `src/tui/commands.ts` drives help/autocomplete UI. <h3>Confidence Score: 4/5</h3> - This PR is low risk and mostly safe to merge; the main remaining issue is a minor documentation mismatch in `/help` output. - Changes are localized to TUI command wiring and add straightforward normalization using an existing helper (`normalizeReasoningLevel`). New tests cover autocomplete and normalization. I couldn’t run the test/lint/typecheck commands in this environment (npm unavailable), so confidence is slightly reduced. - src/tui/commands.ts (helpText line for /reasoning) <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs