copilot-cli icon indicating copy to clipboard operation
copilot-cli copied to clipboard

Process-local auth token stops refreshing; all prompts fail until restart

Open NGloreous opened this issue 2 months ago • 15 comments

Describe the bug

A long-running Copilot CLI process permanently loses authentication. After the failure, every normal prompt and /ask immediately returns an authorization error. Running /login does not recover the process. Restarting and resuming the same session restores operation immediately.

The failure is process-local: several older concurrent CLI processes remained usable, and a newly launched process authenticated successfully. No COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN override was present.

The failing process first logged an expired/rejected GitHub MCP token almost exactly one hour after startup. It later logged 401 AuthenticateToken failed from the Copilot Tasks API. OAuth recovery attempted discovery against the enterprise Copilot endpoint but failed, leaving the process permanently unable to submit prompts.

Affected version

GitHub Copilot CLI 1.0.85 on Windows 11. The process was launched by a host application with --no-auto-update, --resume, and an additional MCP configuration.

Steps to reproduce

  1. Start an interactive Copilot CLI session and keep it open while performing a long-running workflow.
  2. Keep several other CLI sessions running concurrently.
  3. After approximately one hour or longer, submit another prompt.
  4. Observe that every prompt and /ask reports an authorization error.
  5. Run /login; observe that the process remains broken.
  6. Start a new CLI process; observe that it works immediately.
  7. Restart/resume the failed process; observe that authentication works again.

Expected behavior

Short-lived service and MCP tokens should refresh automatically without interrupting the active workflow. If refresh fails, /login should reload the new credentials into the current process.

Actual behavior

The process retains unusable authentication state indefinitely and all model turns fail until the process is restarted.

Timeline and log evidence

  • Process start: 2026-09-21 20:20:37 PDT
  • GitHub MCP 401 invalid_token: 2026-09-21 21:21:01 PDT (1 hour, 24 seconds after startup)
  • Copilot Tasks API 401 AuthenticateToken failed: 2026-09-21 22:05:48 and 22:09:33 PDT
  • MCP resource: https://api.githubcopilot.com/.well-known/oauth-protected-resource/mcp/readonly
  • Failed OAuth metadata discovery: https://api.enterprise.githubcopilot.com/mcp/readonly
  • Request IDs:
    • BE0F:221FB7:19F29C8:1DB6AF1:6AB20CAC
    • 633A:221FB7:1A2915E:1DF4EE8:6AB20D8D

A sanitized diagnostic excerpt is available. Raw conversation history and credentials have been excluded.

Related issues

  • #3763 — session token expiry stops workflows
  • #4203 — expired MCP OAuth token does not silently refresh
  • #4842 — MCP OAuth refresh/reconnect concurrency
  • #2818 — earlier one-hour session-token expiry issue, reported fixed in 1.0.35-3

Additional context

Current stable is newer than the affected installation. I will retest on the current stable version and update this issue, but this report captures a repeatable failure seen multiple times on 1.0.85.

NGloreous avatar Sep 22 '26 05:09 NGloreous

Sanitized diagnostic evidence: https://gist.github.com/NGloreous/e8240b34325f006dfea03e608dede309

NGloreous avatar Sep 22 '26 05:09 NGloreous

Additional evidence from a second occurrence on September 22, 2026:

Three separate interactive processes became unable to answer any prompt or /ask, while two other long-running processes continued answering successfully and a newly launched process worked immediately.

Common signature in all three affected processes

Each affected process repeatedly logged:

OAuthChallenge ... error="invalid_token"
resource_metadata="https://api.githubcopilot.com/.well-known/oauth-protected-resource/mcp/readonly"
Connecting to github-mcp-server...
OAuth authentication failed for github-mcp-server:
Failed to discover authorization server metadata for
https://api.enterprise.githubcopilot.com/mcp/readonly

The challenge identifies the public api.githubcopilot.com resource, but recovery/discovery is attempted against api.enterprise.githubcopilot.com. No successful GitHub MCP reinitialization follows in the affected processes.

The failures run on a per-process hourly timer anchored to each process's startup minute:

