Repository navigation
Conversation
PR governanceThis PR follows the template and is marked ready for human review. |
|
Updated all seven exact template section names, both self-review/readiness checkboxes, and the actual Changes Made bullet list requested in the edited governance comment. Added copied runtime response records to Real Behavior Proof. The body preserves scoped tests/lint/type checks, ordinary native pre-push qualification and earlier environment failures, rollout/rollback paths, and live-provider/editor limits; no full-Python-suite or live-provider claim was added. |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Preserve alternate native completion paths across configured gateways and enforce editor-versus-chat credential boundaries through the real forwarding entrypoints.
|
Maintainer check (2026-10-10): updated the branch with current This fix is on the path for an Enterprise customer's VS Code inline completions (401 today), so it is queued for review ahead of the other Copilot PRs. |
|
Thanks for merging current |
Description
Closes #3352.
Preserve a native editor's
ghu_OAuth bearer and integration identity only for a recognized Copilot completions host plus a FIM completions path. Apply the same path check after removing a configured gateway prefix. Strip an unrelatedx-api-keybut do not replace the editor's seat with the operator's configuredtidtoken or stamp chat defaults.The generic chat/CLI token classifier and managed-seed refresh policy are unchanged. This is the narrow inline-completion exception, not broad GHU forwarding for chat (#3402 covers a different surface).
Type of Change
Changes Made
Testing
headroom/copilot_auth.pyNormal commit/pre-push qualification completed without bypass: Rust fmt, workspace Clippy and workspace tests; native extension build/install/import verification; critical Python suite; commitlint. The ordinary
git pushsucceeded with the installed native library explicitly resolved.Test Output
The warning is the existing Anthropic tokenizer-approximation warning. Targeted auth regression results and actual HTTP results are recorded below; this is not a full-Python-suite claim.
Real Behavior Proof
uv run pytest -q tests/test_copilot_inline_client_auth.py tests/test_copilot_auth.py tests/test_copilot_vscode_completions_routing.py tests/test_proxy_copilot_auth_hooks.py tests/test_provider_copilot_vscode_config.py; Ruff on the three affected Python files anduv run mypy headroom/copilot_auth.py. Baseline regressions explicitly imported the unchanged auth module from the sibling main-base worktree. Actual HTTP used the configured gateway path/p/inline-seat-repro/v1/engines/gpt-41-copilot/completionswith nativeCopilot-Integration-Id: vscodeand a synthetic GHU bearer, while an operator TID token was configured.libonnxruntime.so.1.26.0throughORT_DYLIB_PATH, then run the unchangedkompress_paritytest binary with--nocapture: 2 passed / 21 fixtures matched byte-for-byte in 9.62s.Copied response records from the actual initial HTTP qualification (synthetic local provider and tokens; baseline auth module versus this fix):
{"lane":"direct","status":200,"body":{"id":"synthetic-inline-completion","object":"text_completion","choices":[{"index":0,"text":"x * x","finish_reason":"stop"}]}} {"lane":"proxy-before","status":401,"body":{"error":{"code":"invalid_token","message":"Editor seat and native integration required"}}} {"lane":"direct-after","status":200,"body":{"id":"synthetic-inline-completion","object":"text_completion","choices":[{"index":0,"text":"x * x","finish_reason":"stop"}]}} {"lane":"proxy-after","status":200,"body":{"id":"synthetic-inline-completion","object":"text_completion","choices":[{"index":0,"text":"x * x","finish_reason":"stop"}]}} {"lane":"wrong-client-remains-unauthorized","status":401,"body":{"error":{"code":"invalid_token","message":"Editor seat and native integration required"}}}Runtime Rollout Safety
8c1beb20aeb8f0576095ae4893176ce16c2ede2a.Review Readiness
Checklist
CHANGELOG.mdnot edited; Conventional Commit PR title used