Skip to content

fix: resolve Gemini 400 error for multi-account paths#1

Merged
2214962083 merged 4 commits intonicepkg:mainfrom
rennzhang:rennzhang/fix-gemini-400-error
Feb 8, 2026
Merged

fix: resolve Gemini 400 error for multi-account paths#1
2214962083 merged 4 commits intonicepkg:mainfrom
rennzhang:rennzhang/fix-gemini-400-error

Conversation

@rennzhang
Copy link
Contributor

Description

Fixes Gemini API 400 errors when users are logged into multiple Google accounts. The /u/N/ path prefix (e.g., /u/0/, /u/1/) was not being included in API requests, causing authentication failures.

Changes:

  • Extract /u/N path prefix from the current URL via extractPathPrefix()
  • Include the prefix in the batchexecute endpoint, source-path query param, and referrer header
  • Backward compatible: single-account users (no /u/N/ prefix) are unaffected

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

@2214962083 2214962083 merged commit 63ee682 into nicepkg:main Feb 8, 2026
3 checks passed
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.

2 participants