Require explicit model selection before chat send - #865
Conversation
Co-authored-by: Möbius Agent <mobius-agent@users.noreply.github.com>
miljanm
left a comment
There was a problem hiding this comment.
Reviewer: QA second look
I found the following concrete risks. I’ve kept this focused on issues with a supported failure mode rather than style preferences.
LOW · Interactive open-picker wiring is only source-text asserted, not executed
frontend/src/components/ChatView/__tests__/modelSelectionPolicy.test.js:42 · tests
Reviewer rule: tests.changed_behavior_unprotected
The stateful behavior added here — the handledModelSelectionRequestRef dedup guard, the effect dependency array, and the ChatView setModelSelectionRequest increment threaded into ComposerPopover — is never exercised at runtime. A regression that keeps the matched text intact but breaks the wiring (an inverted ref comparison that re-opens on mount, a wrong/missing effect dependency, or the prop silently not threaded) still passes these assertions, while a cosmetic reformat of the matched source would falsely fail them.
Evidence: The needsModelSelection policy has real executed unit tests, but the new interactive behavior is checked only by reading files and regex-matching source: assert.match(popover, /modelSelectionRequest[\s\S]*setOpen\(true\)/), plus similar matches against ChatView.jsx and ChatSettingsPanel.jsx. No test renders the components or drives the state increment.
Suggested direction: Add at least one execution-level test asserting that incrementing the request opens the popover, that a further increment re-opens it after dismissal, and that a non-zero initial mount value does not auto-open — instead of matching source strings.
Reviewed revision b533075003c5.
|
Superseded by #869, which includes this picker UX and adds the authoritative server-side model requirement plus removal of remaining silent fallback paths. Keeping both open would duplicate the same frontend change and create avoidable merge/conflict debt. |
Summary
Tests
node --test src/components/ChatView/__tests__/modelSelectionPolicy.test.jsThe full frontend build was also attempted against current
main, but its memory-pressure guard deferred the run before compilation.