Add new login command for codex to use port forward#79
Conversation
🤖 Augment PR SummarySummary: Enable Codex OAuth login callbacks to work when running Codex inside Docker via Changes:
🤖 Was this summary useful? React with 👍 or 👎 |
📝 WalkthroughWalkthroughThis PR adds OAuth callback port forwarding for Codex login flows. It introduces detection logic to identify when ChangesCodex OAuth Callback Port Forwarding
Sequence DiagramsequenceDiagram
participant User
participant RunCommand
participant OAuthHelper
participant DockerManager
participant Container
User->>RunCommand: vp run codex login
RunCommand->>OAuthHelper: _is_codex_oauth_login(agent, args)
OAuthHelper-->>RunCommand: true (localhost OAuth detected)
RunCommand->>RunCommand: Set VIBEPOD_OAUTH_FORWARD_PORT env var
RunCommand->>RunCommand: Create port mapping
RunCommand->>DockerManager: run_agent(ports=mapping, ...)
DockerManager->>Container: Start with ports configuration
Container-->>User: OAuth callback available on localhost
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/vibepod/commands/run.py`:
- Around line 90-95: The OAuth-detection logic in _is_codex_oauth_login treats
only "--device-auth" and "--with-api-key" as non-localhost flows, so
"--with-access-token" calls are misclassified; update the non_oauth_flags tuple
in src/vibepod/commands/run.py (the non_oauth_flags variable used by
_is_codex_oauth_login) to include "--with-access-token" so the existing
generator expression (arg == flag or arg.startswith(f"{flag}=")) will correctly
detect and exclude that flow from triggering the localhost callback/port
forwarding.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 28c44727-2292-4628-9b1f-ac76354f801c
📒 Files selected for processing (3)
src/vibepod/commands/run.pysrc/vibepod/core/docker.pytests/test_run.py
Adds support for publishing the Codex OAuth callback port during the
codex loginOAuth flow, ensuring the browser callback works correctly when running Codex in Docker. It introduces detection logic to determine when the OAuth flow is needed, configures container port publishing, and adds tests for the new behavior.Codex OAuth callback support:
CODEX_OAUTH_CALLBACK_PORTandCODEX_OAUTH_FORWARD_PORTto define the callback and forwarder ports for Codex OAuth login._is_codex_oauth_loginto detect when thecodex loginOAuth flow requires port publishing.runinrun.pyto set environment variables and publish the correct ports when the OAuth flow is detected. [1] [2] [3]run_agentindocker.pyto accept and handle aportsargument, mapping container ports to host ports for the callback forwarder. [1] [2]Testing:
run_agentpublishes ports correctly and that_is_codex_oauth_loginaccurately detects when the OAuth flow is needed.Summary by CodeRabbit
New Features
Tests