feat: add dbghelp shim for Antigravity CLI#100
Conversation
|
你好,感谢这个 dbghelp shim PR。在实际测试中发现一个竞态条件问题,导致 问题现象Eligibility check failed: Post "https://daily-cloudcode-pa.googleapis.com/v1internal:loadCodeAssist": dial tcp 216.239.36.223:443: connectex: No connection could be made
根因分析
const HANDLE thread = CreateThread(nullptr, 0, LoadVersionDll, nullptr, 0, nullptr);
if (thread) {
CloseHandle(thread);
}
DllMain 返回后主线程继续执行,但新线程还在后台加载 version.dll、安装 hook。agy.exe 启动时立即发起 Eligibility Check 请求,网络调用比 hook 安装跑得快,导致第一个请求直连真实
IP 被拒。
建议修复
将异步加载改为同步加载,确保 hook 安装完成后再返回:
BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID) {
if (reason == DLL_PROCESS_ATTACH) {
DisableThreadLibraryCalls(module);
LoadVersionDll(nullptr); // 同步加载,不创建新线程
}
return TRUE;
}
这样 DllMain 会阻塞直到 version.dll 及其 hook 全部安装完成,agy.exe 主线程恢复执行时 hook 已就位。
感谢!
--- |
|
感谢反馈,判断是对的。 这里确实存在竞态:之前 我已经在 本地已重新验证:
日志确认 |
|
请问能基于 |
|
感谢回复.
请问能基于 1e055f4 发一个新 Release 吗?现有 Release 里的 dbghelp.dll 还是修复前的版本。
https://github.com/lesserafim4ever0502/antigravity-proxy
在您的仓库里面.
…________________________________
发件人: jimmy ***@***.***>
已发送: 2026 年 6 月 3 日 星期三 11:37
收件人: yuaotian/antigravity-proxy ***@***.***>
抄送: CoreyZhang ***@***.***>; Comment ***@***.***>
主题: Re: [yuaotian/antigravity-proxy] feat: add dbghelp shim for Antigravity CLI (PR #100)
[https://avatars.githubusercontent.com/u/250883904?s=20&v=4]lesserafim4ever0502 left a comment (yuaotian/antigravity-proxy#100)<#100 (comment)>
感谢反馈,判断是对的。
这里确实存在竞态:之前 dbghelp.dll 在 DllMain 里用后台线程加载 version.dll,agy.exe 主线程可能会先继续执行并发出 Eligibility Check,导致首个请求绕过 hook。
我已经在 1e055f4 修复:改为在 DLL_PROCESS_ATTACH 中同步加载 version.dll,确保 DllMain 返回前 hook 已安装完成。
本地已重新验证:
* ./build.ps1 -Config Release -Arch x64 -SkipTests
* agy.exe --version
* agy.exe --print "Reply with OK only." --print-timeout 90s
日志确认 version.dll 加载、hook 安装成功,并且 Google 相关请求已通过 SOCKS5 隧道。感谢指出这个问题。
―
Reply to this email directly, view it on GitHub<#100?email_source=notifications&email_token=AFSOYOEODEPQTTD42OWHZ7L456MPVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRQHA4DKMZWHE42M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4608853699>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFSOYOHMQFCWY5RDWYCE5HT456MPVAVCNFSM6AAAAACZUHM6VGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DMMBYHA2TGNRZHE>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/AFSOYOFNE4CS6LHZJK3NV3L456MPVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRQHA4DKMZWHE42M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJKTGN5XXIZLSL5UW64Y> and Android<https://github.com/notifications/mobile/android/AFSOYOFRPPOX74OKXQOPV4T456MPVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRQHA4DKMZWHE42M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>. Download it today!
You are receiving this because you commented.Message ID: ***@***.***>
|
|
好的,已经推送了 @CoreyZhang |
|
感谢, 我配置成功了.
…________________________________
发件人: jimmy ***@***.***>
发送时间: 2026年6月3日 15:58
收件人: yuaotian/antigravity-proxy ***@***.***>
抄送: CoreyZhang ***@***.***>; Mention ***@***.***>
主题: Re: [yuaotian/antigravity-proxy] feat: add dbghelp shim for Antigravity CLI (PR #100)
[https://avatars.githubusercontent.com/u/250883904?s=20&v=4]lesserafim4ever0502 left a comment (yuaotian/antigravity-proxy#100)<#100 (comment)>
好的,已经推送了 @CoreyZhang<https://github.com/CoreyZhang>
―
Reply to this email directly, view it on GitHub<#100?email_source=notifications&email_token=AFSOYOCUVW4GF7TGRSEUTJL457LDNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRRGAZDKMRWGAZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4610252603>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFSOYOEPQMSRSRTK6RJFBJT457LDNAVCNFSM6AAAAACZUHM6VGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DMMJQGI2TENRQGM>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/AFSOYOC3UDU4FLBO26NGEUD457LDNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRRGAZDKMRWGAZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y> and Android<https://github.com/notifications/mobile/android/AFSOYOGJ3F3U6S46QM34UCL457LDNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRRGAZDKMRWGAZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>. Download it today!
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
|
@lesserafim4ever0502 更新到1.0.5好像就不用了。env 里面有 https_proxy 和 http_proxy就行了 。 |
测试过了,确实;看看后续版本能不能持续吧 |
Summary
This PR adds a minimal
dbghelp.dllshim for Antigravity CLI (agy.exe) so the CLI can load the existingversion.dllproxy without a separate launcher.Changes
dbghelp.dllshim that exportsSymFromAddr.version.dllfrom the shim whenagy.exeloadsdbghelp.dll.SymFromAddrcalls to the systemdbghelp.dll.dbghelp.dlltooutputduring build.agy.exeto the default target process list and config-web defaults.Validation
Tested locally on Windows:
./build.ps1 -Config Release -Arch x64 -SkipTestsoutputcontainsversion.dll,dbghelp.dll, andconfig.jsonoutputdoes not containagyp.exeoragy-proxy-launcher.exeagy.exeimportsdbghelp.dll!SymFromAddragy.exe --versionagy.exe --print "Reply with OK only." --print-timeout 90sversion.dllloaded, hooks installed, and SOCKS5 tunnels established to Google endpointsNotes
Thanks @CrazyBoyFeng for the review feedback about splitting concerns and keeping maintenance cost low.
Thanks @median-dxz for pointing out that
agy.exeimportsdbghelp.dlland suggesting the shim-based approach.