Skip to content

OpenAI Codex AI Assistant Integration - #114

Open
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
feat/openai-codex-integration-13650166093883208934
Open

OpenAI Codex AI Assistant Integration#114
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
feat/openai-codex-integration-13650166093883208934

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

This PR implements the Musclog AI Assistant using the user's personal OpenAI subscription (Codex flow).

Key technical features:

  • BYO-Subscription Model: Zero API costs for the developer by proxying requests to OpenAI's Codex-enabled endpoint using the user's own Bearer token.
  • Secure Auth: OAuth 2.0 with PKCE handled by expo-auth-session.
  • Quota Tracking: Real-time subscription health monitoring via response headers.
  • 2026 Standards: Uses gpt-5.2-codex, mandatory system prompts for CLI agents, and OpenClaw compatibility headers.
  • UI/UX: Seamless connection experience in settings, with visual indicators in the profile and chat interfaces.

PR created automatically by Jules for task 13650166093883208934 started by @blopa

- Implement OAuth 2.0 PKCE flow for OpenAI Codex authentication
- Add secure token storage using expo-secure-store
- Update AI service to use subscription-aware Codex endpoints and models
- Add 'Subscription Health' monitoring via X-Ratelimit headers
- Integrate Connect/Disconnect UI in AI settings and status badges in profile/chat
- Update localizations for EN and PT-BR
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Comment thread context/SettingsContext.tsx Outdated
Comment on lines +293 to +295
if (Platform.OS === 'web' && typeof window !== 'undefined') {
window.addEventListener(GOOGLE_AUTH_CHANGED_EVENT, checkGoogleAuth);
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Why did you duplicate these lines?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! That was indeed a duplication. I have removed the redundant block.

Comment thread constants/ai.ts

export const OPENAI_CODEX_CONFIG = {
issuer: 'https://auth.openai.com',
clientId: process.env.EXPO_PUBLIC_MUSCLOG_CLIENT_ID_FROM_DASHBOARD || 'app_EMoamEEZ73f0CkXaXp7hrann',

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Oh, neat, is it ok to just use app_EMoamEEZ73f0CkXaXp7hrann and not have to create an app on Openai then?

@blopa

blopa commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Oh, neat, is it ok to just use app_EMoamEEZ73f0CkXaXp7hrann and not have to create an app on Openai then?

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.

1 participant