fix(handler): provide fallback for connectionId when undefined - #3130
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a fallback for connectionId using credentials?.connectionId when saving call logs in open-sse/handlers/chatCore.ts. The reviewer noted that applying this fallback locally only addresses call logging, leaving other critical downstream systems (such as usage persistence, quota tracking, and request logging) vulnerable to receiving undefined. To ensure consistency, the reviewer suggested resolving the fallback once at the beginning of the handleChatCore function.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| requestedModel, | ||
| provider, | ||
| connectionId, | ||
| connectionId: connectionId || credentials?.connectionId || undefined, |
There was a problem hiding this comment.
While adding a fallback for connectionId in saveCallLog is helpful, applying this fallback locally only fixes call logging. Many other critical systems in handleChatCore rely on connectionId and will still receive undefined if the parameter is not provided. These include:
- Usage Persistence:
persistFailureUsage(line 1702) andsaveRequestUsage(line 5200) - Quota Tracking:
persistCodexQuotaState(lines 1771, 1825, 1830) which updates the provider connection in the database - Request Logging & Pending Tracking:
trackPendingRequestandappendRequestLogcalls throughout the handler
If connectionId is undefined, updateProviderConnection(connectionId, ...) will be called with undefined, failing to persist the quota state.
Recommendation:
Resolve the fallback once at the very beginning of handleChatCore by reassigning the parameter:
connectionId = connectionId || credentials?.connectionId || undefined;This ensures that all downstream logging, tracking, and database persistence systems automatically and consistently benefit from the fallback.
Code Review SummaryStatus: No New Issues Found | Recommendation: Merge (existing comment addressed) Files Reviewed (1 file)
Reviewed by step-3.7-flash-20260528 · 319,230 tokens |
…ic-asset build fix - #3131 Kiro Opus 4.8 catalog (thanks @artickc) - #3132 Kimi thinking-mode reasoning_content fix (thanks @bypanghu) - #3130 connectionId fallback + kilo call logging (thanks @androw) - build: standalone static-asset path fix (white login screen after build-output reorg) - contributors hall: +@artickc +@bypanghu +@androw (15 total)
…uzapw#3131/diegosouzapw#3132) + static-asset build fix - diegosouzapw#3131 Kiro Opus 4.8 catalog (thanks @artickc) - diegosouzapw#3132 Kimi thinking-mode reasoning_content fix (thanks @bypanghu) - diegosouzapw#3130 connectionId fallback + kilo call logging (thanks @androw) - build: standalone static-asset path fix (white login screen after build-output reorg) - contributors hall: +@artickc +@bypanghu +@androw (15 total)
…uzapw#3131/diegosouzapw#3132) + static-asset build fix - diegosouzapw#3131 Kiro Opus 4.8 catalog (thanks @artickc) - diegosouzapw#3132 Kimi thinking-mode reasoning_content fix (thanks @bypanghu) - diegosouzapw#3130 connectionId fallback + kilo call logging (thanks @androw) - build: standalone static-asset path fix (white login screen after build-output reorg) - contributors hall: +@artickc +@bypanghu +@androw (15 total)
…uzapw#3131/diegosouzapw#3132) + static-asset build fix - diegosouzapw#3131 Kiro Opus 4.8 catalog (thanks @artickc) - diegosouzapw#3132 Kimi thinking-mode reasoning_content fix (thanks @bypanghu) - diegosouzapw#3130 connectionId fallback + kilo call logging (thanks @androw) - build: standalone static-asset path fix (white login screen after build-output reorg) - contributors hall: +@artickc +@bypanghu +@androw (15 total)
Summary
Related Issues
Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesTests Added Or Updated
Coverage Notes
src/,open-sse/,electron/, orbin/, explain which tests cover the change.Reviewer Notes