Skip to content

Notify opted-in stdio MCP servers of auth changes - #43428

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/35a99f5252bd48ca60a71fbdd1f708a8158e812c
Sep 7, 2026
Merged

Notify opted-in stdio MCP servers of auth changes#43428
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/35a99f5252bd48ca60a71fbdd1f708a8158e812c

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 7, 2026

Copy link
Copy Markdown

Notify opted-in stdio MCP servers of auth changes

What changed

Advertise the experimental codex/auth-change capability for stdio MCP connections with an auth manager. When the server opts in, send notifications/codex/authChanged after initialization and on subsequent auth changes, with credential and owner generation counters and no credentials.

Track owner changes separately from credential refreshes so consumers can detect login, logout, or user, workspace, and auth-mode changes even when notifications coalesce. Treat credential changes with incomplete owner identity as owner changes as well.

Tie the notification watcher to the managed client's lifetime, limit each send to five seconds, and close the connection if a subsequent notification fails.

Testing

Add tests for credential refreshes versus owner changes, coalesced logout and account switches, capability opt-in, notification payloads, and watcher cleanup.

## What changed

Advertise the experimental `codex/auth-change` capability for stdio MCP connections with an auth manager. When the server opts in, send `notifications/codex/authChanged` after initialization and on subsequent auth changes, with credential and owner generation counters and no credentials.

Track owner changes separately from credential refreshes so consumers can detect login, logout, or user, workspace, and auth-mode changes even when notifications coalesce. Treat credential changes with incomplete owner identity as owner changes as well.

Tie the notification watcher to the managed client's lifetime, limit each send to five seconds, and close the connection if a subsequent notification fails.

## Testing

Add tests for credential refreshes versus owner changes, coalesced logout and account switches, capability opt-in, notification payloads, and watcher cleanup.

GitOrigin-RevId: 35a99f5252bd48ca60a71fbdd1f708a8158e812c
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/35a99f5252bd48ca60a71fbdd1f708a8158e812c branch from 179dce5 to 0df3975 Compare September 7, 2026 10:38
@copyberry
copyberry Bot merged commit 0df3975 into main Sep 7, 2026
25 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/35a99f5252bd48ca60a71fbdd1f708a8158e812c branch September 7, 2026 10:40
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 7, 2026
@q-serghio
q-serghio deployed to issue-triage September 7, 2026 10:55 — with GitHub Actions Active
@q-serghio
q-serghio deployed to issue-triage September 7, 2026 10:55 — with GitHub Actions Active
@q-serghio
q-serghio deployed to issue-triage September 7, 2026 10:55 — with GitHub Actions Active
@ROHIT8759
ROHIT8759 deployed to issue-triage September 7, 2026 10:55 — with GitHub Actions Active
@ROHIT8759
ROHIT8759 deployed to issue-triage September 7, 2026 10:55 — with GitHub Actions Active
@ROHIT8759
ROHIT8759 deployed to issue-triage September 7, 2026 10:55 — with GitHub Actions Active
@q-serghio
q-serghio deployed to issue-triage September 7, 2026 10:56 — with GitHub Actions Active
@ROHIT8759
ROHIT8759 deployed to issue-triage September 7, 2026 10:57 — with GitHub Actions Active
@bhooko
bhooko deployed to issue-triage September 7, 2026 10:57 — with GitHub Actions Active
@bhooko
bhooko deployed to issue-triage September 7, 2026 10:57 — with GitHub Actions Active
@bhooko
bhooko deployed to issue-triage September 7, 2026 10:57 — with GitHub Actions Active
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants