[Plugin] Use distinct OAuth client_name for Codex target#41
Draft
glean-github-app-oauth[bot] wants to merge 3 commits into
Draft
[Plugin] Use distinct OAuth client_name for Codex target#41glean-github-app-oauth[bot] wants to merge 3 commits into
glean-github-app-oauth[bot] wants to merge 3 commits into
Conversation
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From Glean Code Writer
Description
The OAuth
client_namewas 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:
start.mjsvia env vars (CODEX_THREAD_ID/CLAUDE_CODE_SESSION_ID) and exportsGLEAN_PLUGIN_HOSTauth-provider.tsto send the correctclient_nameper host:"Glean Codex Plugin"for Codex,"Glean Cursor Plugin"for Cursor, and the existing"Glean Claude Code Plugin"as default"Codex"→ ChatGPT icon correctly, so this is the only change neededTesting
GLEAN_PLUGIN_HOST=codex→"Glean Codex Plugin")GLEAN_PLUGIN_HOST=cursor→"Glean Cursor Plugin")🤖 Generated by Glean Code Writer
📝 Chat link - https://app.glean.com/chat/90aeededeb0a421e9a822c5d2d9c35df