Skip to content

feat(glm): add coding plan quota support#653

Open
Kayphoon wants to merge 8 commits into
fawney19:mainfrom
Kayphoon:glm-coding-plan-quota
Open

feat(glm): add coding plan quota support#653
Kayphoon wants to merge 8 commits into
fawney19:mainfrom
Kayphoon:glm-coding-plan-quota

Conversation

@Kayphoon

@Kayphoon Kayphoon commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Adds glm_coding_plan as a fixed key-managed provider with Zhipu/Z.AI default Base URLs, Coding Plan quota refresh, and admin pool quota display for 5h/week token windows.

Included:

  • fixed provider templates for Anthropic messages and OpenAI chat Coding Plan URLs
  • quota refresh against GLM monitor quota/model-usage endpoints
  • parsed plan tier, 5h/week remaining quota, reset time, request count, and token usage
  • admin UI quota text/progress/stats display without MCP quota rows
  • minimal CI baseline compatibility fixes for Rust 1.95 clippy and existing workspace-rest test build drift

Verification:

  • env -u CARGO_TARGET_DIR cargo fmt --all -- --check
  • env -u CARGO_TARGET_DIR cargo test -p aether-admin glm_coding_plan
  • env -u CARGO_TARGET_DIR cargo test -p aether-provider-pool glm_coding_plan
  • env -u CARGO_TARGET_DIR cargo test -p aether-provider-transport glm_coding_plan
  • env -u CARGO_TARGET_DIR cargo clippy -p aether-usage-runtime --all-targets -- -D warnings
  • npm run test:run -- src/utils/tests/providerKeyQuota.spec.ts src/features/pool/utils/tests/poolStatsDisplay.spec.ts src/views/admin/tests/PoolManagement.codex-cycle-stats.spec.ts src/features/providers/utils/tests/providerTypeUtils.spec.ts src/features/providers/components/tests/endpoint-default-paths.spec.ts
  • git diff --check

CI status:

  • PR run 28157863993: Format, DB smoke, Data tests, Data clippy, Gateway clippy, Workspace Rest clippy, and Workspace Rest tests passed.
  • PR run 28157863993 still fails Gateway tests on three stream execution tests.
  • The same three Gateway stream tests already fail on origin/main head d336d1a in run 28045941666, so this is a pre-existing main baseline failure, not introduced by glm_coding_plan.

Local note: gateway cargo check and some workspace-rest no-run checks could not be rerun locally in this sandbox because the default /root/.cargo registry is read-only while unpacking humantime v2.3.0. No CARGO_HOME or shared CARGO_TARGET_DIR override was used.

No .agents, .omo, Makefile, Docker, or CI workflow changes are included in this PR.

@Kayphoon Kayphoon force-pushed the glm-coding-plan-quota branch from 951aa1c to 6081280 Compare June 25, 2026 08:30
@Kayphoon Kayphoon force-pushed the glm-coding-plan-quota branch from 6081280 to 41318ef Compare June 25, 2026 08:40
Kayphoon added 4 commits June 25, 2026 14:46
The stream execution tests enabled the usage runtime but never supplied
the in-memory worker queue or spawned a worker, so lifecycle events
(stream-started/first-byte) were dropped by the queue-disabled path.
Tests also read the failed candidate's extra_data synchronously right
after the terminal event instead of waiting for the background candidate
status write.

Build the test app state with a memory runtime-state queue, enable
queue_lifecycle_events, spawn a usage runtime worker, abort it on drop,
and wait for a Failed candidate with extra_data before asserting.
The local stream failover test reads request candidates immediately after
receiving the successful response, but candidate trace writes happen on
background tasks. CI can observe only the first candidate, or observe the
primary before its retryable 429 failure update lands.

Wait for the failed primary and successful backup candidate records to
converge before asserting the existing candidate fields.
The GLM coding plan endpoint templates can override the provider base URL,
so endpoint.rs now normalizes endpoint_template.base_url.unwrap_or(template.base_url).
The architecture test should still assert that endpoint.rs owns base URL
normalization, but not the old exact expression.
Kayphoon added a commit to Kayphoon/Aether that referenced this pull request Jun 26, 2026
Kayphoon added a commit to Kayphoon/Aether that referenced this pull request Jun 26, 2026
Kayphoon added 2 commits July 7, 2026 03:53
Resolve conflicts:
- template.rs: take main (superset with OVERRIDE_CUSTOM_PATH + tests)
- builders.rs: take main (override system replaces validation block)
- lib.rs: union both symbol sets (codex reset credits + glm coding plan)
- ProviderFormDialog.vue: combine glm conditional with legacyT() wrapper
- PoolManagement.vue: take main's PoolKeyStatsPanel component, pass
  dynamic group labels via new component props
- PoolKeyStatsPanel.vue: add fiveHourGroupLabel/weeklyGroupLabel props

Verified: cargo check, cargo clippy -D warnings, cargo test glm_coding_plan,
cargo fmt --check, vue-tsc --noEmit, vitest (44/44 pass)
PR added queue_lifecycle_events: true with a background worker for the
stream execution tests, but left lifecycle_enqueue_delay_ms at the
default 1000ms. The coalescing delay caused streaming-status usage
events to arrive past the 15s test deadline. Set delay to 0 so events
are enqueued immediately for the worker to consume.
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.

1 participant