okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
8820fa433
main
1import test from 'node:test' ; 2import assert from 'node:assert/strict' ; 3import { readFileSync } from 'node:fs' ; 4 5/* The direct chat path (no agent): the composer's Reasoning effort menu reaches the server as reasoning_effort ("Off" -> "none", which the 6server turns into enable_thinking=false), and the Thinking budget as reasoning_budget_tokens, never when thinking is off. */ 7const host = readFileSync ( new URL ( '../server/index.mjs' , import . meta. url ), 'utf8' ); 8const composer = readFileSync ( new URL ( '../src/components/ComposerControls.tsx' , import . meta. url ), 'utf8' ); 9const store = readFileSync ( new URL ( '../src/lib/store.ts' , import . meta. url ), 'utf8' ); 10 11test ( 'Off is sent as none and Max as high; the budget only with thinking on' , () => { 12assert . match ( host , / reasoning_effort:\(\{off:'none',max:'high'\} / ); 13assert . match ( host , / thinkingBudget>0&&String\(thinking\)\.toLowerCase\(\)!=='off'\?\{reasoning_budget_tokens:thinkingBudget\} / ); 14}); 15 16test ( 'the budget travels from the menu to the request' , () => { 17assert . match ( composer , / THINKING_BUDGETS / ); 18assert . match ( composer , / thinkingBudget: value / ); 19assert . match ( store , / thinkingBudget:state\.sessions\.find / ); 20assert . match ( host , / thinkingBudget:Number\.isInteger\(body\.thinkingBudget\) / ); 21});