Repository navigation
Description
Summary
On a personal GitHub account that authenticates Copilot with a fine-grained PAT in COPILOT_GITHUB_TOKEN, every evals: judge run fails with Decisions request failed (HTTP 400). I reproduced the cause outside Actions: POST https://api.githubcopilot.com/v1/decisions answers HTTP 400 with the plain-text body checking third-party user token: bad request: Personal Access Tokens are not supported for this endpoint. The check happens before the model is validated, so no model name can work with a PAT.
decisions_client.cjs hides this on purpose (it never exposes provider bodies) and only parses JSON bodies, so a plain-text 400 becomes an unexplained failure. The run stays green because the judge step is continue-on-error, and the result is not_evaluated / judge_failed.
Two things are asked for:
- Make this failure self-explanatory, with a distinct reason code and an actionable message.
- Decide and document whether evals are supposed to work with PAT authentication, which the auth docs present as the way to use Copilot on personal repositories.
Environment
- gh-aw
v1.2.1(CLI andgithub/gh-aw-actions), compiled withgh aw compile --strict. - Engine
copilot, modelgpt-6-luna. - Personal account, no organization.
COPILOT_GITHUB_TOKENis a fine-grained PAT, resource owner the user account, Copilot Requests = Read, as described indocs/src/content/docs/reference/auth.mdx.
Minimal workflow
---
on:
workflow_dispatch:
engine:
id: copilot
model: gpt-6-luna
permissions:
contents: read
copilot-requests: none
evals:
questions:
- id: named-purpose
question: Did the run name the repository's purpose in one sentence?
safe-outputs:
noop:
---
# Smoke test
Read README.md and call noop with one sentence that names what the repository is for.Evidence
1. The failing job
Three runs of the same workflow (2026-11-06) all ended the same way. The agent and detection jobs succeeded, then the evals job log shows:
evals Execute BinEval Decisions env:
GH_AW_DECISIONS_BASE_URL: https://api.githubcopilot.com/v1
GH_AW_DECISIONS_API_KEY: ***
GH_AW_DECISIONS_PROVIDER: github-copilot
GH_AW_EVALS_MODEL: copilot/gpt-6-luna-decisions
evals Execute BinEval Decisions Error: Decisions request failed (HTTP 400)
evals Execute BinEval Decisions at invokeDecisions (.../gh-aw/actions/decisions_client.cjs:135:11)
evals Execute BinEval Decisions ##[error]Unhandled error: Error: Decisions request failed (HTTP 400)
evals Execute BinEval Decisions at async executeMain (.../gh-aw/actions/run_evals.cjs:115:16)
usage/evals/evals_status.json from gh aw logs:
{"status":"not_evaluated","reason_code":"judge_failed","reason":"The Decisions evals request finished with outcome failure; no answers were recorded.","engine":"decisions","model":"copilot/gpt-6-luna-decisions","execution_outcome":"failure","execution_state":"started"}- Runs 1 and 2 set
evals.model: gpt-6-lunaexplicitly. Run 3 leftevals.modelunset, so the built-in aliasevalsresolved tocopilot/gpt-6-luna-decisions. All three fail identically, and the model name made no difference. - The job concluded
success, as in audit: failed continue-on-error evals and threat-detection engine steps are invisible (pre-flight failures report as workflow_succeeded) #73552 (closed).
2. Direct reproduction against the endpoint
The request is built the way invokeDecisions builds it (POST <base>/decisions, Authorization: Bearer <key>, body {model, input, questions}). $PAT is a fine-grained PAT with Copilot Requests = Read, the same kind as the workflow's.
curl -sS -i https://api.githubcopilot.com/v1/decisions \
-H "Authorization: Bearer $PAT" -H 'Content-Type: application/json' \
-d '{"model":"gpt-6-luna-decisions","input":"x","questions":[{"type":"predicate","name":"q","instructions":"Is x a letter?"}]}'Results, each a single request on 2026-11-06:
model in the request |
HTTP status | content-type |
Body |
|---|---|---|---|
gpt-6-luna-decisions |
400 | text/plain; charset=utf-8 |
checking third-party user token: bad request: Personal Access Tokens are not supported for this endpoint |
gpt-6-luna |
400 | text/plain; charset=utf-8 |
the same line |
not-a-real-model |
400 | text/plain; charset=utf-8 |
the same line |
The identical answer for a made-up model shows that the token is rejected first. A valid model name can not fix it.
3. Why the message is lost
At v1.2.1, actions/setup/js/decisions_client.cjs:
- line 121:
if (!response.ok) { - lines 122-134: only for 400 and 422,
response.json()is attempted. ASyntaxError(the body above is plain text) is swallowed on purpose,bodystays undefined, socodeis undefined andDecisionsModelUnavailableErroris not thrown. - line 135:
throw new Error(Decisions request failed (HTTP ${response.status}))runs with no detail.
In run_evals.cjs that error is not a DecisionsModelUnavailableError, so it is rethrown (line 127). classifyJudgeExecution then falls to the generic JUDGE_FAILED branch (line 162): "request finished with outcome failure". Nothing in the run points to the token.
4. Related issues checked
I searched github/gh-aw for the server message, judge_failed, gpt-6-luna-decisions and "evals HTTP 400". None describes this. Closest, none a duplicate:
- [aw-failures] Intermittent Copilot SDK auth failure ("Personal Access Tokens are not supported") aborts PR reviewer agents at turn 1 #37989 (closed): the same server message, but for the Copilot SDK token check in the PR reviewer agents.
- audit: failed continue-on-error evals and threat-detection engine steps are invisible (pre-flight failures report as workflow_succeeded) #73552 (closed): failed evals steps are invisible in
audit; it covers the proxy pre-flight failure, not this one.
Root cause
api.githubcopilot.com/v1/decisions refuses fine-grained PATs. The evals job passes ${{ secrets.COPILOT_GITHUB_TOKEN }} as GH_AW_DECISIONS_API_KEY (compiled workflow, Execute BinEval Decisions step), and the evals job has only permissions: contents: read. For the agent job a PAT works. For evals it can not, so a personal account has no documented way to run evals.
Not verified, because I have no organization:
- Whether
permissions: copilot-requests: writemakes the evals job usegithub.tokenwith a token the endpoint accepts. The docs say that mode needs an organization with centralized billing. - Whether the same endpoint accepts a GitHub App installation token or an OAuth token.
Proposed fix (plan for an agent)
Order matters: 1 and 2 are safe whatever the answer to the open question is.
actions/setup/js/decisions_client.cjs(the!response.okblock around lines 121-135)- For 400, 401 and 403, read the body as text once (
await response.text(), cap at 2 KB), then tryJSON.parseon it for the existingerror.codecheck. - If the text contains
Personal Access Tokens are not supported, throw a newDecisionsAuthUnsupportedError. Keep the "never expose provider bodies" rule: the error message is a fixed string such asDecisions endpoint does not accept this kind of token (HTTP 400); the provider text is only used to choose the class and is not echoed. - Export the new class next to
DecisionsModelUnavailableError.
- For 400, 401 and 403, read the body as text once (
actions/setup/js/run_evals.cjs- In
executeMain(around line 127), catch the new class likeDecisionsModelUnavailableError, setevidence.stateto a newEVALS_REASON_CODES.AUTH_UNSUPPORTED, and write the evidence file. - In
classifyJudgeExecution(around lines 151-163) add a branch that returns a reason such as:The Decisions endpoint rejected the credential. It does not accept personal access tokens. Use an authentication method the endpoint supports, or remove evals from the workflow; no answers were recorded. - Make sure
render_evals_summary.cjsshows the new reason and thatgh aw logs/auditsurface it as a finding (this is the point of audit: failed continue-on-error evals and threat-detection engine steps are invisible (pre-flight failures report as workflow_succeeded) #73552).
- In
- Compiler warning (
pkg/workflow, whereevalsis validated)- If
evalsis declared, the engine iscopilot, and the workflow has nocopilot-requests: write, print a warning duringgh aw compilethat the judge needs a credential the Decisions endpoint accepts. Make it an error under--strictonly after the open question below is answered.
- If
- Docs
docs/src/content/docs/reference/auth.mdx(COPILOT_GITHUB_TOKENsection, which now recommends the PAT for "personal repositories"): add a note that PATs do not work forevals.- The evals reference page: state which authentication the judge supports.
- Tests
decisions_client.test.cjs: 400 withcontent-type: text/plainand the body above givesDecisionsAuthUnsupportedError; the same status with an unrelated plain-text body still gives the generic error; JSONmodel_not_foundstill givesDecisionsModelUnavailableError.run_evals.test.cjs: the new reason code appears inevals_status.jsonand in the classification of the execution outcome.
- Run
make agent-finish.
Open questions for maintainers
- Is rejecting PATs on
/v1/decisionsintended? If yes, which credential should a personal-account workflow use for evals? - If the answer is
copilot-requests: write, can the evals job get that permission without the whole workflow usinggithub.tokenfor inference? (The workflow-level permission also switches the agent togithub.token, which fails on personal accounts.) - Should a failing evals judge fail the run? Today the run is green and the only trace is
not_evaluatedin the artifact.
Not checked
- Behavior with a GitHub organization, with
copilot-requests: write, or with non-PAT tokens. - Whether the server message wording is stable. The proposed classification matches on it, so it should be agreed with the service owners.
- The exact bytes the evals job sends (I rebuilt the request from the source, not from a capture).
Activity
pelikhan commentedon Nov 7, 2026
@lpcox not going through awf yet for this but awf maybe doing magic with the token to make things work
lpcox commentedon Nov 8, 2026
🔗 AWF tracking issue: #aw_track2
fix(evals): send Copilot integration identity to Decisions (#75859)
lpcox commentedon Nov 8, 2026
🔗 AWF tracking issue: #aw_track2
pelikhan commentedon Nov 8, 2026
@copilot make sure the copilot integration id is set to "agentic-workflows" when calling decisions the GitHub cloud
pelikhan commentedon Nov 8, 2026
it was missing
Copilot-Integration-Id: agentic-workflows. PAT tested and working.