Skip to content

feat(gui): expose native main login profiles in the WebUI #3417

Description

@luvs01

Area

Dashboard

What are you trying to accomplish?

Manage the physical native Codex login from the OpenCodex WebUI without confusing it with Pool routing.

The user should be able to see the current native main login, save it as a profile, choose an existing encrypted native profile, switch the login used by native Codex, and recover or restore the previous profile. The workflow must make clear which effective CODEX_HOME will change and whether native Codex must be closed or restarted.

This is the Dashboard phase originally described in #656 and intentionally deferred when #863 shipped the credential lifecycle as a CLI/backend-only first phase.

What prevents this today?

#863 established the encrypted native-profile backend and /api/native-main-profiles management routes for listing, diagnostics, registration, staged login state, switching, and recovery. Those routes carry safe profile identifiers and labels rather than auth envelopes or tokens.

The current WebUI main-account card still exposes Pool-routing actions and the locked App login identity only. It has no native-main profile-management entry point, so Dashboard users must leave the UI and use ocx account main.

Adding a brand-new login is also not a frontend-only API connection. The current CLI add flow launches the official codex login process in the restricted staging home, maintains the staging lease heartbeat, and then finishes or cancels the stage. A browser cannot safely perform that process step by itself.

What should OpenCodex do?

  • Add a clearly separate Manage main login / Change main account entry point near the native main-account card.
  • Show the effective Codex home, current native profile, and only the existing safe public profile fields.
  • Let users list profiles, register the current app login, switch to an existing profile, and recover or restore the previous profile.
  • Before switching, explain which Codex installation/home will change, require explicit confirmation that native Codex is stopped when necessary, and report the required restart afterward.
  • Refresh the main-account display after success without changing Pool strategy, Pool membership, provider credentials, API keys, task/history data, or per-conversation namespaces.
  • Reuse the validation, encrypted vault, transactional activation, rollback, recovery, request-drain, and __main__ reconciliation behavior from feat(codex): add encrypted native main profiles #863.
  • Keep credential bytes, tokens, raw account IDs, vault payloads, and key material out of browser responses, logs, and persisted GUI state.
  • For new-profile enrollment, use either a narrowly scoped backend orchestration bridge for the official login process or an explicit user-assisted CLI handoff. Do not synthesize a native auth envelope from a Pool record or add a generic shell-execution surface.

Example usage or interface

Native main login
  Current: personal
  Codex home: C:\Users\me\.codex
  [Manage main login]

Manage main login
  personal   active
  work       [Switch]

  [Save current as profile]
  [Add another login]
  [Restore previous]

OpenCodex Pool routing
  Active pool account: team-a

Selecting Switch should show the target native profile, effective Codex home, native-process requirement, and restart result before any credential change occurs.

Alternatives or workarounds

  • ocx account main list/register/add/switch/recover provides the completed CLI workflow.
  • Logging out and back in through Codex changes the native login but is disruptive and does not provide the same profile recovery workflow.
  • Dashboard Pool selection changes proxy routing only; it does not replace the physical native login.

Additional context

The full #863 history, including its force-push-era heads and separate design branch, contains no native-profile WebUI implementation that was later removed. The design explicitly kept GUI work out of the first PR, while leaving a reusable management boundary for this follow-up.

A reviewable delivery can remain under this one workflow while using two stacked PRs:

  1. Existing-profile UI: list, register current, switch, confirmation/restart messaging, recovery, refresh, accessibility, i18n, and GUI tests using the existing routes.
  2. New-profile enrollment: the approved staged-login orchestration or handoff, including cleanup, expiry, cancellation, and error-path tests.

Acceptance requires the native-login surface to remain visually and behaviorally distinct from use this account for the next request / Pool selection. Existing management authentication, same-origin GUI session, CSRF, route-admission, secret-redaction, task/history preservation, and failure-recovery guarantees must remain enforced.

Checks

  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestguiDashboard, tray, settings UI

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions