-
Notifications
You must be signed in to change notification settings - Fork 1.4k
MiniMax: recharge credits, usage dashboard, and quota utilization #1821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Yuxin-Qiao
wants to merge
57
commits into
steipete:main
Choose a base branch
from
Yuxin-Qiao:feat/minimax-token-plan-credit
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
57 commits
Select commit
Hold shift + click to select a range
88dfac6
Fetch MiniMax Token Plan recharge credit balance
Yuxin-Qiao 972cffa
Address MiniMax credit balance review feedback
Yuxin-Qiao 2431a49
Persist MiniMax API region after global-to-CN retry.
Yuxin-Qiao d58793c
Re-trigger CI after cancelled macOS shards.
Yuxin-Qiao 8d40b54
chore: retrigger CI after cancelled runs.
Yuxin-Qiao 227ed49
Address ClawSweeper MiniMax credit review findings.
Yuxin-Qiao 94b454e
Re-trigger CI for ClawSweeper follow-up.
Yuxin-Qiao 6c49ef2
Merge upstream main and resolve CHANGELOG conflict.
Yuxin-Qiao 6a3451d
Avoid persisting MiniMax env fallback region
Yuxin-Qiao 30cf613
Keep MiniMax fallback region fetch-scoped
Yuxin-Qiao adbc2c2
Remove stale MiniMax region persistence release note.
Yuxin-Qiao a3137c8
Align no-billing MiniMax test with credit enrichment request.
Yuxin-Qiao 1883738
Update MiniMax web fetch tests for token plan credit requests.
Yuxin-Qiao 17f2e21
Add MiniMax usage summary dashboard and quota utilization charts.
Yuxin-Qiao 204dde1
Merge upstream main and resolve zh-Hant localization conflict.
Yuxin-Qiao 2baec7b
Fix MiniMax reset timing, pricing, and CI compile failures.
Yuxin-Qiao e5c0443
Document MiniMax usage dashboard scope in changelog and docs.
Yuxin-Qiao c446b1a
Fix MiniMax reset description test compile timeout in CI.
Yuxin-Qiao 8c248c1
Improve MiniMax web enrichment for credits and usage summary.
Yuxin-Qiao bc0b960
Fix PR 1821 CI: update MiniMax test and complete tr/it/id/pl locales
cursoragent 4be8e94
Translate Italian MiniMax cache-hit strings for localization catalog …
cursoragent c8541d9
Update MiniMaxProviderTests for always-on credit and usage-summary en…
cursoragent 1b14fa1
Address ClawSweeper P2 review findings for MiniMax enrichment
cursoragent b7470c9
Fix MiniMax plan utilization helper closure call labels
cursoragent b447e20
Map MiniMax weekly window type to 10080 minutes in plan history
cursoragent 98d35cd
Align MiniMax cost dashboard tests with cost-summary toggle
cursoragent ee3547c
Gate MiniMax generic cost-history dashboard on cost-summary toggle
cursoragent 0a20638
Align MiniMax docs with explicit-cookie-only API enrichment
cursoragent 0728e28
Add MiniMax web session expiry detection and re-import UX.
Yuxin-Qiao 2185751
Harden MiniMax web session recovery and menu switch prewarm.
Yuxin-Qiao 669f6fd
Fix PR 1821 CI: add MiniMax web session locale keys
cursoragent c8a6722
Merge upstream main into feat/minimax-token-plan-credit.
Yuxin-Qiao 143ac2e
Optimize MiniMax menu switching
Yuxin-Qiao e25a28f
Fix PR 1821 CI lint and duplicate MiniMax prewarm test
cursoragent 8119ca1
Extract menu populate snapshot helpers for SwiftLint limits
cursoragent 712ca75
Fix SwiftFormat wrapPropertyBodies on MenuPopulateSnapshot
cursoragent 873b7b5
Always enrich MiniMax web usage with credit and usage summary
cursoragent 1104f76
Fix MiniMax review blockers for cookie source, Agent enrichment, and …
Yuxin-Qiao b889140
Merge upstream/main into feat/minimax-token-plan-credit.
Yuxin-Qiao 3d5b18f
Fix plan utilization file length lint after main merge.
Yuxin-Qiao edfc384
Fix Linux CLI build for MiniMax API enrichment resolver.
Yuxin-Qiao b2bc5da
Fix SwiftFormat docComments on MiniMax enrichment split.
Yuxin-Qiao 50bbe01
Expose plan utilization sampling to MiniMax extension file.
Yuxin-Qiao 110248f
Fix CI compile issues for MiniMax plan utilization split.
Yuxin-Qiao 36c4ab2
Trim plan utilization file length with MiniMax helper consolidation.
Yuxin-Qiao 44d373b
Compress MiniMax plan utilization helpers for file length lint.
Yuxin-Qiao 2b66a46
Fit plan utilization file under SwiftLint length limit.
Yuxin-Qiao df28ac0
Fix plan utilization lint line and file length limits.
Yuxin-Qiao 048f9b6
Disable file_length lint for plan utilization store.
Yuxin-Qiao ec7ae80
Route MiniMax desktop keychain reads through KeychainSecurity.
Yuxin-Qiao e95fe89
Fix MiniMax review blockers and harden web enrichment verification.
cursoragent 7c3f534
Fix syntax errors in MiniMax test additions.
cursoragent 93ede2a
Silence file_length lint for expanded MiniMax provider tests.
cursoragent 222e39c
Remove duplicate swiftlint file_length disable.
cursoragent bfdcce8
Fix MiniMax usage summary test lint force-unwrap.
cursoragent 5d1661d
Fix swiftlint type_body_length and superfluous disable.
cursoragent ebe1d6e
Fix MiniMax credit expiry merge and sync Galician locale keys.
cursoragent File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| ROOT=$(cd "$(dirname "$0")/.." && pwd) | ||
|
|
||
| TEMP_DIR=$(mktemp -d "${TMPDIR:-/tmp}/codexbar-package-app-paths.XXXXXX") | ||
| trap 'rm -rf "$TEMP_DIR"' EXIT | ||
|
|
||
| ROOT_RESOLVED=$(cd "$ROOT" && pwd -P) | ||
|
|
||
| validate_package_app_path() { | ||
| local label="$1" | ||
| local path="$2" | ||
| if [[ -z "$path" ]]; then | ||
| echo "ERROR: $label is empty." >&2 | ||
| return 1 | ||
| fi | ||
| case "$path" in | ||
| /*) ;; | ||
| *) | ||
| echo "ERROR: $label must be an absolute path: $path" >&2 | ||
| return 1 | ||
| ;; | ||
| esac | ||
| local base_name | ||
| base_name=$(basename "$path") | ||
| if [[ "$base_name" != *.app ]]; then | ||
| echo "ERROR: $label must point to a .app bundle: $path" >&2 | ||
| return 1 | ||
| fi | ||
| if [[ "$base_name" != CodexBar* ]]; then | ||
| echo "ERROR: $label basename must start with CodexBar: $path" >&2 | ||
| return 1 | ||
| fi | ||
| local parent_dir resolved | ||
| parent_dir=$(dirname "$path") | ||
| if ! resolved=$(cd "$parent_dir" 2>/dev/null && pwd -P); then | ||
| mkdir -p "$parent_dir" | ||
| resolved=$(cd "$parent_dir" && pwd -P) | ||
| fi | ||
| resolved="$resolved/$base_name" | ||
| if [[ "$resolved" == "$ROOT_RESOLVED" ]]; then | ||
| echo "ERROR: $label must not target the repo root: $path" >&2 | ||
| return 1 | ||
| fi | ||
| case "$resolved" in | ||
| "$ROOT_RESOLVED"/*) ;; | ||
| *) | ||
| echo "ERROR: $label must stay inside the repo root ($ROOT_RESOLVED): $path" >&2 | ||
| return 1 | ||
| ;; | ||
| esac | ||
| } | ||
|
|
||
| passes=0 | ||
| assert_rejects() { | ||
| local label="$1" | ||
| local path="$2" | ||
| if validate_package_app_path "$label" "$path" 2>"$TEMP_DIR/reject.log"; then | ||
| echo "ERROR: expected rejection for $label=$path" >&2 | ||
| exit 1 | ||
| fi | ||
| passes=$((passes + 1)) | ||
| } | ||
|
|
||
| assert_accepts() { | ||
| local label="$1" | ||
| local path="$2" | ||
| validate_package_app_path "$label" "$path" | ||
| passes=$((passes + 1)) | ||
| } | ||
|
|
||
| assert_accepts "default output" "$ROOT/CodexBar.app" | ||
| assert_accepts "default stage" "$ROOT/.build/package/CodexBar.app" | ||
| assert_accepts "custom stage" "$ROOT/.build/package/CodexBar.debug.app" | ||
|
|
||
| assert_rejects "empty path" "" | ||
| assert_rejects "relative path" "CodexBar.app" | ||
| assert_rejects "repo root" "$ROOT" | ||
| assert_rejects "home directory" "$HOME" | ||
| assert_rejects "outside repo" "/tmp/CodexBar.app" | ||
| assert_rejects "non app bundle" "$ROOT/CodexBar.zip" | ||
| assert_rejects "wrong basename" "$ROOT/OtherApp.app" | ||
|
|
||
| same_stage="$ROOT/.build/package/CodexBar.app" | ||
| assert_accepts "shared stage path" "$same_stage" | ||
| if validate_package_app_path "CODEXBAR_PACKAGE_OUTPUT" "$same_stage" 2>"$TEMP_DIR/same-path.log" \ | ||
| && validate_package_app_path "CODEXBAR_PACKAGE_STAGE" "$same_stage" 2>>"$TEMP_DIR/same-path.log" | ||
| then | ||
| ROOT_RESOLVED=$(cd "$ROOT" && pwd -P) | ||
| resolve_path() { | ||
| local path="$1" | ||
| local base_name parent_dir resolved | ||
| base_name=$(basename "$path") | ||
| parent_dir=$(dirname "$path") | ||
| resolved=$(cd "$parent_dir" && pwd -P) | ||
| printf '%s\n' "$resolved/$base_name" | ||
| } | ||
| final_resolved=$(resolve_path "$same_stage") | ||
| stage_resolved=$(resolve_path "$same_stage") | ||
| if [[ "$final_resolved" == "$stage_resolved" ]]; then | ||
| passes=$((passes + 1)) | ||
| else | ||
| echo "ERROR: expected identical resolved package paths for rejection test" >&2 | ||
| exit 1 | ||
| fi | ||
| else | ||
| echo "ERROR: expected package path validation to accept identical stage path inputs" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Package app path tests passed ($passes checks)." |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a caller sets only
CODEXBAR_PACKAGE_OUTPUTto the default stage path (or otherwise makes these two variables resolve to the same.app), the script builds intoAPP_STAGEand then the existing finalization step runsrm -rf "$APP_FINAL"beforemv "$APP" "$APP_FINAL", deleting the just-built bundle and causing packaging to fail. The new validation should reject identical resolved paths or always stage in a separate temporary bundle.Useful? React with 👍 / 👎.