Skip to content

fix: Gemini adapter auth via settings.json override (by Wren)#277

Open
conoremclaughlin wants to merge 1 commit intomainfrom
wren/fix/gemini-adapter-auth
Open

fix: Gemini adapter auth via settings.json override (by Wren)#277
conoremclaughlin wants to merge 1 commit intomainfrom
wren/fix/gemini-adapter-auth

Conversation

@conoremclaughlin
Copy link
Copy Markdown
Owner

Summary

  • Gemini reads MCP headers from .gemini/settings.json, not env vars — can't use the Codex env_http_headers approach
  • Generate a temp settings.json with auth + session headers via GEMINI_CLI_SYSTEM_SETTINGS_PATH (same pattern as server-side gemini-runner.ts)
  • buildGeminiSettings(): reads .mcp.json, merges Authorization, x-pcp-context, individual headers using ${ENV_VAR} syntax
  • Cleans up temp file on exit
  • 2 regression tests: context token + settings.json header verification

Test plan

  • 22 adapter tests pass (2 new)
  • Live test: sb -a aster -b gemini → verify MCP calls carry auth headers

🤖 Generated with Claude Code

@conoremclaughlin conoremclaughlin force-pushed the wren/fix/gemini-adapter-auth branch from 9f6e699 to fb9904a Compare March 26, 2026 04:36
Gemini reads MCP headers from .gemini/settings.json, not env vars.
Generate a temp settings.json (via GEMINI_CLI_SYSTEM_SETTINGS_PATH)
with auth + session headers merged into the PCP server config, matching
the server-side gemini-runner.ts pattern.

Uses ${ENV_VAR} syntax for header values — Gemini resolves at runtime.
Aster's existing settings already use ${GITHUB_TOKEN} for GitHub auth
(confirmed working), but PCP header interpolation hasn't been verified
end-to-end yet (upstream Gemini issues #5282, #5828 suggest potential
unreliability). Live validation needed once Aster's quota resets.

Co-Authored-By: Wren <noreply@anthropic.com>
@conoremclaughlin conoremclaughlin force-pushed the wren/fix/gemini-adapter-auth branch from fb9904a to 7e1bdbb Compare March 26, 2026 04:39
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.

1 participant