Process Started (PDT) First failed MCP refresh (PDT) Subsequent retries
A, resumed session Sep 21 22:57 Sep 22 05:58 approximately every hour at :58
B Sep 21 16:02 Sep 21 21:02 approximately every hour at :02
C Sep 21 08:48 Sep 22 06:48 approximately every hour at :48

For process A, the final attempted user turn was persisted at 2026-09-22T17:29:11.607Z; its MCP invalid_token was logged at 2026-09-22T17:29:11.542Z, only 65 ms earlier. The turn has no assistant response. This strongly suggests that a foreground turn encountering the failed MCP refresh path is converted into the generic authorization error.

Process B similarly ended with a scheduled failed refresh at 17:02:52Z, followed by another failed refresh at 17:03:03Z when the user attempted a prompt. The failed prompt was not persisted as a completed turn.

Healthy comparison

Two known-working processes were still completing responses at 17:19Z and 17:47Z. Their logs show successful github-mcp-server client initialization against api.enterprise.githubcopilot.com and do not show the repeated invalid_token / failed-discovery sequence in their active log history.

All compared processes use CLI 1.0.85, the same signed-in account, the same host application version, --no-auto-update, and equivalent injected MCP server sets. No GitHub token environment override is set.

Correction to initial report

The Copilot Tasks API 401 AuthenticateToken failed appeared in the first observed incident but did not appear in the two new foreground failures. It is therefore not the common trigger. The strongest shared signal is the built-in GitHub MCP refresh attempting to reconcile a public-resource challenge with the enterprise endpoint, then poisoning/aborting the foreground turn.

This seems closely related to #4203 and #4842, but the impact here is broader: after the refresh failure, ordinary prompts and /ask are unusable until the process is restarted.

NGloreous avatar Sep 22 '26 17:09 NGloreous

New evidence changes the root-cause assessment again: the failure reproduces with the built-in GitHub MCP server persistently disabled, so GitHub MCP is not required to trigger the outage.

Reproduction with GitHub MCP disabled

The affected session was restarted into a new process after running:

copilot mcp disable github-mcp-server

copilot mcp list confirms github-mcp-server (http, disabled). The restarted process contains no GitHub MCP initialization, OAuth discovery, invalid_token, or MCP 401 events.

Nevertheless, at 2026-09-23T17:00:52.472Z (10:00:52 AM PDT), a foreground user message produced this event sequence:

  • model.turn_started for gpt-5.4-nano
  • Three parallel model calls failed with 401 Unauthorized after 77 ms, 156 ms, and 203 ms
  • Each was automatically retried with reason transient_auth_error
  • Every retry also failed with 401 Unauthorized
  • All three model turns ended failed
  • session.error was emitted at 17:00:55.726Z:
errorType: authorization
statusCode: 401
message: Authorization error. Your credentials may be expired or invalid.
remediation: sign_in
providerCallId: 2ED2:3FB5EF:3C2155:40D625:6AB405C6
serviceRequestId: 916b6174-b6b8-4171-9aa9-074f268e8161

The process remained alive, but subsequent prompts encounter the same authorization failure until restart. The failed turn was present in the local events.jsonl, even though it was not persisted as a completed turn in the session database or written to the Agency process log.

There was also an earlier gpt-5.6-luna-utility model-call 401 in this process at 2026-09-23T15:39:05.938Z, followed by later successful activity before the fatal foreground failure. Another long-running process logged a runtime host-rethrow: 401 Unauthorized at 15:38:40.902Z but continued operating. This may indicate token expiry/refresh begins failing in individual runtime call paths before the whole foreground turn becomes unusable.

Version detail

The host application still launches the MSIX-pinned 1.0.85 executable with --no-auto-update. A standalone 1.0.88-2 download is present and copilot --version resolves to it outside the host, but the affected process command line and executable path confirm that this reproduction is still running 1.0.85.

Revised conclusion

The GitHub MCP failure seen previously was a correlated symptom, not the root trigger. The direct evidence now shows the primary Copilot model API credential becomes invalid in a long-lived process, the built-in transient_auth_error retries reuse or fail to refresh that credential, and the process cannot recover without restart. Disabling GitHub MCP does not mitigate the issue.

NGloreous avatar Sep 23 '26 17:09 NGloreous

