fix(pi): remove PiModelPanel/PiThinkingLevelPanel#1059
Open
Arnie97 wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Findings
- [Major] Pi model selection loses provider identity in the shared gear menu. Removing the Pi-only panel makes Pi sessions use the unified model list, but that list still keys and highlights rows by bare
modelId; the repo explicitly preservesmetadata.piSelectedModelbecause two providers can share the same model id. With duplicate IDs, React can reuse duplicate keys and the UI marks every matchingmodelIdas selected, so users cannot tell which provider-backed model is active before changing it. Evidence:web/src/components/AssistantChat/HappyComposer.tsx:798, related contextweb/src/components/AssistantChat/HappyComposer.tsx:898andweb/src/components/AssistantChat/HappyComposer.tsx:911.
Suggested fix:const isPiModelSelected = (piModel: PiModelSummary) => selectedPiModel ? selectedPiModel.provider === piModel.provider && selectedPiModel.modelId === piModel.modelId : model === piModel.modelId // inside group.models.map const selected = isPiModelSelected(piModel) key={`${piModel.provider}:${piModel.modelId}`}
Summary
- Review mode: initial
- One Major issue found: the new Pi path through the shared settings menu regresses provider-qualified model display for duplicate
modelIdentries.
Testing
- Not run (automation; static review only). Missing coverage: a web component test for Pi models with the same
modelIdunder different providers should assert only the provider-qualified current model is selected.
HAPI Bot
…ar menu
- key={piModel.modelId} → key={`${provider}:${modelId}`} prevents
React key collisions when two providers share a modelId.
- selected state uses selectedPiModel (provider+modelId) instead of bare
model === modelId, so only the correct provider row is highlighted.
There was a problem hiding this comment.
Findings
- No issues found.
Summary
- Review mode: follow-up after new commits
- The prior provider-qualified Pi model selection issue is addressed in the latest diff. Residual risk: no web component coverage found for the Pi gear menu with duplicate
modelIdvalues across providers or model-specific thinking-level filtering.
Testing
- Not run (automation:
bunis not available on PATH in this environment).
HAPI Bot
Arnie97
force-pushed
the
fix/remove-pi-panels
branch
from
July 17, 2026 08:17
ab3c7ea to
145400a
Compare
There was a problem hiding this comment.
Findings
- [Major] Pi gear menu exposes bare model/effort controls before the Pi catalog is known — the deleted Pi toolbar buttons used
piHasModels/selectedPiModelto block these controls until provider-qualified model data existed. After routing Pi through the unified gear menu,showModelSettingscan still fall back tomodelOptionswhilepiModelsis empty, so the menu can send a bare string/null model; Pi rejects string models when it cannot resolve a provider (cli/src/pi/runPi.ts:179,cli/src/pi/runPi.ts:217). The same state also shows unfiltered thinking levels beforeselectedPiModelis known. Evidenceweb/src/components/AssistantChat/HappyComposer.tsx:796.
Suggested fix:const showModelSettings = Boolean( onModelChange && supportsModelChange(agentFlavor) && (agentFlavor === 'pi' ? Boolean(piModels?.length) : modelOptions.length > 0) ) const piEffortHidden = agentFlavor === 'pi' ? !selectedPiModel || selectedPiModel.reasoning === false : false const showEffortSettings = Boolean(onEffortChange && supportsEffort(agentFlavor) && !piEffortHidden)
Questions
- None.
Summary
- Review mode: follow-up after new commits
- The provider-qualified selected-state fix is present, but the unified Pi settings menu still needs the old catalog/selected-model guards to avoid sending invalid Pi config during catalog load.
Testing
- Not run (automation). Suggested: add a composer/settings regression test for Pi with
piModels=[]proving no model or thinking options are actionable until provider-qualified data exists.
HAPI Bot
Old code used (piModels && piModels.length > 0 || modelOptions.length > 0) which would evaluate to true for Pi flavor even when piModels was empty — modelOptions always carries a Default placeholder entry for Pi.
Arnie97
force-pushed
the
fix/remove-pi-panels
branch
from
July 17, 2026 09:40
1f0570b to
9918d2c
Compare
There was a problem hiding this comment.
Findings
- [Major] Pi thinking-level controls are still actionable before a provider-qualified Pi model is known — the PR removes the dedicated
PiThinkingLevelPanel, whose button was disabled when!selectedPiModel; the unified gear menu now includesshowEffortSettingsfor Pi as soon asonEffortChangeexists. In a loading/error/missing-catalog state,selectedPiModelis undefined, so the menu renders unfiltered default Pi levels and can sendset_thinking_levelwithout knowing whether the current model supports reasoning or that level. This reintroduces rejected/stale config risk on Pi (cli/src/pi/runPi.ts:234waits for Pi confirmation and 409s on rejection). Evidenceweb/src/components/AssistantChat/HappyComposer.tsx:800.
Suggested fix:const piEffortHidden = agentFlavor === 'pi' ? !selectedPiModel || selectedPiModel.reasoning === false : false const showEffortSettings = Boolean(onEffortChange && supportsEffort(agentFlavor) && !piEffortHidden)
Questions
- None.
Summary
- Review mode: follow-up after new commits
- The new commit fixed the Pi model-catalog fallback, but the Pi effort section still needs the old selected-model guard before the unified settings menu can replace the deleted Pi panel safely.
Testing
- Not run (automation). Suggested: add a composer/settings regression test for Pi with
piModels=[]and/orpiSelectedModelunresolved proving the effort section is hidden untilselectedPiModelexists.
HAPI Bot
| } | ||
|
|
||
| // Non-Pi flavors: original unified gear menu | ||
| // Unified gear menu |
There was a problem hiding this comment.
[MAJOR] The unified settings menu is now the Pi path, but the Pi effort section is still shown whenever onEffortChange exists. The deleted Pi thinking button was disabled until a selectedPiModel existed; without that guard, Pi can show unfiltered default thinking levels while the catalog/selected model is unresolved and send a level the current model may reject.
Suggested fix:
const piEffortHidden = agentFlavor === 'pi'
? !selectedPiModel || selectedPiModel.reasoning === false
: false
const showEffortSettings = Boolean(onEffortChange && supportsEffort(agentFlavor) && !piEffortHidden)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keeps consistent with other coding agents, and use the ⚙️ settings button to switch between models and reasoning effort levels. Remove the pi-specific
PiModelPanelandPiThinkingLevelPanelfrom the bottom toolbar, which overflows mobile screens and provides no real benefit.