codeg icon indicating copy to clipboard operation
codeg copied to clipboard

Model reasoning effort missing 'max' (and 'minimal') in Pi integration config

Open Smith-106 opened this issue 3 months ago • 2 comments

Bug: Model reasoning effort missing max (and minimal) in Pi integration config

Environment

  • codeg version: 0.23.5
  • Platform: Windows 11
  • Pi integration: provider config generated with name = "codeg", wire_api = "responses", requires_openai_auth = true

Description

The thinking/reasoning-effort selector in the model settings UI does not offer max, and even when set programmatically, the mapping function rejects it. This limits deep-reasoning workflows on models that support max thinking (e.g. Anthropic/OpenAI/Gemini/OpenRouter providers) when driving Pi.

Evidence

Found in the bundled web frontend (_next/static/chunks/05e5726fe31b6eaf.js):

1. The main settings UI enumeration has no max:

let sy = ["off","minimal","low","medium","high","xhigh"]
sb = [{id:"anthropic",...},{id:"openai",...},{id:"google",...},{id:"openrouter",...}]

2. The mapping function oj() only accepts low/medium/high/xhigh — it rejects both max and minimal:

function oj(e) {
  let t = e.trim().toLowerCase();
  return "low"===t || "medium"===t || "high"===t || "xhigh"===t ? t : null
}

3. Inconsistency: the Kimi (Moonshot) channel enumeration does include max:

let so = ["minimal","low","medium","high","xhigh","max"]  // only used for Kimi

4. Config write path drops the value before it reaches Pi:

model_reasoning_effort = oj(t.modelReasoningEffort) ?? op

Even if max were passed in, oj() returns null so it never reaches the generated Pi provider config. Pi itself fully supports max (thinkingLevelMap maps max → max), so this is purely a codeg-side limitation.

Expected behavior

  • The thinking selector should offer max for providers that support it (or at minimum allow max to be passed through), matching the Kimi channel's so enumeration.
  • oj() should accept minimal too — it is present in the UI enumeration (sy) but currently mapped to null.

Suggested fix

  1. Add "max" to sy: ["off","minimal","low","medium","high","xhigh","max"]
  2. Update oj() to accept minimal and max (or align it with the same enumeration used by the UI)

Smith-106 avatar Aug 15 '26 06:08 Smith-106

We hope to resolve the issue with the Pi thinking setting soon. The problem is still present.

ykoneee avatar Sep 03 '26 16:09 ykoneee

I’ll take this issue. Current CodeG still filters Pi thinking levels in the frontend and Rust config path, while its pinned [email protected] rejects max.

I’ll update the adapter to a version that advertises model-specific thinking levels, carry supported max and minimal values through selection and persistence, and avoid offering a level a model does not support. I’ll add regression tests for those paths and run an isolated ACP protocol check before opening the PR. The PR will spell out the observed behavior and verification results.

dawNotPoi avatar Sep 25 '26 09:09 dawNotPoi