CopilotClient fails with "No GitHub OAuth token or Copilot HMAC key provided" on Linux only, with a valid gitHubToken set
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- linux, node.js, typescript
Research direction
Start with the SDK source that sets COPILOT_SDK_AUTH_TOKEN and passes --auth-token-env, then reproduce the failure with the Linux native runtime in the node:22-slim environment. Inspect the runtime.node credential and authentication path, including the mentioned keyring/D-Bus behavior. Done means identifying the Linux-specific cause and documenting or testing a supported fix for models.list() and session calls.
Written by the indexing model from the issue text.
Description
CopilotClient (Node.js SDK, @github/copilot-sdk v1.0.13) fails every model-inference call (models.list(), and any session chat/sendAndWait) with:
Plain text
Execution failed: InvalidArg, No GitHub OAuth token or Copilot HMAC key provided
or, for models.list() specifically:
Plain text
Request models.list failed with message: Not authenticated. Please authenticate first.
...even though a valid gitHubToken is explicitly passed to the CopilotClient constructor. The exact same application code, same GitHub account, same token works correctly when run locally on Windows, and fails 100% of the time on Linux (Kubernetes/EKS). No BYOK or sub-agent/task tool is involved — this is the top-level session's very first call.
Environment
-
SDK:
@github/copilot-sdkv1.0.13 (latest at time of filing), native runtime (stdio transport, not in-process/FFI) -
Failing environment: Kubernetes (EKS) pod,
node:22-slim(Debian) base image, Node 22 -
Working environment: local Windows 11, same Node version, same code
-
GitHub host tested: both
github.com(default) and a GitHub Enterprise Cloud with Data Residency tenant (*.ghe.com) — identical error on both, so it is host-independent
Client construction (simplified)
TypeScript
const client = new CopilotClient({
mode: 'empty',
gitHubToken: accessToken, // valid gho_ OAuth App token, confirmed non-empty at this point
logLevel: 'debug',
});
await client.start();
const models = await client.models.list(); // fails here, ~15-30ms after session start
What we've ruled out
-
Token type: reproduced identically with both a
ghu_(GitHub App user-to-server) token and agho_(OAuth App) token. -
useLoggedInUser: confirmed via SDK source it already defaults tofalsewhenevergitHubTokenis set. -
Ambient/cached credentials: no OS credential manager entries involved on Linux; removing all cached Windows Credential Manager entries didn't change Windows (still works).
-
Env var pollution: added diagnostics dumping every
GH_*/GITHUB_*/COPILOT_*key present inprocess.env— nothing unexpected present. -
Network/firewall: confirmed the pod can reach both
api.<host>andcopilot-api.<host>(real HTTP responses, not connection errors). -
GH_HOST/GH_TOKEN/GH_ENTERPRISE_TOKEN: removed all three entirely (falling back to the defaultgithub.comhost with only the explicitgitHubToken) — identical error, ruling out host-scoped env vars as the cause. -
InProcessRuntimeConnection: not applicable/not in use; confirmed via docs it doesn't honor per-clientgitHubTokenanyway, so not a viable workaround. -
Missing
libsecret/D-Bus Secret Service: confirmed absent from thenode:22-slimcontainer (ldconfig -p/dpkg -lshow nothing). Extracted strings from the Linuxruntime.nodebinary show akeyring_core+ D-Bus Secret Service credential backend, but also a"...continuing without credential"string suggesting graceful degradation is intended — inconclusive, but worth noting as a possible contributing factor since we already setCOPILOT_DISABLE_KEYTAR=1viamode: 'empty'.
Confirmed facts
-
Diagnostic logging confirms the token reaches
CopilotClientnon-empty and correctly shaped at construction time. -
Per SDK source, this sets
COPILOT_SDK_AUTH_TOKENin the runtime env and passes--auth-token-env COPILOT_SDK_AUTH_TOKENto the spawned CLI process — confirmed happening correctly at the JS layer on both platforms. -
Failure happens within ~15-30ms of session start, immediately followed by session error/shutdown — before any model call actually executes.
Possibly related
This may share a root cause with #559 / #557 ("Built-in task tool fails with 'No GitHub OAuth token' in BYOK/Azure AI Foundry deployments"), where a community deobfuscation traced the same exact error string to a CopilotApiClient/sweagent-capi construction path that gets created without either credential under certain conditions. Our case differs (no BYOK, no sub-agent involved, fails on the very first top-level call) but the error text and general "client constructed without a resolved credential" shape look related.
Ask
-
Is
gitHubToken/--auth-token-enva tested/supported path on the Linux native runtime specifically? -
Any known Linux-only regression or required container dependency (e.g.
libsecret/D-Bus) for this auth path? -
Any way to get more diagnostic output from the native runtime for this failure — it's nearly silent on stderr even with
logLevel: 'debug'.
- Dominant language
- Java
- Stars
- 10.5k
- Forks
- 1.5k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 133
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/copilot-sdk
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/copilot-sdk#2709 · 1 comment ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
github/copilot-sdk#2673 ·
-
bug testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
github/copilot-sdk#2628 ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
github/copilot-sdk#2627 · 1 comment ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
github/copilot-sdk#2493 ·
All issues in github/copilot-sdk
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
apache/rocketmq-dashboard#4860 · 1 comment ·
-
agent-audit bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Vault-Web/cloud-page#144 ·