Skip to content

Bug: Account switches back after request when using proxy mode #16

@adndyxu

Description

@adndyxu

Description

When using Copool in proxy mode, manually switching accounts in the UI does not persist.
After sending a request from Codex App, the active account automatically switches back to the previous one.

Environment
• OS: macOS
• Client: Codex App
• Copool: latest version (1.0.24)
• Proxy mode: enabled (base_url pointing to Copool)

Steps to Reproduce
1. Start Copool and enable proxy
2. Connect Codex App to Copool via base_url
3. In Copool UI, manually switch to Account B
4. Send a request from Codex App
5. Observe active account in Copool

Expected Behavior
• Requests should use the manually selected account (Account B)
• The selected account should remain active unless explicitly changed

Actual Behavior
• After sending a request, the active account switches back to the previous account (Account A)
• Manual selection is not respected

Additional Observations
• This happens even when auto intelligent switching is disabled
• Behavior suggests proxy runtime may be:
• using a stickyAccountID or similar mechanism
• overriding manual selection after a successful request
• possibly syncing back to currentSelection or auth state

Possible Cause (hypothesis)

From code inspection:
• recordSuccessfulCandidate(...) updates active/sticky account
• successful requests may override manual selection
• proxy state is not reset when switching accounts manually

Suggested Fix
• Respect manual selection as highest priority
• Clear stickyAccountID / active state when user switches account
• Avoid overriding user-selected account on successful request
• Optionally add a “lock account” mode

Workaround
• Restart proxy after switching accounts (clears sticky state)
• Avoid mixing manual switching with proxy runtime state

Question

Is manual account selection expected to persist in proxy mode?
Or is current behavior (auto reverting) by design?

Thanks for the great project 🙌
:::

I’m using multiple OpenAI business workspaces and expect manual selection to persist for stability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions