Skip to content

feat: conservative AI Studio web profile and quota account fallback - #2

Open
luvs01 wants to merge 6 commits into
mainfrom
codex/conservative-v035
Open

luvs01 wants to merge 6 commits into
mainfrom
codex/conservative-v035

Conversation

@luvs01

@luvs01 luvs01 commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Current scope — 2026-11-17

This is the maintained conservative profile, now integrated with main 87284879a11bd1257641e8aae56a1e09b209ef1f.

  • Current head: 0629f2cf11313766d07dc3cd437dfe99626ecec3; source tree: 78c2045cae428725a3e9d8f3a6417eb69d90bdb3.
  • Preserve the existing profile: multiple accounts signed in locally in the isolated Camoufox runtime; one active/warm worker and one concurrent request per account; explicit sign-in after authentication failure; no Chrome/cookie/CDP extraction or import, automatic OAuth/device-bound renewal, remote pairing, or automatic Drive consent.
  • Generation may switch accounts only after the immediately preceding plan/daily quota rejection. Short-term 429/Retry-After and authentication/network/server failures do not authorize replay. The earlier cumulative quota flag and the stale reference that broke the v0.3.5 branch compilation are removed from this retry gate.
  • Restore pending initial model-catalog retries and startup/periodic expired-resource cleanup. Keep broad account patrol disabled. Main's removed idle-applet cleanup API is not reintroduced; the current resource lifecycle is retained.
  • Choosing a target account for a file copy can revisit selection before a generation attempt starts. That selection step now consumes neither the generation-attempt budget nor the quota replay allowance; a later selection failure or cancellation retains its actual error instead of producing a nil error event.
  • Configuration errors identify the specific invalid worker/backend key.
  • Resolve main integration conflicts while retaining its current Camoufox import, cookie-discovery proxy argument, restricted-account handling and ordinary-build behavior.

Complete transfer from #1

At transfer commit 82ceb6e6fa2a774bbe76c07e20100ba2df566e74, applying the same main integration, regression additions and required formatter to the retained #1 head db088df35b7f29757bf7da4b98c533f87280d3d7 with the same main produced the identical complete tree cb63622196ade9b7c4ecffbe2b086301dd2a2773. The implementation, configuration, frontend and tests match across all 35 changed files relative to main (645 added / 15 removed lines). #1 is superseded by this PR; its branch and historical verification remain preserved.

The three earlier single-account review suggestions belong to the earlier design and are superseded by the explicitly retained multi-account policy. The short-term 429 suggestion was reviewed separately: its stale-error concern is fixed, while broadening fallback beyond plan/daily quota is intentionally declined and covered by regression tests.

Building the conservative profile

The frontend and Go server use separate build switches. After the normal native-library setup, run both profile steps from the repository root:

npm --prefix web ci
VITE_CONSERVATIVE=1 npm --prefix web run build
go build -mod=readonly -tags conservative -o aistudio2api ./cmd/aistudio2api

The frontend step hides the profile's disabled import options; the Go tag enforces the corresponding server restrictions. For desktop builds, include conservative alongside the platform's existing build tags and rebuild the frontend with VITE_CONSERVATIVE=1 first. The ordinary CI/release build commands do not opt into this profile. The local conservative frontend verification reported here used that environment variable.

Verification

  • GitHub Checks on 0629f2c: all four jobs passed — frontend build, web typecheck/lint/format, Go unit tests, and minimum-version/Windows vet. Devin Review completed successfully; CodeRabbit skipped its automated review because this repository requires manual invocation.

Linux, Go 1.27.3, the repository's pinned SpiderMonkey v158.0.1-aistudio2api.2 and libwebp v1.6.0-aistudio2api.1:

  • go test -mod=readonly -p=2 -tags conservative ./internal/app ./internal/config -count=1: 11 top-level tests passed (44 pass entries including subtests).
  • The same app/config packages without the conservative tag: 10 tests passed.
  • Focused conservative boundary tests in api/aistudio/camoufoxnative/chromeauth, including preferred per-account selection: 5 tests passed.
  • Actual conservative frontend build and TypeScript checking passed; Go formatting and whitespace checks passed. The separate template-formatting follow-up removed redundant parentheses from the conservative account-menu expression; the full frontend format check passed for all 249 files. The latest generation fix makes no frontend change.
  • Regression coverage exercises startup/periodic cleanup, pending catalog recovery, no broad patrol after 24 simulated hours, missing-model lookup without a blocked patrol, and cancellation.
  • Authentication coverage calls the real Applet wrapper, ordinary RPC recovery and direct recovery paths: one request, preserved authentication failure, sign-in-required account state, unchanged local Camoufox cookies, and no OAuth refresh, Chrome import or bound-cookie rotation.
  • Independent source review found no blocker in the conflict resolution or conservative import/authentication boundaries.
  • The file-selection success, failure and cancellation regressions failed against the original loop (zero generation calls / nil error event), then passed with the fix. The success case uses the real account pool, copies the file reference to a model-capable alternate account, and performs exactly one mocked generation. The one-account budget case injects a cooling result at the acquisition boundary and verifies finite error termination; it does not run the cooldown scheduler.
  • At the handoff checkpoint, both branch candidates had the identical complete tree. The maintained branch now adds this follow-up regression file and retry-loop correction; its API-published tree matches the locally validated candidate.

