Repository navigation
Conversation
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
e8a3041 to
2f42a42
Compare
|
this has been purely vibed coded, but it has been working great for me |
38eaa03 to
c8be21b
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8be21b907
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
c8be21b to
e58d3e6
Compare
e58d3e6 to
c8e031b
Compare
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
This started as a local spike, but I have now rebased it onto the latest PR head and prepared a focused follow-up commit ( Current follow-up scope:
Validation run locally:
|
|
Hi. Do you have any rough estimate of how much proxy bandwidth is used when per-account proxy is enabled? For example, if an account consumes around 100 million tokens, how much traffic would go through the proxy approximately? And if usage is around 500 million tokens per week, what proxy bandwidth should I plan for? I understand it depends on request/response size, streaming overhead, retries, files, etc. I only need an approximate order of magnitude. |
|
for me working a lot, I use less than 1gb every week (with 2 accounts per proxy)... but I am having an issue with this right now... accounts get deactivated every 2 days or so and need to re-auth... not sure what yet, keep doing tests... I have deactivated the codex tls profile, still the same.. rotate usage fetch's so they do not match at the same time, and the same... keep doing more tests, will inform. |
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7f46409b1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
a7f4640 to
dfd585f
Compare
2bcdb27 to
0770ed5
Compare
uhmm not yet... the thing about proxy per account is that you can´t reuse the connection for usage fetch across all accounts, and stuff like that, as that defeats the purpose of the proxy itself and would connect accounts... also, this was stripping out the installation id header from codex, as that would also connect accounts (even through proxy)... the test I am reproducing now is generating a random installation id per account, as I thought that sending requests without one may be the reason as well. Also, fetching usage of all accounts at the same time is sort of connecting accounts (also addressed locally in my latest changes). But only 12h since deployed, usually for me they were lasting 2-3 days... so I need to wait a bit more... I do have 1 personal account (without proxy) that is never expiring, so there is some sort of reputation taking place I think... I am testing with ISP Dedicated proxies from iproyal.... It could be that the reputation of these IPs is damaged already not sure... If there are more ideas, please let me know :) |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
same issue (accounts getting invalidated), but I just found out that the proxies I was using from iproyal had a really bad scamalytics score... I very much suspect of this now... I have got another 3 proxies from another provider, this time with a 0 fraud score... retrying... will keep you updated... @Soju06 my local branch I have a bunch of fixups, but let me test this ip thing, and I will push. We gotta find out why this is happening. If you don´t agree with something please let me know, lets keep it up together.... These I have locally done VS origin now (not yet pushed):
|
|
Superseded by #875, which consolidates this egress-proxy work on current main and is now the surviving merge-clean branch. |
|
As the saying goes, it’s no use waving your fists after the fight is over—but since I’ve already finished the report, I’ll go ahead and post it anyway. Hi everyone! While testing this PR with residential/mobile proxies, we caught a critical bug related to SOCKS5 authentication for 🐛 The BugIf a proxy username contains a semicolon 🔍 The CauseIn 🛠️ Our Local FixWe removed the --- a/app/core/clients/account_http.py
+++ b/app/core/clients/account_http.py
@@ -655,8 +655,8 @@ async def get_account_websocket_proxy_uri(account_id: str) -> str | None:
if config.username:
from urllib.parse import quote # noqa: PLC0415
- user = quote(config.username, safe="")
- password = quote(config.password or "", safe="")
+ user = config.username
+ password = (config.password or "")
userinfo = f"{user}:{password}@" if password else f"{user}@"
else:
userinfo = ""
💡 Note: While removing quote() fixes the immediate issue locally, a more robust upstream fix might be to pass credentials directly
into python_socks via kwargs instead of serializing them into a URI string and parsing them back out via from_url(). |
|
@rupebac could you please tell me whether you managed to properly set up a separate proxy for each account? I installed your build, but it still often asks me for SMS verification. |
yes, I think I have sorted it out... Since I changed my proxies from iproyal to seamlessproxies. I just got 1-2 deactivated accounts that I had to re-auth(out of my 8-9 test accounts) in like 4 days (and who knows if these deactivations were due to any signal from before the proxy change or something related to it)... You have to check the reputation of the ip's you are getting from your provider in ipqualityscore.com and scamalytics.com, cos a lot comes down to that I think. Also I noticed that refresh tokens get invalidated if the same account you're using it simulatenously in another IP (but this is not so common I think right?) But I can´t be 100% sure if what fixed it in my case was just the proxy change, or my latest changes that I just pushed to this branch and documented in my previous comment. Maybe you can try with my latest changes and your current proxies? Because these changes I guess are not yet included in #875 PR. Btw, if you are getting some http connections getting closed randomly by the proxy (I had this problem with seamlessproxies, but they just fixed it), these are mainly the /compact calls (they are not going through WS).... WS upgraded long connections are not being closed by seamlessproxies, only http ones. In my case it helped enabling remote_compaction_v2 hidden feature in Codex CLI, now the compactation is done over the WS. |
|
fixed a problem where Import was requiring the refresh token to exist in auth.json when proxy is enabled.... @SHAREN should I merge anything into another branch, or a separated PR ? what you reckon? |
|
@rupebac Do it whichever way is more convenient for you. I’ll also try to push my changes to the repository. |
|
I am continuing in my branch, differences just got too much, and anyway I think it is good to have 2 forks that can test multiple things in terms of account burns.... I have to say I don´t agree with the proxy implementation on #875, the use case should be simpler I think, 1 account -> 1 proxy... there is no need for pools, or failovers... it makes sense to be more like a kill switch... you don´t want to change the ip ever for one account. In my last commit, I am injecting a real User Agent and "originator" in all usages of aiohttp, instead of the default one from the aiohttp session. This I think was the biggest red flag, they could easily identify 3rd party proxy with this.... Also I made sure the JA3 and JA4 fingerprints for TLS are exactly the same as Codex CLI.. And I also implemented a shifting of the refreshes, so they are not matching at the same time... I have also implemented an egress verification, to make sure the public IP that OpenAI is seeing is not matching more than 1 account on our side (it warns)... Also a detection that the dns resolution is not leaking outside the proxy... I have imported also your new routing strategies, I think they are good, however later I realized that better strategies are the one that uses more accounts simultaneously, not less, because I think we want to reduce the load per account... We need a option on the strategy to allow a max concurrency of 1 per account, and even a cold down period... Now what I am wondering is, if somehow they use the content of the context, to connect multiple accounts... I have also redesigned the accounts sections from the Dashboard, now look more compact, clear and nicer (to my liking :) ). And no scrollbar in that section. All is done vibe coding, I haven´t analized the code... only tested it... we gotta move faster I think... Also the warm-up thing, is very very suspicious, last week I got one account banned, the only one that was using warm-up.... A smarter and more randomized warm-up would be required if we want such feature... like the warm-up message being a real random query, not a static text... And also the time patterns to be random and let miss some. Would be good if more people can try my branch and report.... Also I am running out of accounts, if anyone can help here... |
I did rebase some of my changes on top of #875 and put a comment there but got no reply... I did try to communicate and sync up, but I ain´t wasting time for nothing... I will continue on my fork and my branch from this PR, and when you merge #875 to master I will try to rebase what makes sense. For now, I want to implement ton of stuff... working now on a hard cap on concurrency and load per account... |
Construct account-bound SOCKS connectors from structured endpoint fields so usernames/passwords with reserved characters are not percent-encoded and reparsed by aiohttp-socks/python-socks. Source: Soju06#804 (comment)
Construct account-bound SOCKS connectors from structured endpoint fields so usernames/passwords with reserved characters are not percent-encoded and reparsed by aiohttp-socks/python-socks. Source: Soju06#804 (comment)
|
@rupebac May I ask you how much you pay for your proxies and if you really think / consider using Proxys per account to be safer w.r.t. account banning? ( I assume account-banning from OpenAI side is the only reason to use proxys right?)? |
It took me 0.5-1 GB per day, it turned out to be a lot for me. |
Construct account-bound SOCKS connectors from structured endpoint fields so usernames/passwords with reserved characters are not percent-encoded and reparsed by aiohttp-socks/python-socks. Source: Soju06#804 (comment)
Summary
Adds per-account SOCKS5 proxy support for OAuth account import and account-bound upstream egress, so proxied accounts are validated before persistence and continue using their configured proxy for
refreshes, usage, model fetches, files, HTTP responses, and WebSocket traffic.
Type of change
feat:— new user-facing feature or capabilityfix:— bug fix (no behavior change beyond the bug)refactor:— internal refactor (no behavior change, no API change)docs:— documentation onlychore:/ci:/build:— tooling, CI, packagingtest:— test-only change!after the type, e.g.feat!:or includeBREAKING CHANGE:footer)Linked issue:
OpenSpec
shape, SSE framing, OAuth flow) and preserves upstream-equivalent behavior
Change directory:
openspec/changes/add-oauth-account-proxy/Changes
accounts, plus repository/service/API contracts for storing, validating, updating, and clearing account proxy config.failure.
redirect_uritied to the registered configured callback and reuses that same URI for token exchange.Test plan