Skip to content

fix(providers): PR #495 follow-ups — copilot 401 retry, real SSE streaming, device-flow errors, gemini env keys (#501) - #502

Merged
Milhouszhang merged 4 commits into
berabuddies:masterfrom
Milhouszhang:fix/501-pr495-followups
Jul 7, 2026
Merged

fix(providers): PR #495 follow-ups — copilot 401 retry, real SSE streaming, device-flow errors, gemini env keys (#501)#502
Milhouszhang merged 4 commits into
berabuddies:masterfrom
Milhouszhang:fix/501-pr495-followups

Conversation

@Milhouszhang

Copy link
Copy Markdown
Collaborator

Fixes the four defects found in post-merge live verification of PR #495. Closes #501.

Changes

  • 74772b2e fix(openai): Copilot 401 now evicts the stale bearer, re-exchanges the GitHub OAuth token, and retries once (non-streaming + streaming); Chat Completions adapter now sends stream: true and parses real SSE — tolerates both Gemini-style complete tool-call chunks and OpenAI-style fragmented deltas
  • cd717f78 fix(copilot): device-flow polling network/malformed/non-2xx failures now propagate as errors instead of Pending, so the desktop UI's consecutive-error path engages; authorization_pending/slow_down keep protocol semantics
  • 25c2a064 fix(auth): non-interactive auth hydrates GEMINI_API_KEY (with GOOGLE_API_KEY fallback) for the google provider
  • 5022e650 test(cli): tmux agent-loop tests set PUFFER_HOME so first-run onboarding doesn't intercept queued turns

Verification

  • Unit/integration: mock-server tests for 401-retry-once and no-infinite-retry; SSE fixture tests for both Gemini and OpenAI streaming shapes; device-flow error-mapping tests; env hydration tests. cargo test -p puffer-core, focused puffer-cli suites, cargo check --all-targets, rustfmt/cargo fmt --check all pass. scripts/ci-gates.sh --quick passes (desktop frontend lane skipped: svelte-check not installed locally; changes are Rust-only).
  • Live E2E on this branch's binary: real Gemini (/v1beta/openai/chat/completions) — env-var auth (both aliases), real SSE streaming (7 network-paced deltas), native function-call turn, zero errors; real GitHub Copilot — device-flow login end-to-end, token exchange, live streamed turn (50 SSE deltas + clean turn-complete). Copilot 401 mid-turn recovery remains mock-verified (bearer cache design prevents external injection of a real 401).
  • Known pre-existing: tmux_snapshots failures exist on master (environmental, sandbox denies tmux sockets).

🤖 Generated with Claude Code

@Milhouszhang
Milhouszhang merged commit 4340cbe into berabuddies:master Jul 7, 2026
5 checks passed
@Milhouszhang
Milhouszhang deleted the fix/501-pr495-followups branch July 7, 2026 06:22
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.

providers(follow-up): defects found in post-merge live verification of PR #495 (Gemini + Copilot)

1 participant