Another recurrence on September 24, 2026 provides stronger evidence that this is a common process credential/token-manager failure rather than MCP-specific authentication.

Two long-lived sessions failed within 2 minutes 36 seconds

  • Session A: first model 401 at 2026-09-24T18:47:54.223Z
  • Session B: first model 401 at 2026-09-24T18:50:30.211Z

A scan of local session event streams found 401 events in exactly these two sessions during the 18:40-19:00Z window. Both were interactive Agency processes running Copilot CLI 1.0.85 with the built-in GitHub MCP server persistently disabled.

Session A emitted:

model calls -> 401 Unauthorized
retry reason -> transient_auth_error
session.error -> authorization / 401
providerCallId: 381C:372BD9:152E15:174560:6AB5705C
serviceRequestId: ebe2c4b9-57e9-4af3-8762-f53e2b6f630c

At essentially the same time, several independent authenticated surfaces in that same process failed:

Memory API: HTTP 401
WebSocket responses upgrade: 401 Unauthorized
Copilot model API: 401 Unauthorized, including all transient_auth_error retries
GitHub REST API (api.github.com): 401 Bad credentials
GitHub REST request ID: 7190:1FCDC7:2AEB98:2C3090:6AB5705F

This simultaneous failure across model inference, memory, WebSocket responses, and ordinary GitHub REST strongly suggests the process's shared credential/token manager becomes stale or invalid and does not successfully refresh.

Session B showed the same model behavior with gpt-5.6-sol:

  • initial call failed after 320 ms with 401
  • two transient_auth_error retries failed after 80 ms and 93 ms
  • turn ended failed
  • the user immediately restarted the process, so no final session.error request ID was emitted
  • the restarted process successfully made a model call immediately afterward

Version/update complication

A standalone 1.0.88-2 download exists and copilot --version outside Agency reports it, but every live interactive Agency process is still running C:\Users\...\.copilot-cli\1.0.85\copilot.exe because Agency launches with --no-auto-update. The installed MSIX also remains 1.0.85.0. Two Agency SDK helper processes observed today use an older bundled 1.0.84-5 binary.

Therefore none of these reproductions test the current 1.0.88-2 implementation, despite the shell-level version command appearing updated.

Current assessment

The evidence now supports a direct process-local authentication refresh/recovery defect in 1.0.85:

  1. A credential becomes invalid across several GitHub/Copilot services.
  2. The runtime recognizes model failures as transient_auth_error.
  3. Its retries continue using an invalid credential or fail to refresh it.
  4. Restarting creates fresh process auth state and works immediately.
  5. /login inside the poisoned process does not repair that process.
  6. Disabling GitHub MCP does not mitigate the problem.

NGloreous avatar Sep 24 '26 18:09 NGloreous

Correction and important new reproduction: the affected process for session f13e016b-67b7-48d3-8242-a0e3852585e8 is running Copilot CLI 1.0.88-2, despite its executable residing under a directory named .copilot-cli\1.0.85.

The standalone updater replaced the executable in place without renaming its parent directory. Definitive version evidence from the process startup log:

version=1.0.88-2
exe="...\.copilot-cli\1.0.85\copilot.exe"
exe_built=2026-09-22T18:05:41.078Z
exe_size=151248160

Windows file metadata for that exact executable also reports:

FileVersion: 1.0.88-2
ProductVersion: 1.0.88-2
SHA256: 82C5DF50D1E3893B475B913946BDE586504D8B6849902F7B0BCBC8835AF0D96E

The process started at 2026-09-22T18:20:57Z, after the binary was replaced, so this is not an old process retaining the 1.0.85 image.

1.0.88-2 failure sequence

At 2026-09-24T20:28:48.080Z, a foreground user message began a gpt-5.4-nano model turn:

  • Initial model call returned 401 Unauthorized after 80 ms.
  • Retry reason was transient_auth_error.
  • First retry returned 401 after 72 ms.
  • Second transient_auth_error retry returned 401 after 72 ms.
  • The model turn failed.
  • Final session error at 20:28:52.937Z:
errorType: authorization
statusCode: 401
providerCallId: CB73:108EF6:2E1537:329141:6AB58803
serviceRequestId: 10cddcb5-2bc6-4e40-9870-156345b9394d
remediation: sign_in

