Skip to content

[codex] fix MCP auth propagation for streamable tasks#3202

Merged
hengyunabc merged 1 commit into
masterfrom
codex/mcp-auth-streamable-task
Jun 2, 2026
Merged

[codex] fix MCP auth propagation for streamable tasks#3202
hengyunabc merged 1 commit into
masterfrom
codex/mcp-auth-streamable-task

Conversation

@hengyunabc

Copy link
Copy Markdown
Collaborator

Summary

  • add ArthasCommandContext.setSessionAuth to apply authenticated MCP subjects to bound Arthas sessions
  • apply the MCP auth subject before streamable async command startup
  • copy the transport auth subject into isolated Task sessions
  • add regression tests for delegation, streamable call ordering, and isolated task session auth inheritance

Root cause

MCP Bearer authentication was accepted at the HTTP layer, but streamable tools such as trace and watch can run through async task sessions. Those sessions did not consistently inherit the authenticated Subject, so Arthas Job creation failed with command not permitted when password auth was enabled.

Validation

  • ./mvnw -pl arthas-mcp-server -Dtest=ArthasCommandContextAuthTest,DefaultCreateTaskContextAuthTest test
  • ./mvnw -pl core -am -Dtest=AbstractArthasToolAuthTest -Dsurefire.failIfNoSpecifiedTests=false test
  • ./mvnw -pl arthas-mcp-server test
  • git diff --check

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@hengyunabc hengyunabc marked this pull request as ready for review June 2, 2026 03:20
@hengyunabc hengyunabc merged commit d52baca into master Jun 2, 2026
17 checks passed
@hengyunabc hengyunabc deleted the codex/mcp-auth-streamable-task branch June 2, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants