Repository navigation
Clarify Copilot Decisions PAT support and rejection diagnostics - #11289
Conversation
Co-authored-by: lpcox <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
A Copilot 400 on /v1/decisions still emits misleading advice to check key validity and formatting when the endpoint is rejecting the token type.
1 open issue
What changed in this PR
Clarifies Copilot Decisions authentication through AWF’s API proxy and adds actionable PAT-rejection diagnostics without changing upstream response forwarding.
Changes:
- Adds
pat_unsupportedguidance for fully captured, inspectable Copilot 4xx rejections. - Documents token-forwarding behavior, credential limitations, and separate gh-aw client work.
- Adds regression coverage for credential injection, plain-text error preservation, redaction, and classification boundaries.
| File | Description |
|---|---|
docs/auth-matrix.md |
Explains Decisions credential limitations and diagnostic behavior. |
docs/api-proxy-sidecar.md |
Adds a Decisions usage note linking to authentication details. |
containers/api-proxy/upstream-log.test.js |
Covers PAT classification boundaries and audit fields. |
containers/api-proxy/upstream-log.js |
Adds the fixed PAT-rejection reason and guidance. |
containers/api-proxy/server.decisions.test.js |
Adds local HTTP fixtures for token injection, response preservation, and redaction. |
Review effort: Max (auto)
| if (provider === 'copilot' && statusCode >= 400 && statusCode < 500 && | ||
| !originalCapture.bodyOmitted && !originalCapture.truncated && | ||
| /\bPersonal Access Tokens are not supported for this endpoint\b/i.test(originalCapture.bodyValue)) { |
There was a problem hiding this comment.
Suppressed the generic Copilot 400 auth warning when the complete response matches the PAT rejection classification, while retaining the PAT-specific upstream error event. Added regression coverage for truncated captures. Commit: 18ffcf1.
|
@copilot address review feedback |
Co-authored-by: lpcox <[email protected]>
|
⏳ Copilot review left inline comments. @copilot To proceed:
|
Documentation PreviewDocumentation has been built for this PR. To view locally:
Built from commit adb00d1 |
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |

Copilot
/v1/decisionsrejects fine-grained PATs with a plain-text error that gh-aw evals reduces to an opaque HTTP 400. AWF forwards static credentials without exchanging PATs or bypassing endpoint restrictions.pat_unsupportedreason and actionable warning for fully captured Copilot 4xx rejections. Preserve upstream response bytes and existing bounded, secret-redacted logging.Example warning fields:
{ "event": "upstream_error_response", "provider": "copilot", "status": 400, "reason_code": "pat_unsupported" }