At 20:50:11.592Z, the same still-running process also failed the Copilot Tasks API:

status: 401
body: unauthorized: AuthenticateToken authentication failed
request_id: 1CCF:2C73A1:309101:35279A:6AB58D03

The built-in GitHub MCP server remains disabled, so it is again not involved.

Impact on prior assessment

My previous comments inferred the runtime version from the parent directory name and incorrectly classified this process as 1.0.85. The embedded binary version and startup telemetry are authoritative. This confirms the process-local auth refresh/recovery defect persists in 1.0.88-2, so upgrading from 1.0.85 is not a mitigation for the underlying issue.

NGloreous avatar Sep 24 '26 20:09 NGloreous

Two more recurrences on September 25, 2026, both definitively running CLI 1.0.88-2:

Session Process start (PDT) First model 401 (PDT) Process age
A Sep 24 13:52:12 Sep 25 11:20:24 21.47 hours
B Sep 24 11:50:42 Sep 25 12:19:18 24.48 hours

The failures were 58 minutes 54 seconds apart. A scan of all local session event streams found 401 events in exactly these two sessions during the broader 11:00 AM-12:30 PM window.

Both processes' startup logs report:

version=1.0.88-2
exe_built=2026-09-22T18:05:41.078Z

Session A

gpt-5.4-nano call sequence:

  • initial 401 after 69 ms
  • transient_auth_error retry -> 401 after 112 ms
  • second transient_auth_error retry -> 401 after 91 ms
  • final authorization session error
providerCallId: 3EE3:20AE3A:64F08:70BCF:6AB6BB6A
serviceRequestId: 81aaf576-7f4f-4bd7-928d-d681b73e07ad

Session B

gpt-5.4-nano call sequence:

  • initial 401 after 238 ms
  • transient_auth_error retry -> 401 after 170 ms
  • second transient_auth_error retry -> 401 after 74 ms
  • final authorization session error
providerCallId: 822D:2DE6E7:677A5:7CEA1:6AB6C939
serviceRequestId: dadeef47-cd7b-4fa1-9db6-4b51ff19f58c

Ten seconds later, the same process also received 401 Bad credentials from the ordinary GitHub REST API:

GitHub REST request ID: 7168:2E83FA:70ACD9:73E5F4:6AB6C93F

Restarting session B immediately restored operation.

1.0.89-3 status

The executable was replaced with 1.0.89-3 at 9:31 AM PDT today, after both failed processes had already started, so these two incidents do not test 1.0.89-3. The restarted session B process has startup telemetry confirming version=1.0.89-3; it is now the first controlled long-lived observation of that version.

This adds two more current-version (1.0.88-2) reproductions and again shows model auth plus GitHub REST auth failing within the same process.

NGloreous avatar Sep 25 '26 19:09 NGloreous

The cross-service failures make me suspect a stale shared credential generation rather than individual API bugs.

A robust model would make token refresh single-flight and versioned:

  • credential generation N is active;
  • one caller discovers expiry and refreshes;
  • generation N+1 is atomically published;
  • all model/MCP/memory/GitHub clients resolve credentials from the current generation rather than retaining their own stale copy.

/login should also explicitly invalidate every process-local credential/cache generation.

A useful failure-injection test is to make several services receive 401 concurrently and assert exactly one refresh occurs and all subsequent retries use the same new credential.

kvnloo avatar Sep 27 '26 17:09 kvnloo

Confirmed reproduction on an even newer build: Copilot CLI 1.0.89-5.

Session 5a1b48a8-85a5-448d-a0eb-da6db61c75dc crossed two process/version epochs today:

  1. The original process started September 25 on 1.0.89-3. It became auth-poisoned and scheduled prompts repeatedly emitted authorization errors. It was restarted at 2026-09-27T22:39:03Z.
  2. The replacement process started at 2026-09-27T22:39:04Z (3:39:04 PM PDT) with command-line --prefer-version 1.0.89-5. Its startup log authoritatively reports version=1.0.89-5.

The new 1.0.89-5 process then failed after less than four hours:

