provider: t3.chat#1091
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0783ff147
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
- Wire T3 Chat into provider registries and UI - Add fetcher, settings, icon, and tests - Document the new provider and update parser hash
- Normalize T3 Chat cookie source copy and fields - Parse broader cURL header formats in usage fetcher - Tighten web fetch availability and update tests
- Assert the T3 Chat usage request sets the customization referer
- Swap the SVG for a full-size provider mark - Preserve currentColor styling for theme matching
- Parse cookie headers from full curl captures - Add coverage for long-form header extraction
- Use subscription period end for overage reset\n- Cover billing reset being ignored in parser tests
- Use subscription period end for overage reset timing - Stop falling back to billing reset when subscription data is missing - Add tests for billing reset and subscription-based overage reset
f8846b1 to
750d0b9
Compare
steipete
left a comment
There was a problem hiding this comment.
Thanks @Quicksaver, this is a good fit now.
I rebased the branch, added one maintainer fix so manual mode preserves full T3 Chat cURL captures end-to-end, and verified the provider through the real CLI web path against a live browser session.
Proof:
- make check
- swift test --filter T3ChatUsageFetcherTests
- swift test --filter ProviderIconResourcesTests
- codex-review --mode branch
- swift run CodexBarCLI usage --provider t3chat --source web --format json --pretty --web-timeout 20
- ./Scripts/compile_and_run.sh
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 750d0b97c5
ℹ️ 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".
| for source in sources where !source.records.isEmpty { | ||
| let cookies = BrowserCookieClient.makeHTTPCookies(source.records, origin: query.origin) | ||
| guard !cookies.isEmpty else { continue } | ||
| let names = cookies.map(\.name).joined(separator: ", ") | ||
| log("\(source.label) cookies: \(names)") | ||
| let header = cookies.map { "\($0.name)=\($0.value)" }.joined(separator: "; ") | ||
| return SessionInfo(cookieHeader: header, sourceLabel: source.label) |
There was a problem hiding this comment.
Skip non-session cookie sets when auto-importing T3 cookies
The importer returns the very first non-empty cookie set it sees, without checking that it actually contains an authenticated T3 session. In practice, a browser/profile can have only anonymous cookies (or stale auth) for t3.chat; this short-circuits the search and prevents trying later profiles/browsers that may have a valid login, so auto mode can consistently fail with invalidCredentials even when the user is signed in elsewhere.
Useful? React with 👍 / 👎.
Summary
Adds T3 Chat as a new disabled-by-default web/cookie provider.
The provider reads T3 Chat customer usage from the web app’s
getCustomerDatatRPC endpoint, parses its JSONL response format, and maps usage into CodexBar’s existing provider model:usageFourHourPercentage-> Base usage windowusageMonthPercentage/usagePeriodPercentage-> Overage usage windowDetails
t3.chat/www.t3.chat.Cookieheader or a full browser cURL capture.User-Agent,Referer,X-Deployment-Id, andx-client-context.401/403-> invalid or expired session429challenge -> asks user to paste the full browser cURL request instead of only cookiesMost T3-specific logic is isolated under the T3 Chat provider folders, with only small registry/settings/menu/widget/docs touch points.
Testing
swift test --filter T3ChatUsageFetcherTestsswift test --filter ProviderIconResourcesTestsswift testmake checkConfirmation