feat(crush): Kong seeder fix + Z.AI provider + SPARK awakening handoff - #2105
Conversation
|
Warning Review limit reached
Next review available in: 18 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
📝 WalkthroughWalkthroughThe pull request expands Kong model-suit parsing and wiring, adds direct Z.AI provider configuration with GLM model selection, catalogs GLM-5.2, adds parser tests, and documents validation, review, and session-lane procedures. ChangesKong seeder schema support
Z.AI provider configuration
Operational documentation
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ModelSuitFiles
participant KongSeeder
participant SeederTests
ModelSuitFiles->>KongSeeder: load YAML suit definitions
KongSeeder->>KongSeeder: resolve nested and legacy fields
KongSeeder->>SeederTests: return parsed suits or warnings
sequenceDiagram
participant EnvFiles
participant CrushConfigurator
participant ModelSelector
participant CrushConfig
EnvFiles->>CrushConfigurator: provide Z_AI_API_KEY
CrushConfigurator->>ModelSelector: register available providers and models
ModelSelector->>CrushConfig: select TensorZero or Z.AI defaults
Possibly related PRs
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 21302c615b
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
pmoves/tools/crush_configurator.py (1)
262-296: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUpdate stale
build_configdocstring.The docstring still describes TensorZero as the "ONLY provider" and "sole source of truth," and states the return keys are
{"tensorzero"}. With the conditional Z.AI provider now added, these claims are inaccurate.📝 Proposed docstring update
- """Build Crush config with TensorZero as the ONLY provider. - - This function dynamically discovers all available models from the TensorZero - Gateway API, eliminating hardcoded model lists. TensorZero serves as the - single source of truth for model routing and observability. + """Build Crush config with TensorZero as the primary provider. + + This function dynamically discovers all available models from the TensorZero + Gateway API, eliminating hardcoded model lists. TensorZero serves as the + primary source of truth for model routing and observability. When a Z.AI + API key is present, a direct Z.AI Coding Plan provider is also included + as a fallback for nodes without the TensorZero gateway.Also update the return docstring at line 279:
- - Dict[str, ProviderSpec]: Mapping of provider IDs to ProviderSpec objects - for runtime inspection. Keys: {"tensorzero"} + - Dict[str, ProviderSpec]: Mapping of provider IDs to ProviderSpec objects + for runtime inspection. Keys: {"tensorzero", "zai" (when Z_AI_API_KEY is set)}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@pmoves/tools/crush_configurator.py` around lines 262 - 296, Update the build_config docstring to describe both conditional TensorZero and Z.AI providers instead of TensorZero as the only provider or sole source of truth. Revise the provider mapping return description to reflect that keys may include tensorzero and zai, and remove or update any stale fallback/provider claims while preserving the documented MCP, context, and LSP behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.claude/PATTERNS.md:
- Around line 768-787: Update the “Model-Suit YAML Schema — Kong Seeder Gap” and
“Crush Configurator — Z.AI Direct Provider Gap” sections in PATTERNS.md to mark
both issues as resolved, replacing present-tense claims about parsing failures,
dead Make targets, and TensorZero-only output with a concise pointer to the
fixes in this PR. Preserve the historical context and affected symbols while
making clear the documented gaps no longer apply.
In `@pmoves/docs/handoffs/CRUSH_GLM52_LANES_2026-07-12.md`:
- Around line 9-67: Update the status headings for Lane A and Lane B in the
handoff document to indicate both fixes are included in this PR, replacing the
current open/unclaimed and open/recommended wording with a clear “CLAIMED —
fixed in this PR” equivalent. Leave the documented fix scopes and verification
details unchanged.
- Around line 33-37: Update the verification command invoking
_parse_model_suits() to pass the required model_suits_dir Path, using the
repository’s model-suits directory location. Preserve the existing parsed-count
output and expectation.
In `@pmoves/tools/crush_configurator.py`:
- Around line 347-352: Update the Z.AI provider entry in the providers_dict
configuration to set api_key to the Crush environment reference $Z_AI_API_KEY
instead of the plaintext zai_key value. Keep the existing provider metadata and
base_url unchanged.
---
Nitpick comments:
In `@pmoves/tools/crush_configurator.py`:
- Around line 262-296: Update the build_config docstring to describe both
conditional TensorZero and Z.AI providers instead of TensorZero as the only
provider or sole source of truth. Revise the provider mapping return description
to reflect that keys may include tensorzero and zai, and remove or update any
stale fallback/provider claims while preserving the documented MCP, context, and
LSP behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: c18821b8-a512-45df-aafb-3a4760b6f2f2
📒 Files selected for processing (7)
.claude/PATTERNS.mdpmoves/Makefilepmoves/config/provider_catalog.yamlpmoves/docs/handoffs/CRUSH_GLM52_LANES_2026-07-12.mdpmoves/tests/unit/test_kong_route_seeder.pypmoves/tools/crush_configurator.pypmoves/tools/kong_route_seeder.py
Codex P2 (3): - crush_configurator: Z.AI fallback now reachable when TensorZero is down (was always added with fallback models, blocking the Z.AI path) - kong.mk: fix SEEDER_SCRIPT and MODEL_SUITS_DIR paths (were relative to repo root, but make -C pmoves runs from pmoves/) - (P2 per-model base URL grouping noted as known limitation in docs) CodeRabbit (4): - PATTERNS.md: known-issue sections updated to resolved/past tense - Handoff doc: Lane A/B status updated from OPEN to CLAIMED - Handoff doc: verification command fixed (missing Path argument) - .gitignore: add crush.json to prevent accidental key commit 8/8 Kong seeder tests still pass. Configurator verified: Z.AI becomes primary when TensorZero is unreachable. 💘 Generated with Crush Assisted-by: Crush:glm-5.2
…sion Captures 5 learnings from the Crush awakening session into always-loaded PATTERNS.md (silent-skip anti-pattern, Z.AI endpoint-locked keys, generator vs hand-config drift, cross-reference sweeps, multi-schema directories). Defines 3 claimable lanes with verified root causes and scoped fixes: - Lane A: Kong seeder schema mismatch (0/17 suits parse, dead Makefile include) - Lane B: Crush configurator Z.AI direct provider gap - Lane C: HuggingFace agent services (SPARK built 85%, last 15% unclaimed) 💘 Generated with Crush Assisted-by: Crush:glm-5.2
The Kong route seeder's _parse_model_suits() only understood
top-level model_id/provider or model.{id,provider} nesting. All 17
model suits in pmoves/configs/model-suits/ use one of three
incompatible patterns (model_suit:, suit:, or top-level name), so
0 of 17 files parsed — the seeder was completely non-functional.
Fix: extended the fallback chain to also check model_suit.{name,
provider, base_url, api_key_env} and suit.{id, provider, base_url,
api_key_env} and top-level name. Added warning log for skipped files.
Also wired pmoves/mk/kong.mk into the Makefile (was never included,
making make kong-seed-routes dead code). Added ollama_spark/local/cloud
and anthropic to the provider inference maps.
8/8 unit tests pass including real model-suits integration test.
💘 Generated with Crush
Assisted-by: Crush:glm-5.2
crush_configurator.py now emits Z.AI Coding Plan alongside TensorZero when Z_AI_API_KEY is present. Z.AI serves as fallback when TensorZero is unavailable, so `crush setup` produces a working GLM-5.2 config on any node with the API key — no hand-config needed. Changes: - Added ZAI_SPEC ProviderSpec (glm-5.2 large, glm-5-turbo small) - build_config() conditionally adds zai provider when key present - _select_models() uses Z.AI as fallback after TensorZero - Role inference now recognizes glm-5/glm-4.7 as large models - provider_catalog.yaml: added chat_zai_glm52 entry (1M context, 4 function demands, primary weight for coding_glm + orchestrator) 💘 Generated with Crush Assisted-by: Crush:glm-5.2
SPARK Crush awakening orchestration handoff with 4-step procedure (install, config replicate, verify skills, write trail). Documents HF agent pickup context (Lane C sub-lanes C1-C4) for SPARK node. AGNOTE4482PHI.t1.md CLAIM entry for the full session. 💘 Generated with Crush Assisted-by: Crush:glm-5.2
Closes the dangling reference from the provider_catalog chat_zai_glm52 entry by adding the matching [models.chat_zai_glm52] block to tensorzero.toml, plus coding_glm and orchestrator function variants that route to it. Also extends crush_configurator ENV_CANDIDATES to include pmoves/env.tier-llm so Z_AI_API_KEY is sourced from the CHIT secrets funnel rather than requiring manual env export. This supersedes the routing approach in PRs #2087/#2086 which pointed cloud_zai_glm52 at chat_ollama_cloud_default (wrong provider, needs OLLAMA_API_KEY instead of Z_AI_API_KEY). The correct path is direct: chat_zai_glm52 -> Z.AI Coding Plan endpoint. 💘 Generated with Crush Assisted-by: Crush:glm-5.2
Codex P2 (3): - crush_configurator: Z.AI fallback now reachable when TensorZero is down (was always added with fallback models, blocking the Z.AI path) - kong.mk: fix SEEDER_SCRIPT and MODEL_SUITS_DIR paths (were relative to repo root, but make -C pmoves runs from pmoves/) - (P2 per-model base URL grouping noted as known limitation in docs) CodeRabbit (4): - PATTERNS.md: known-issue sections updated to resolved/past tense - Handoff doc: Lane A/B status updated from OPEN to CLAIMED - Handoff doc: verification command fixed (missing Path argument) - .gitignore: add crush.json to prevent accidental key commit 8/8 Kong seeder tests still pass. Configurator verified: Z.AI becomes primary when TensorZero is unreachable. 💘 Generated with Crush Assisted-by: Crush:glm-5.2
9777954 to
73a9ef2
Compare
…ap (#2129) Both PRs independently added [models.chat_zai_glm52] to tensorzero.toml and chat_zai_glm52 to provider_catalog.yaml. Merged both contributions into single canonical entries: tensorzero.toml: 2 duplicate model blocks → 1 provider_catalog.yaml: 2 duplicate entries → 1, with all 7 function demands merged (agent_zero, coding_glm, coding_kilocode, archon_work_orders, archon_code_review, orchestrator, deepresearch) 💘 Generated with Crush Assisted-by: Crush:glm-5.2
Summary
Three deliverables from the Crush GLM-5.2 session that make the ecosystem work correctly for every node, not just this one.
Lane A: Kong Route Seeder Schema Fix (
kong_route_seeder.py)The seeder's
_parse_model_suits()only understood one schema pattern. All 17 model-suit YAMLs use different nestings (model_suit:,suit:, top-levelname). 0 of 17 parsed — the seeder was completely non-functional. Additionally,pmoves/mk/kong.mkwas never included by the Makefile, makingmake kong-seed-routesdead code.Fix: Extended the fallback chain to handle all 3 patterns + added warning log for skipped files + wired the
kong.mkinclude + 8 unit tests (all passing).Lane B: Z.AI Direct Provider in Crush Configurator (
crush_configurator.py)crush setuponly generated TensorZero providers. On nodes without TensorZero, the generated config was broken. Now emits Z.AI Coding Plan (GLM-5.2 + GLM-5-Turbo) whenZ_AI_API_KEYis present, with Z.AI as fallback in model selection.Also adds
chat_zai_glm52toprovider_catalog.yaml(was missing — GLM-5.2 only listed under Ollama Cloud).Lane C: SPARK Awakening Handoff (
CRUSH_GLM52_LANES_2026-07-12.md)Documents 3 claimable lanes for cross-node agents + 5 learnings captured into
PATTERNS.mdfor future agents performing similar tasks.Testing
Related
💘 Generated with Crush
Summary by CodeRabbit
New Features
Bug Fixes
Documentation