Skip to content

[Plugin] Use distinct OAuth client_name for Codex target#41

Draft
glean-github-app-oauth[bot] wants to merge 3 commits into
mainfrom
fix/codex-oauth-client-name
Draft

[Plugin] Use distinct OAuth client_name for Codex target#41
glean-github-app-oauth[bot] wants to merge 3 commits into
mainfrom
fix/codex-oauth-client-name

Conversation

@glean-github-app-oauth

@glean-github-app-oauth glean-github-app-oauth Bot commented Jul 21, 2026

Copy link
Copy Markdown

From Glean Code Writer

Description

The OAuth client_name was hardcoded to "Glean Claude Code Plugin" for all hosts, causing the server-side icon mapping to always show the Claude logo on the consent screen — even when the plugin runs inside Codex or Cursor.

This PR:

  • Detects the host in start.mjs via env vars (CODEX_THREAD_ID / CLAUDE_CODE_SESSION_ID) and exports GLEAN_PLUGIN_HOST
  • Updates auth-provider.ts to send the correct client_name per host: "Glean Codex Plugin" for Codex, "Glean Cursor Plugin" for Cursor, and the existing "Glean Claude Code Plugin" as default
  • The server-side mapping already handles "Codex" → ChatGPT icon correctly, so this is the only change needed

Testing

  • All 190 existing tests pass
  • Added test case for Codex host (GLEAN_PLUGIN_HOST=codex"Glean Codex Plugin")
  • Added test case for Cursor host (GLEAN_PLUGIN_HOST=cursor"Glean Cursor Plugin")
  • Manual verification needed: launch the plugin from Codex, trigger OAuth, and confirm the ChatGPT logo appears on the consent screen

🤖 Generated by Glean Code Writer
📝 Chat link - https://app.glean.com/chat/90aeededeb0a421e9a822c5d2d9c35df

The OAuth DCR client_name was hardcoded to "Glean Claude Code Plugin"
for all plugin targets, causing the Glean consent page to show the
Claude logo and name even when authenticating from Codex. Detect the
Codex host via CODEX_THREAD_ID and register as "Glean Codex Plugin"
so the server-side alias map resolves the correct icon.

Generated by Glean Code Writer
@glean-github-app-oauth glean-github-app-oauth Bot added the glean-code-writer Modified by Glean Code Writer label Jul 21, 2026
The client_name in OAuth registration was hardcoded to
"Glean Claude Code Plugin" for all hosts, causing the server to
always display the Claude logo on the consent screen — even when
the plugin is running inside Codex.

Detect the host in start.mjs (via CODEX_THREAD_ID /
CLAUDE_CODE_SESSION_ID env vars) and export GLEAN_PLUGIN_HOST so
auth-provider.ts can send the appropriate client_name per host.
The server-side icon mapping already handles "Codex" → ChatGPT
logo correctly.
The auth provider now reads GLEAN_PLUGIN_HOST (set by start.mjs)
instead of checking CODEX_THREAD_ID directly. Update the existing
test and add a case for the Cursor host name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

glean-code-writer Modified by Glean Code Writer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant