Skip to content

feat(pi): add 'max' thinking level#1032

Open
KorenKrita wants to merge 2 commits into
tiann:mainfrom
KorenKrita:fix/pi-add-max-thinking-level
Open

feat(pi): add 'max' thinking level#1032
KorenKrita wants to merge 2 commits into
tiann:mainfrom
KorenKrita:fix/pi-add-max-thinking-level

Conversation

@KorenKrita

Copy link
Copy Markdown
Contributor

Problem

Pi's --thinking flag accepts 7 levels: off, minimal, low, medium, high, xhigh, max. However, hapi only defines 6 levels in PI_THINKING_LEVELS (missing max), so models that support max thinking cannot expose it in the UI.

Changes

  • Add 'max' to PI_THINKING_LEVELS and PI_THINKING_LEVEL_LABELS in shared/src/piThinkingLevel.ts
  • Update ALL_LEVELS in PiThinkingLevelPanel.tsx to include max
  • Update isThinkingLevelSupported() in piThinkingLevelOptions.ts so max (like xhigh) requires explicit opt-in via the model's thinkingLevelMap

Behavior

  • Models that include max in their thinkingLevelMap will now show it as a selectable thinking level
  • Models without max in their map are unaffected (opt-in required, same as xhigh)
  • No breaking changes to existing behavior

Pi's --thinking flag accepts 7 levels: off, minimal, low, medium, high,
xhigh, max. The shared constant and UI only exposed 6 levels (missing max).

Add 'max' to PI_THINKING_LEVELS and PI_THINKING_LEVEL_LABELS. Like xhigh,
max requires explicit opt-in via the model's thinkingLevelMap — models that
support it will include max in their map and the UI will show it
accordingly.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • [Blocker] Missing branch close breaks TypeScript parsing — the new xhigh || max branch never closes before the default map fallback, leaving the helper with unbalanced braces and preventing the web package from compiling. Evidence web/src/components/AssistantChat/piThinkingLevelOptions.ts:61
    Suggested fix:
    if (level === 'xhigh' || level === 'max') {
        if (!map || !(level in map)) return false
        return map[level] !== null
    }
    
    if (!map || !(level in map)) return true
    return map[level] !== null

Questions

  • None.

Summary

  • Review mode: initial
  • One build-blocking syntax regression found. Residual risk: automation was not run in this review pass.

Testing

  • Not run (automation)

HAPI Bot

Comment thread web/src/components/AssistantChat/piThinkingLevelOptions.ts

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findings

  • None.

Questions

  • None.

Summary

  • Review mode: follow-up after new commits
  • No issues found in the latest full diff. The prior bot blocker in web/src/components/AssistantChat/piThinkingLevelOptions.ts is fixed in the new commit.
  • Residual risk: no dedicated test coverage found for Pi thinking-level option filtering in web/src/components/AssistantChat/piThinkingLevelOptions.ts.

Testing

  • Not run (automation/static review only)

HAPI Bot

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