Repository navigation
Import Trae CN cookies from the parent trae.cn domain - #1019
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Scope automatic browser lookup rust/src/providers/traecn/mod.rs, docs/PROVIDERS.md |
Automatic lookup uses a request scope that scans trae.cn and targets api.trae.cn. The provider and user documentation describe this scope and distinguish it from manual cookies. |
Validate browser cookie selection rust/src/providers/traecn/tests.rs |
Fixtures and tests cover parent-domain lookup, API-host cookie eligibility, browser ordering, and manual-cookie behavior. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- nesszer/Win-CodexBar#1014: Added the Trae CN provider and its original cookie behavior, which this PR changes.
Merge Risk: 
Minimal · up to d56d9
-
The documented automatic cookie lookup change appears mergeable after normal checks; no actionable blocking risk is established.
Pre-merge checks: 
8
-
Full details: Provider Data Stays Siloed
-
Explanation
The change stays within the Trae CN provider, its tests, and documentation.
COOKIE_SCOPEreadstrae.cnbut retains only cookies applicable toapi.trae.cn; the provider sends those cookies only to its own API. The shared cookie helper is generic and unchanged. No changed code logs or persists identity, plan, account labels, or email, and no newProviderIdbranching was added to shared code.
Full details: Secrets Handled Safely
-
Explanation
No real secret is introduced or exposed by this change. The new automatic scan uses the existing CookieRequestScope and browser-cookie session helper, which filters cookies for api.trae.cn; the provider sends cookies and the short-lived JWT only in HTTP headers. Changed code logs only browser-session errors/counts, not cookie or token values, and user errors do not include response bodies or credentials. The changed tests contain only explicit synthetic values. The PR changes only documentation, provider logic, and tests, with no credential-file or keyring deletion or overwrite.
Full details: No Unapproved Dependencies
-
Explanation
The pull request changes only
docs/PROVIDERS.mdand Trae CN Rust source/tests. The authoritative diff contains noCargo.toml,package.json, npm/yarn lockfile, or pnpm package-manager change. The PR description also contains no maintainer-approval exception because no dependency addition occurred.
Full details: Ui Changes Include Windows Proof
-
Explanation
The PR changes only Trae CN provider logic, provider tests, and documentation. It does not change files under
apps/desktop-tauri/src, tray rendering, the float bar, settings, or window chrome. Therefore, it has no UI change covered by this check, and Windows screenshots or a fresh-build proof note are not required.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- 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.
Comment @coderabbitai help to get the list of available commands.
Import Trae CN cookies from the parent trae.cn domain
Ports upstream CodexBar steipete#4732 ("fix(traecn): import session cookies from the parent trae.cn domain") to the Win-CodexBar Trae CN provider.
Summary
trae.cndomain. Automatic browser import used to look only forapi.trae.cncookies, so it found nothing for a signed-in user.trae.cncookies. It keeps only the cookies a browser would send toapi.trae.cn(the same host-scoped read Gemini uses), so sibling hosts such aswww.trae.cnand host-onlytrae.cncookies are not sent to the API.api.trae.cn. Pasted Cookie headers and the Trae CN cookie domain (ProviderId::TraeCn.cookie_domain()=api.trae.cn) are unchanged, so manual cookie storage, browser import into the manual field, and the provider registry snapshot do not change.docs/PROVIDERS.md(Trae CN section) now says automatic sessions come fromtrae.cnand are sent toapi.trae.cn.Checks
cargo fmt --all -- --check: clean.cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings: clean.cargo test --manifest-path rust/Cargo.toml --lib providers::traecn: 24 passed, 0 failed (22 existing, 2 new).cargo build --manifest-path rust/Cargo.toml --example fake_grok_acp, then the fullcargo test --manifest-path rust/Cargo.toml: lib 5443 passed, 0 failed, 2 ignored; all other test binaries passed.automatic_scan_reads_the_parent_domain_and_keeps_only_api_bound_cookies: readstrae.cnonly, sends only the.trae.cncookie to the API, and ignoreswww.trae.cnand host-only parent cookies.parent_host_only_cookie_is_not_sent_to_the_api_origin: a host-onlytrae.cncookie yields the sign-in prompt and no request is sent.Proof
Not run on a desktop in this change. Suggested proof (synthetic cookie source only): run the Trae CN provider with
TRAE_CN_BASE_URLpointing at a local fake server, with an isolatedAPPDATA,LOCALAPPDATA,USERPROFILE,HOME, andCODEXBAR_CONFIGunder a fresh%TEMP%directory. Seed a synthetic browser cookie row for.trae.cnnamedtrae_session, and assert that the fake server receives exactly that Cookie header and that aapi.trae.cn-only row is not sent.Notes
CookieRequestScope(browser host-matching rules), which matches the commit's intent of sending only the cookies the API origin receives.api.trae.cncookies into the manual field, as upstream does for API-origin manual cookies. In a real browser the session may live only ontrae.cn, so that button may find nothing. Left unchanged here; a possible follow-up.Summary by CodeRabbit
Bug Fixes
Documentation