These checks use fixtures and mocks. No new installed-app, Windows, physical-device or live-provider verification is claimed.

Historical branch evidence

The original v0.3.5 description below is retained as earlier branch history. Its Windows/device results predate this main integration and do not validate the current head.


Summary

v0.3.5 기반 위에 conservative 빌드 프로필 두 커밋을 올린 사용자 검증 브랜치입니다.

  • 7e9477f feat: add conservative AI Studio web profile — -tags conservative 빌드 시 자연스러운 웹 사용 패턴을 재현하는 프로필: Camoufox 백엔드 기본값, 계정당 동시성 1, first-event hedge/continuation rewrite/search-alias off, fill-first 라우팅, 관리자 인증 기본 활성, 클라이언트 귀속 문구 중립화.
  • df5363d fix: allow conservative quota account fallback — 요금제·일일 한도 초과 시 같은 풀의 다음 계정으로 폴백. 일반적인 단기 429/Retry-After는 보수적 정책상 제외.

Verified

  • llvm-mingw + Go 빌드(-tags conservative) 성공, 바이너리 SHA256 고정 후 양 Windows 기기 배포
  • 서비스 기동: state=RUNNING, Camoufox 워커 정상, 계정 풀(2계정) 인식
  • 종단 검증: POST /v1/chat/completions model=gemini-4-argon → ARGON-OK 응답(이 PC 25s 콜드 / Galaxybook 9s), OpenCodex Argon 콤보 경유 시에도 정상

Notes

  • conservative 프로필은 탐지 표면 최소화가 목적이며 상류 동작과 의도적으로 다릅니다(자동 웜업·hedge·동시성 축소).
  • 계정 뮤텍스: 동일 Google 계정을 두 런타임이 동시에 쓰면 WAA runtime occupied 오류가 발생하므로 계정은 한 런타임 풀에만 둡니다.

Devin Review

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ❌ Failed 2026-11-11T03:34:25.515818Z
We couldn’t complete this review. Comment @codex security review to try again.
df5363d PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 79dfe28e-71c6-4f6a-a94e-1ccfb6d3439c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

The account paying for this security review has reached its Codex usage limits. The payer can check the Codex usage dashboard. For personal accounts, using credits requires enabling “Use credits for security reviews” in Code review settings. If you do not manage the paying account, contact this repository's admins.

devin-ai-integration[bot]

This comment was marked as resolved.

luvs01 and others added 2 commits November 12, 2026 11:16
Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@luvs01
luvs01 force-pushed the codex/conservative-v035 branch from df5363d to 7ecbd88 Compare November 12, 2026 02:16
Restore resource cleanup and pending catalog retries while keeping account patrol disabled. Decide conservative replay from the latest plan/daily quota rejection, removing the stale quotaRejected reference. Report invalid worker setting keys and cover offline maintenance/cancellation behavior.
Preserve current main APIs and resource lifecycle while retaining the conservative profile. Resolve the runtime imports and removed idle-applet cleanup, and verify explicit login, blocked imports, bounded quota fallback, cleanup, and catalog retries.

The v0.3.4 and v0.3.5 branch integrations produce the same complete tree.
@luvs01 luvs01 changed the title feat: conservative AI Studio web profile + quota account fallback (v0.3.5) feat: conservative AI Studio web profile and quota account fallback Nov 17, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

Count only started generation attempts so preparing a copy on another account neither consumes the attempt budget nor triggers the replay policy before the first generation. Keep the last-error quota/authentication boundary for actual retries.

Exercise the real retry loop and account pool with a narrow lease-acquisition boundary: one copy and generation on the alternate account, explicit failures, cancellation, and a one-account cooling result.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant