-
Notifications
You must be signed in to change notification settings - Fork 37
Slopus/pr/upstream sync regressions 2026 01 15 #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ca6a056
308c3bf
2bfe284
ec42982
2e65322
ba866b8
8b37d10
306cd71
7b937d8
e25e11b
0cfafbc
45a9038
ec01fad
80b1789
5d4f1f9
98db44f
33f305a
c276449
4f49ef4
01281fb
c6f3441
da8a1ef
cf83504
b4c2f26
f0929d1
ecc6246
3debc6c
3ca8e85
f6ce61c
80c1abd
5c9702c
a9eb77c
7c5b888
406c96c
d30d5db
ba0c6c3
e8e6c4b
f4b1ffe
71ffe40
a57cbb5
64e8422
c197e9f
92e1f39
45a5ac6
8336b40
b79dfe5
78d696b
8307d1d
4692b3b
f3815a1
97d644e
17c531e
8ea98a2
71a0edf
3e40eb0
05233ff
94f8b28
7482c7c
b00bbc0
3d1d6fb
f0148f1
6bb0209
a1bcc98
2b8b6e7
4b70ee6
21c7968
04628ed
5571035
1a36c61
8adde3f
15a768d
b870e1d
47ae80a
6673881
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -168,6 +168,9 @@ function SessionViewLoaded({ sessionId, session }: { sessionId: string, session: | |
| const shouldShowCliWarning = isCliOutdated && !isAcknowledged; | ||
| // Get permission mode from session object, default to 'default' | ||
| const permissionMode = session.permissionMode || 'default'; | ||
| // Get model mode from session object - for Gemini sessions use explicit model, default to gemini-2.5-pro | ||
| const isGeminiSession = session.metadata?.flavor === 'gemini'; | ||
| const modelMode = session.modelMode || (isGeminiSession ? 'gemini-2.5-pro' : 'default'); | ||
| const sessionStatus = useSessionStatus(session); | ||
| const sessionUsage = useSessionUsage(sessionId); | ||
| const alwaysShowContextSize = useSetting('alwaysShowContextSize'); | ||
|
|
@@ -193,6 +196,11 @@ function SessionViewLoaded({ sessionId, session }: { sessionId: string, session: | |
| storage.getState().updateSessionPermissionMode(sessionId, mode); | ||
| }, [sessionId]); | ||
|
|
||
| // Function to update model mode (for Gemini sessions) | ||
| const updateModelMode = React.useCallback((mode: 'default' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite') => { | ||
| storage.getState().updateSessionModelMode(sessionId, mode); | ||
| }, [sessionId]); | ||
|
|
||
| // Memoize header-dependent styles to prevent re-renders | ||
| const headerDependentStyles = React.useMemo(() => ({ | ||
| contentContainer: { | ||
|
|
@@ -272,6 +280,8 @@ function SessionViewLoaded({ sessionId, session }: { sessionId: string, session: | |
| sessionId={sessionId} | ||
| permissionMode={permissionMode} | ||
| onPermissionModeChange={updatePermissionMode} | ||
| modelMode={modelMode as any} | ||
| onModelModeChange={updateModelMode as any} | ||
|
Comment on lines
+283
to
+284
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's examine SessionView.tsx around the mentioned lines
head -n 300 sources/-session/SessionView.tsx | tail -n 140Repository: leeroybrun/happy Length of output: 5956 🏁 Script executed: # Find AgentInput component to see its prop types
fd -n "AgentInput" -t f | head -20Repository: leeroybrun/happy Length of output: 290 🏁 Script executed: # Check what files exist in sources/components
ls -la sources/components/ | grep -i agent || echo "No agent files found, searching further"Repository: leeroybrun/happy Length of output: 431 🏁 Script executed: # Search for AgentInput more broadly
rg -l "AgentInput" sources/ --type ts --type tsxRepository: leeroybrun/happy Length of output: 87 🏁 Script executed: # Search for AgentInput without type restriction
rg "AgentInput" sources/ --include "*.ts" --include "*.tsx"Repository: leeroybrun/happy Length of output: 501 🏁 Script executed: # Read AgentInput.tsx to check the prop types
head -n 100 sources/components/AgentInput.tsxRepository: leeroybrun/happy Length of output: 3760 🏁 Script executed: # Search for modelMode prop definition in AgentInput
rg "modelMode" sources/components/AgentInput.tsx -B2 -A2Repository: leeroybrun/happy Length of output: 539 🏁 Script executed: # Run typecheck
cd sources && yarn typecheck 2>&1 || trueRepository: leeroybrun/happy Length of output: 245 🏁 Script executed: # Find permissionTypes to see the actual ModelMode definition
rg "type ModelMode" sources/Repository: leeroybrun/happy Length of output: 115 🏁 Script executed: # Also search for ModelMode definition more broadly
rg "ModelMode\s*=" sources/ -A2Repository: leeroybrun/happy Length of output: 775 🏁 Script executed: # Check the permissionTypes file
fd "permissionTypes" sources/ -t fRepository: leeroybrun/happy Length of output: 91 🏁 Script executed: # Read the full permissionTypes.ts file to see complete ModelMode definition
cat sources/sync/permissionTypes.tsRepository: leeroybrun/happy Length of output: 539 🏁 Script executed: # Also check if there's a proper ModelMode type being imported anywhere
rg "import.*ModelMode" sources/ -A1 -B1Repository: leeroybrun/happy Length of output: 919 🏁 Script executed: # Check the exact line where modelMode is passed to AgentInput in SessionView
sed -n '280,290p' sources/-session/SessionView.tsxRepository: leeroybrun/happy Length of output: 568 🏁 Script executed: # Check if SessionView.tsx imports ModelMode type
rg "import.*ModelMode" sources/-session/SessionView.tsxRepository: leeroybrun/happy Length of output: 42 🏁 Script executed: # Check the derivation of modelMode at line 171-173
sed -n '171,175p' sources/-session/SessionView.tsxRepository: leeroybrun/happy Length of output: 435 🏁 Script executed: # Check if updateSessionModelMode function exists and what it accepts
rg "updateSessionModelMode" sources/ -A3 -B1Repository: leeroybrun/happy Length of output: 1943 🏁 Script executed: # Check what types are actually being used in SessionView
head -n 50 sources/-session/SessionView.tsx | grep -E "^import|^from"Repository: leeroybrun/happy Length of output: 1934 🏁 Script executed: # Check the session object type to see what modelMode property type is
rg "session.*modelMode" sources/ -B2 -A2 | head -30Repository: leeroybrun/happy Length of output: 1918 🏁 Script executed: # Check the Session type definition to see what modelMode property is typed as
rg "interface.*Session\|type.*Session" sources/sync/storageTypes.ts -A30 | head -60Repository: leeroybrun/happy Length of output: 42 🏁 Script executed: # Check if there's a Session interface that defines modelMode property
rg "modelMode.*:" sources/sync/storageTypes.ts -B2 -A2Repository: leeroybrun/happy Length of output: 627 Remove The The Either import and use the 🤖 Prompt for AI Agents |
||
| metadata={session.metadata} | ||
| connectionStatus={{ | ||
| text: sessionStatus.statusText, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this works, using
as anybypasses type checking and can hide potential bugs. It seems there might be a slight type mismatch between themodelModeandupdateModelModehere and the props expected by the child component (AgentInput).It would be best to resolve the type discrepancy to ensure full type safety. For example, you could explicitly cast
modelModeto theModelModetype if you are certain it's compatible, rather than usingany.Similarly,
updateModelModeshould be assignable toonModelModeChangewithoutas anyif the types are correctly aligned. Given the scope of this refactoring, this is a minor point, but it's good practice to avoidanywhere possible.