Skip to content

[Bug]: Local TUI reports successful GitHub Copilot login but cannot use the token until restarted #201751

Description

@jtmyershp

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

In OpenClaw 2026.9.36, the local TUI reported successful GitHub Copilot authentication, but the next message in that session failed because the active runtime had not loaded the saved credential.

Steps to reproduce

  1. Launch openclaw tui --local and select a GitHub Copilot model.
  2. Complete GitHub Copilot device login from the TUI and wait for auth flow finished for github-copilot.
  3. Without exiting the TUI, send test.

Expected behavior

The same TUI should be able to send a message using the newly saved credential. As a working comparison, a fresh local OpenClaw process received a reply from github-copilot/claude-sonnet-5 using that credential without another login.

Actual behavior

The TUI reported that authentication had finished, then displayed secret reference was not materialized by the active runtime instead of a model reply.

OpenClaw version

2026.9.36 (70c40e4)

Operating system

Debian GNU/Linux 13 (trixie)

Install method

npm installation in the guest; launched with openclaw tui --local.

Model

github-copilot/claude-sonnet-5 was verified in the successful comparison. The failing TUI output identifies the Copilot profile but does not print the model ID.

Provider / routing chain

OpenClaw embedded local runtime → GitHub Copilot provider, with guest egress through an audit-only firewall. No separate OpenClaw Gateway service was running. The failing turn reported a local credential error, not a provider HTTP response.

Additional provider/model setup details

The device login created the github-copilot:github token profile. The installation included a downstream DNS compatibility change for device login; this report concerns the subsequent chat failure after login completed. An unmodified installation was not tested.

Logs

auth flow finished for github-copilot
 
test
 
run error: Secret owner account:["<agent-db-path>","github-copilot:github"] is configured but unavailable (secret reference was not materialized by the active runtime).

Screenshots, recordings, and evidence

No screenshot attached. For comparison, a separate openclaw agent --local process using a temporary copy of the saved state received ok from github-copilot/claude-sonnet-5 and ended with stopReason=stop.

Impact and severity

One local TUI session was observed. Its first message after successful device login failed, blocking chat in that session. A fresh process could chat without signing in again. Frequency beyond this observation was not measured.

Additional information

The successful comparison used the same VM and saved credential. It was a fresh local agent process, not a verified restart of the original TUI. No last-known-good version was tested.

Activity

  1. added
    bug
    on Nov 19, 2026
  2. added
    bug:behavior
    on Nov 19, 2026
  3. added
    clawsweeper:intake:bug
    P2
    clawsweeper:needs-info
    impact:auth-provider
    issue-rating: 🦐 gold shrimp
    and removed
    clawsweeper:intake:bug
    on Nov 19, 2026
  4. clawsweeper commented on Nov 19, 2026

    @clawsweeper
    Contributor

    Codex review: this still needs some work.

    Summary
    Keep open: current main retains the credential-publication gap, and an open PR explicitly closes this issue.

    Reproducibility: Current source shows snapshot invalidation and the matching unmaterialized-token failure boundary, corroborated by the contributor’s warm-session reproduction; this read-only review ran no product code.

    Next step
    Review the protected-token refresh repair in #200605 and keep this issue open until that closing PR is resolved.

    Review details

    Best possible solution:

    Successful local login should publish protected credentials into the existing embedded runtime before chat resumes.

    Do we have a high-confidence way to reproduce the issue?

    Current source shows snapshot invalidation and the matching unmaterialized-token failure boundary, corroborated by the contributor’s warm-session reproduction; this read-only review ran no product code.

    Is this the best way to solve the issue?

    The linked PR addresses the existing login and publication owners directly and adds the missing protected-token scenario after an earlier chat turn.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The original report used a downstream-modified older installation; a real Copilot device login on unmodified current main has not been verified.

    Codex review notes: model internal, reasoning medium; reviewed against df2faf7d476c.

    Label changes

    Label changes:

    No label changes.

    Label justifications:

    • P2: The observed failure affects an advanced local TUI workflow, with saved credentials usable from a fresh process.
    • impact:auth-provider: The active runtime cannot resolve a newly saved provider token for the next message.
    Evidence reviewed

    What I checked:

    • Open closing PR owns the repair: fix: let local TUI /auth sign in to providers again #200605 remains open and unmerged, explicitly closes this issue, and describes the warm-session protected-token failure and repair. (6feedfb9b51f)
    • Current main invalidates without explicit refresh: Successful built-in child login reloads shared auth-store ownership and clears runtime snapshots without calling the provider-auth refresh operation. (src/tui/tui.ts:1029, df2faf7d476c)
    • Reported error has an owned source boundary: A reference-backed token without a matching published materialization throws the exact reported error; the existing unit contract separately verifies successful resolution of published token references. (src/agents/auth-profiles/oauth.ts:331, df2faf7d476c)
    • Copilot uses protected token storage: Copilot creates the github-copilot:github token profile and requests protected-store persistence unless plaintext mode is selected. (extensions/github-copilot/index.ts:47, df2faf7d476c)
    • Existing publication owner supports the repair: refreshActiveProviderAuthRuntimeSnapshot prepares and activates refreshed provider credentials; the linked PR invokes this operation from its in-process login callback. (src/secrets/runtime.ts:610, df2faf7d476c)
    • Contributor supplied a discriminating reproduction: ArcueidMP reports that a synthetic protected token fails after a completed turn on an earlier PR head, while login before the first turn works; the updated PR body records successful next-request credential use through the built CLI.

    Likely related people:

    • Vincent Koc: Raw commit 4591070 adds src/tui/tui-auth-invocation.ts:9 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 4591070b2f4b; files: src/tui/tui-auth-invocation.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge; those execution lanes are retired.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

    Reviewed November 21, 2026, 4:18 AM ET / 09:18 UTC.

  5. added
    issue-rating: 🦪 silver shellfish
    and removed
    clawsweeper:needs-info
    issue-rating: 🦐 gold shrimp
    on Nov 19, 2026
  6. ArcueidMP commented on Nov 19, 2026

    @ArcueidMP
    Contributor

    I'll fix this in #200605. I reproduced it on that PR's head (a7273a36e2b) in openclaw tui --local, using a synthetic token saved to the same protected store Copilot uses.

    Signing in before the first message works. Signing in after a completed chat turn doesn't: the token is saved and the profile only has a tokenRef, but the next message fails with secret reference was not materialized by the active runtime and never reaches the model.

    I haven't tested a real GitHub device login. I'll add a regression test for this case to the PR.

  7. added
    clawsweeper:linked-pr-open
    clawsweeper:needs-live-repro
    clawsweeper:no-new-fix-pr
    issue-rating: 🐚 platinum hermit
    and removed
    issue-rating: 🦪 silver shellfish
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2bugbug:behaviorclawsweeper:linked-pr-openclawsweeper:needs-live-reproclawsweeper:no-new-fix-primpact:auth-providerissue-rating: 🐚 platinum hermit

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions