Skip to content

Add Alibaba Coding Plan provider#574

Merged
ratulsarna merged 17 commits intomainfrom
codex/pr-453-audit
Mar 19, 2026
Merged

Add Alibaba Coding Plan provider#574
ratulsarna merged 17 commits intomainfrom
codex/pr-453-audit

Conversation

@ratulsarna
Copy link
Collaborator

Summary

  • add Alibaba Coding Plan provider support on current main
  • keep degraded usage handling honest with visible but non-quantitative fallback when counters are absent
  • complete shared wiring for settings, CLI, widgets, and regression coverage

Validation

  • swift test --filter AlibabaCodingPlan
  • pnpm check
  • ./Scripts/compile_and_run.sh

Supersedes #453.

Thanks @jnd0 for the original Alibaba provider implementation and follow-up fixes that this PR carries forward.

@ratulsarna ratulsarna marked this pull request as ready for review March 19, 2026 10:27
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ff131a167

ℹ️ 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".

@ratulsarna
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 54f175658e

ℹ️ 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".

@ratulsarna
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbd1d60940

ℹ️ 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".

@ratulsarna
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 247129b1a7

ℹ️ 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".

@ratulsarna
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 72bc65c293

ℹ️ 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".

@ratulsarna
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4589dcee9

ℹ️ 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".

Comment on lines +199 to +200
"domain": "modelstudio.console.alibabacloud.com",
"consoleSite": "MODELSTUDIO_ALBABACLOUD",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Align console metadata with the selected Alibaba region

The console RPC body is hard-coded to domain = modelstudio.console.alibabacloud.com and consoleSite = MODELSTUDIO_ALBABACLOUD regardless of the region argument. When users select .chinaMainland, this payload no longer matches the CN host/region used elsewhere in the same request, so web-mode quota calls can be rejected or misrouted for CN accounts. Please derive these fields from region (and correct the ALBABACLOUD typo) so request metadata stays consistent.

Useful? React with 👍 / 👎.

@ratulsarna
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbe98fdbca

ℹ️ 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".

}
// Keep web strategy available in auto mode so fetch can attempt refresh/import
// and provide a concrete error or fallback path instead of "No available fetch strategy".
return context.settings?.alibaba?.cookieSource != .manual

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip web strategy when no Alibaba session is detectable

AlibabaCodingPlanWebFetchStrategy.isAvailable returns true in auto mode even after confirming there is no env cookie, no manual cookie, no cache, and no browser session, and resolveStrategies still orders web before API. For users who only configure ALIBABA_CODING_PLAN_API_KEY (the common API-only setup), every refresh will still run browser-cookie import first, causing avoidable keychain/browser access prompts and latency before the API path succeeds.

Useful? React with 👍 / 👎.

}
}
}
return self.findFirstString(forKeys: ["planName", "plan_name", "packageName", "package_name"], in: payload)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Preserve instanceName when falling back to plan label lookup

findPlanName(in:) checks instanceName only when iterating codingPlanInstanceInfos, but the fallback path used for a selected instance dictionary omits instanceName. If the chosen active instance has instanceName but no planName/packageName, lookup falls back to the whole payload and can return another instance’s label, so the displayed Alibaba plan identity can be wrong.

Useful? React with 👍 / 👎.

@ratulsarna ratulsarna merged commit 043cebd into main Mar 19, 2026
4 checks passed
Finesssee added a commit to Finesssee/Win-CodexBar that referenced this pull request Mar 24, 2026
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.

2 participants