Repository navigation
feat(qwen): support Team Token Plan usage - #4338
Conversation
Fetch Team credit pools through a bundled plugin using the console billing selector, and keep Individual usage as the fallback. Preserve Team precedence when cached automatic cookies expire, without replacing manual credentials. Cover the reported summary, request regions, cycle resets, malformed quotas, cancellation, cookie recovery, and synthetic menu presentation on both engines. Fixes #3711
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b52bf4400
ℹ️ 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".
| private func fetch( | ||
| _ context: ProviderFetchContext, headers: QwenCloudCookieHeaders) async throws -> ProviderFetchResult | ||
| { | ||
| let runtime = try ProviderPluginRuntime(bundledPlugin: "qwencloud-team", transport: self.transport, timeout: 30) |
There was a problem hiding this comment.
Honor the configured web timeout for Team probes
When a caller selects a short --web-timeout, the new first-in-pipeline Team probe still uses a fixed 30-second runtime and three fixed 8-second requests; an authentication retry can repeat that entire budget before Individual fallback. This contradicts the CLI option’s documented “Web fetch timeout (seconds; source=auto or web)” semantics in Sources/CodexBarCLI/CLIOptions.swift:201-202, so Qwen requests can substantially exceed an explicit deadline. Derive both the runtime and request timeout from context.webTimeout instead.
Useful? React with 👍 / 👎.
|
Codex review: needs changes before merge. Reviewed October 7, 2026, 3:53 PM ET / 19:53 UTC (Revision 2). ClawSweeper reviewWhat this changesAdds Qwen Cloud Team credit usage, remaining credits, seats, and cycle resets through a bundled provider script, with Individual usage retained as fallback. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readiness⛔ Needs changes before merge - 2 items remain This PR remains useful because main and v0.73.0 cover Individual plans only. The previously reported timeout defect remains unfixed; repository policy and OWNER authorship also preclude automatic closure. Priority: P2 Review scores
Verification
How this fits togetherCodexBar’s Qwen provider turns an authenticated console session into usage displayed in the menu bar and CLI. The new Team probe runs before the existing Individual fetcher and maps the console’s subscription summary into the shared usage model. flowchart TD
A[Selected Qwen session] --> B[Team console requests]
B --> C[Active Team credit pool]
C -->|Valid| D[Shared usage model]
C -->|Absent or failed| E[Individual fetcher]
E --> D
D --> F[Menu bar and CLI]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep Team parsing within the existing Qwen provider while bounding its requests and authentication recovery by the caller’s configured timeout. Do we have a high-confidence way to reproduce the issue? Yes, source establishes that a short --web-timeout cannot constrain the new Team runtime or requests, including recovery. No execution was performed in this read-only review. Is this the best way to solve the issue? The bundled Team path fits the owner-approved direction and preserves Individual fetching, but the current implementation needs caller-derived timeout budgets. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 36bf01ace109. LabelsLabel changes: No label changes. Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
# Conflicts: # CHANGELOG.md
Qwen Cloud Team subscriptions were queried through the Individual-plan APIs and failed with “Missing token plan data.” The bundled Team plugin now reads the reported credit pool, remaining credits, seats, and
NextCycleFlushTimereset.The public Qwen console client supplies the previously missing billing-selector contract:
ea-service / LoadHumanInfoinap-southeast-1, followed byBssOpenAPI-V3 / GetSeatSubscriptionSummaryincn-hangzhou. The plugin reuses the native-selected dashboard session through the host’s opaque cookie and form-POST APIs. Valid Team usage takes precedence; Individual remains available when no active Team subscription is found. Team failures remain visible as diagnostics, and expired automatic sessions get one fresh-cookie attempt before fallback. Manual cookies stay strict.This covers one active subscription group. Ambiguous multiple pools produce a diagnostic; existing endpoint overrides keep their Individual behavior. Provider registration/counts are unchanged. Thanks @tavioto for the sanitized Team capture.
Validation:
source Scripts/test_environment.sh; no live account probes. The installed signed CLI reports the relevant providers disabled.swift test --build-system native --jobs 4 -Xswiftc -gnone --filter 'AlibabaTokenPlan|OneConsole|QwenCloud|TokenPlanMonthly|Zai|ProviderPluginDetailsParity|ProviderPluginConsoleCapabilities|ProviderArchitectureGatekeeper|ProviderSettingsDescriptor'— 336 tests / 35 suites passed.swift test --build-system native --jobs 4 -Xswiftc -gnone --filter 'QwenCloud|TokenPlanMonthly|ProviderArchitectureGatekeeper|ProviderSettingsDescriptor'— 181 tests / 12 suites passed, including both plugin engines.make check— clean; SwiftLint reports 0 violations. The plugin test file also passed explicit SwiftFormat/SwiftLint checks.8b52bf4400c9301870887f75b3839fd83273fd4d:./Scripts/test.sh --swift-command /tmp/alibaba-zai-swift-native --direct-workers 4— direct mode, 4 workers, 1,587 selections across 144 groups; all 144 groups passed on the first attempt; 0 failed groups, retries, or timeouts. The wrapper forwards test/build to Swift with--build-system native --jobs 4 -Xswiftc -gnone.Synthetic before: the reported failure rendered through the menu model.
Synthetic after: the sanitized issue fixture parsed by the new plugin and rendered by the menu view.
Fixes #3711
Refs #2349, #2891, #2522, #3553
Hosted CI: run 37668430312 returned
queuedfor this head in 12 scheduled status checks through 2026-10-07 19:38 UTC. The last response explicitly reported a shared-cache hit. Hosted completion is unverified; a fresh head-specific CI check is needed before merging.