Skip to content

fix: treat set-but-empty RIDDLE_OPENAI_REASONING as unset#14

Open
vnnkl wants to merge 1 commit into
MaximeRivest:mainfrom
vnnkl:fix/empty-reasoning-env
Open

fix: treat set-but-empty RIDDLE_OPENAI_REASONING as unset#14
vnnkl wants to merge 1 commit into
MaximeRivest:mainfrom
vnnkl:fix/empty-reasoning-env

Conversation

@vnnkl

@vnnkl vnnkl commented Jul 7, 2026

Copy link
Copy Markdown

Follow-up to the closed #8, reduced to the one piece v0.3.0 didn't fix.

remagic config riddle (and any env-file-writing config UI whose select includes the "" option — as settings.schema.json does) writes RIDDLE_OPENAI_REASONING= — set but empty. std::env::var(...).ok() then yields Some(""), and the request carries "reasoning_effort":"", which OpenAI rejects with:

http 400: Unrecognized request argument supplied: reasoning_effort

…on every turn, with nothing visible on the page. Hit this in the wild on a Paper Pro configured through remagic (journal evidence in #7/#8).

One-line-ish fix: trim and filter empty, so present-but-blank behaves like absent.

🤖 Generated with Claude Code

Config UIs that write env files (remagic's settings form has a ""
option in its reasoning select) produce RIDDLE_OPENAI_REASONING= —
set but empty. The code then sends "reasoning_effort":"", which
OpenAI rejects with 400 'Unrecognized request argument supplied:
reasoning_effort' on non-reasoning models, silently killing every
turn. Trim and treat empty as unset.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant