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 intoJul 7, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the four defects found in post-merge live verification of PR #495. Closes #501.
Changes
74772b2efix(openai): Copilot 401 now evicts the stale bearer, re-exchanges the GitHub OAuth token, and retries once (non-streaming + streaming); Chat Completions adapter now sendsstream: trueand parses real SSE — tolerates both Gemini-style complete tool-call chunks and OpenAI-style fragmented deltascd717f78fix(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_downkeep protocol semantics25c2a064fix(auth): non-interactive auth hydratesGEMINI_API_KEY(withGOOGLE_API_KEYfallback) for the google provider5022e650test(cli): tmux agent-loop tests setPUFFER_HOMEso first-run onboarding doesn't intercept queued turnsVerification
cargo test -p puffer-core, focused puffer-cli suites,cargo check --all-targets, rustfmt/cargo fmt --check all pass.scripts/ci-gates.sh --quickpasses (desktop frontend lane skipped: svelte-check not installed locally; changes are Rust-only)./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).🤖 Generated with Claude Code