Failure PDT Process age Provider request ID Service request ID
First 7:26:51 PM 3.80 hours 1B57:296C47:1485089:18F57B9:6AB9D06A 23c1bf4e-1ce2-45cd-9ad0-5c21fa4fe003
Second 7:56:55 PM 4.30 hours FF1D:2AE577:8EC363F:A83BD1E:6AB9D776 5a9e6009-2c7e-4b7a-acf6-4c0659f1bbee

Both were session.error events with errorType=authorization, statusCode=401, and remediation sign_in.

A third prompt at 8:12:54 PM confirmed that the process remained poisoned:

gpt-5.6-sol initial call -> 401 after 296 ms
retry reason -> transient_auth_error
first retry -> 401 after 74 ms
retry reason -> transient_auth_error
second retry -> 401 after 79 ms
model turn failed -> 401 Unauthorized

The process had not been restarted between these attempts. This is the same unrecoverable retry behavior observed on 1.0.85, 1.0.88-2, and 1.0.89-3.

Current executable metadata:

FileVersion: 1.0.89-5
ProductVersion: 1.0.89-5
SHA256: DFDC603718193C84888BDB90E9C0666D9B54E09421108D691840E9B0ADB4A8D8

This rules out the available updates through 1.0.89-5 as a fix and shows the failure can occur much sooner than the previous 21-25 hour examples.

NGloreous avatar Sep 28 '26 03:09 NGloreous

سلام باز نمیکنه سفید بال هم دارم امت وصل نمیشه

در تاریخ دوشنبه ۲۸ سپتامبر ۲۰۲۶،‏ ۰۶:۴۵ Nolan Glore < @.***> نوشت:

NGloreous left a comment (github/copilot-cli#4929) https://github.com/github/copilot-cli/issues/4929#issuecomment-5862629580

Confirmed reproduction on an even newer build: Copilot CLI 1.0.89-5.

Session 5a1b48a8-85a5-448d-a0eb-da6db61c75dc crossed two process/version epochs today:

  1. The original process started September 25 on 1.0.89-3. It became auth-poisoned and scheduled prompts repeatedly emitted authorization errors. It was restarted at 2026-09-27T22:39:03Z.
  2. The replacement process started at 2026-09-27T22:39:04Z (3:39:04 PM PDT) with command-line --prefer-version 1.0.89-5. Its startup log authoritatively reports version=1.0.89-5.

The new 1.0.89-5 process then failed after less than four hours: Failure PDT Process age Provider request ID Service request ID First 7:26:51 PM 3.80 hours 1B57:296C47:1485089:18F57B9:6AB9D06A 23c1bf4e-1ce2-45cd-9ad0-5c21fa4fe003 Second 7:56:55 PM 4.30 hours FF1D:2AE577:8EC363F:A83BD1E:6AB9D776 5a9e6009-2c7e-4b7a-acf6-4c0659f1bbee

Both were session.error events with errorType=authorization, statusCode=401, and remediation sign_in.

A third prompt at 8:12:54 PM confirmed that the process remained poisoned:

gpt-5.6-sol initial call -> 401 after 296 ms retry reason -> transient_auth_error first retry -> 401 after 74 ms retry reason -> transient_auth_error second retry -> 401 after 79 ms model turn failed -> 401 Unauthorized

The process had not been restarted between these attempts. This is the same unrecoverable retry behavior observed on 1.0.85, 1.0.88-2, and 1.0.89-3.

Current executable metadata:

FileVersion: 1.0.89-5 ProductVersion: 1.0.89-5 SHA256: DFDC603718193C84888BDB90E9C0666D9B54E09421108D691840E9B0ADB4A8D8

This rules out the available updates through 1.0.89-5 as a fix and shows the failure can occur much sooner than the previous 21-25 hour examples.

— Reply to this email directly, view it on GitHub https://github.com/github/copilot-cli/issues/4929?email_source=notifications&email_token=BMBZYCSLQFIQIPWG2Z62FO35RHJV3A5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKOBWGI3DEOJVHAYKM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-5862629580, or unsubscribe https://github.com/notifications/unsubscribe-auth/BMBZYCQUBQGQWWBKX543MLT5RHJV3AVCNFSNUABFKJSXA33TNF2G64TZHM2TQNJYGYYDMNRUHNEXG43VMU5TKNJTGU3TOOJTHE22C5QC . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Tak2121 avatar Sep 28 '26 03:09 Tak2121

More recurrences on September 28, including another clustered failure across two sessions.

Session on 1.0.89-5

The process started at 2026-09-28T04:26:56Z (September 27, 9:26:56 PM PDT). Its startup log reports version=1.0.89-5.

It remained auth-poisoned overnight, with scheduled prompts emitting 401 authorization errors approximately every 30 minutes. A foreground/user-visible failure at 2026-09-28T15:04:59.893Z (8:04:59 AM PDT) occurred after 10.63 hours of process lifetime:

providerCallId: CBE2:2653ED:D803FB:E8ED07:6ABA821A
serviceRequestId: 80866380-d435-4c4c-b35f-194ca2119888
statusCode: 401
errorType: authorization

Recent preceding scheduled failures from this same poisoned process included:

7:04:51 AM PDT  C2A5:51EA8:449EAF:4EEA00:6ABA7401
7:34:55 AM PDT  A1BB:EDE5C:AED0A8:BBFD43:6ABA7B0E
8:04:59 AM PDT  CBE2:2653ED:D803FB:E8ED07:6ABA821A

Second session 13 minutes later

A different session failed at 2026-09-28T15:18:16.791Z (8:18:16 AM PDT), only 13 minutes 17 seconds later. That process had loaded 1.0.89-3 at startup and had been running for approximately 68 hours.

providerCallId: 36B8:120C0B:89F6C7:9E49A8:6ABA853B
serviceRequestId: 39043cb7-7eaf-4515-93ca-93743050482e

The sequence exposed another retry-state problem:

15:18:16.791  initial model call -> 401 after 89 ms
15:18:17.796  retry reason -> transient_auth_error
15:18:20.705  session.error authorization/401 emitted to the UI
15:18:53.706  the already-failed retry finally returned 401 after 35.9 seconds
15:18:54.716  another transient_auth_error retry started
15:18:54.806  retry returned 401 after 88 ms; turn failed

Thus the session reports a terminal authorization error to the user while retry work continues in the background for another ~34 seconds. This may contribute to the process entering or remaining in an inconsistent state.

The same process also received ordinary GitHub REST 401 Bad credentials immediately after the model failure:

GitHub REST request ID: 3DFF:282E1F:776A4C:7B6845:6ABA853E

Restarting the second session launched 1.0.89-5 and restored operation.

This provides another 1.0.89-5 reproduction and another near-time cluster across independent sessions, while also showing that the runtime's auth-retry lifecycle can outlive the user-visible terminal error.

NGloreous avatar Sep 28 '26 15:09 NGloreous

Deep comparison of the disproportionately failing long-running loop found an important distinction from the permanently poisoned foreground sessions:

  • The session executed 181 recurring scheduled ticks over 64.8 hours.
  • 141 ticks produced 146 authorization session.error events; every one was immediately associated with source=schedule-*. No 401 in this session was attributed to an unscheduled user message.
  • The errors formed 11 contiguous failure windows. Seven of the first ten completed windows recovered on a later scheduled tick without a local process restart. The other three recovered after restart. This differs from the foreground/process-wide failures, which remained poisoned until restart.
  • Most failures were ordinary idle deliveries: 142/146 were not steering-overlap cases. Steering is therefore not required.
  • Schedule recreation is not required: 96 errors occurred under one stable schedule.
  • Compaction and heavy tool volume are not required: a typical failed tick returned 401 in about 3.2 seconds, before any tool call.
  • The active process logs contain none of the corresponding 401s even though the events file does, which is consistent with a separate scheduled/session execution credential path.

Controls:

  • Another remote session scheduled only 7 ticks over 3.1 hours and had 0 failures, so that run was too short to exercise the long-duration path.
  • A different schedule-heavy session ran 127 ticks over 138 hours and had 12 scheduled 401s plus several unscheduled 401s. Its scheduled turns were at least as tool-heavy, so raw workload does not explain the 78% failure rate in the affected session.

Current interpretation: there are likely two related but distinguishable auth-refresh failure modes: (1) the previously reported process-wide credential state that remains poisoned until restart, and (2) a session/scheduler credential or lease that can enter multi-hour 401 windows and later recover independently. The high count in the affected loop is mostly repeated observation of the same bad window at every 15/30-minute tick, not 146 independent expirations. Session-specific persisted state remains the strongest explanation for why resuming the same loop fails much more often while concurrent/new sessions work.

Latest request IDs from the scheduled/session path include 09C1:18E4E6:15FD649:17AE936:6ABA951F and F0D7:2D5F22:1D70881:1F5BFF2:6ABA9C2C.

NGloreous avatar Sep 28 '26 17:09 NGloreous

Additional strong evidence after restarting the affected session:

  • Session resumed at 2026-09-28T17:07:07.891Z on CLI 1.0.89-5.
  • A model inference/utility call succeeded at 17:07:10.023Z (serviceRequestId=7c3d54f7-c0bd-4bed-bdad-35deeef2eec7).
  • Forty-eight seconds later, model discovery failed with 401 unauthorized: AuthenticateToken authentication failed (Failed to load models).
  • Another model call succeeded at 17:08:12.218Z (serviceRequestId=e63fc8af-1779-4cb9-b988-c1d3c99e021e).
  • Model discovery failed again 24 seconds later with the same 401.
  • The user confirmed /ask continued to work while these authorization errors were displayed.
  • The new local process log contains no matching 401 entry.

This demonstrates simultaneous valid and invalid auth state inside one freshly restarted process: inference is authorized while model-catalog/discovery is unauthorized. The immediate post-restart errors are therefore not evidence that one global credential is simply expired. They point to endpoint-specific credential/token caches or independently refreshed auth consumers. This can also explain why /login or process restart appears to repair some surfaces but not others.

NGloreous avatar Sep 28 '26 17:09 NGloreous

Fresh-session reproduction disproves the assumption that only aged, resumed, or forked sessions can become poisoned:

Session af430c3e-e0c1-4dd5-a44d-13668f95ddad:

  • Created 2026-09-28T17:57:25.817Z on CLI 1.0.89-5.
  • fork_count: 0; it was a genuinely new remote-steerable task/session.
  • Its first user/model turn began at 18:07:03.095Z, about 9m37s after creation.
  • The selected model was gpt-4o-mini, endpoint /chat/completions.
  • All three attempts immediately returned 401 (249ms, 80ms, 74ms), then terminal authorization failure.
  • Request IDs:
    • A372:6EE86:23BDFDF:263B177:6ABAACC7, service 4c641c4f-9883-47d6-aa53-cab24b7bdb5d
    • A372:6EE86:23BE740:263B974:6ABAACC7, service b1b439d4-0bb2-4d19-aab2-1eb06c8b3ca1
    • A372:6EE86:23BEF2F:263C214:6ABAACC9, service 21049716-efa5-416a-8cec-951aa490f6c0
    • terminal: A372:6EE86:23BF2C7:263C5D9:6ABAACC9, service 1a52ae6b-d945-4b60-b95d-18c389b5872a

Control evidence:

  • Another concurrent session successfully called the same gpt-4o-mini /chat/completions route at 17:57:33.346Z, eight seconds after this new session's session.start.
  • Several other sessions successfully called /responses during the same period.
  • Across recent sessions, gpt-4o-mini had 15 successful calls; these three 401s occurred only in this new session.

Therefore this was not a model outage, account-wide expiry, stale conversation inheritance, or an aged-process boundary. A newly created session can begin with invalid per-session/request authorization while concurrent sessions using the identical account and endpoint remain valid. The strongest remaining hypothesis is a race or bad credential snapshot during remote task/session initialization.

NGloreous avatar Sep 28 '26 18:09 NGloreous

@NGloreous thanks for the extensive evidence. Since 1.0.99 a running session re-reads the stored credential after a 401 instead of reusing the rejected token, and expiring credentials are refreshed, which should cover the "stuck until restart" behaviour you saw. Could you let us know whether this still happens on 1.0.114, and if so share the session ID and log timestamps of the first 401?

hstaudacher avatar Nov 18 '26 16:11 hstaudacher

We're closing this because we couldn't make progress without the information requested above. If this still happens on the latest stable release (v1.0.117), please comment here with those answers and we'll reopen it.

hstaudacher avatar Nov 29 '26 10:11 hstaudacher