Skip to content

feat(crush): Kong seeder fix + Z.AI provider + SPARK awakening handoff - #2105

Merged
POWERFULMOVES merged 6 commits into
mainfrom
feat/crush-glm52-lanes-and-learnings
Jul 12, 2026
Merged

POWERFULMOVES merged 6 commits into
mainfrom
feat/crush-glm52-lanes-and-learnings

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented Jul 12, 2026

Copy link
Copy Markdown
Owner

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-level name). 0 of 17 parsed — the seeder was completely non-functional. Additionally, pmoves/mk/kong.mk was never included by the Makefile, making make kong-seed-routes dead code.

Fix: Extended the fallback chain to handle all 3 patterns + added warning log for skipped files + wired the kong.mk include + 8 unit tests (all passing).

Lane B: Z.AI Direct Provider in Crush Configurator (crush_configurator.py)

crush setup only generated TensorZero providers. On nodes without TensorZero, the generated config was broken. Now emits Z.AI Coding Plan (GLM-5.2 + GLM-5-Turbo) when Z_AI_API_KEY is present, with Z.AI as fallback in model selection.

Also adds chat_zai_glm52 to provider_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.md for future agents performing similar tasks.

Testing

  • Kong seeder: 8/8 unit tests pass (including real model-suits integration test — 16/17 parse)
  • Crush configurator: verified Z.AI provider appears in generated config
  • No runtime code changed (tools + config + docs only)

Related

💘 Generated with Crush

Summary by CodeRabbit

  • New Features

    • Added support for configuring Z.AI Coding Plan with GLM-5.2 and GLM-5-Turbo models when an API key is available.
    • Improved model selection across TensorZero, Z.AI, and other configured providers.
    • Expanded Kong model configuration support for multiple YAML layouts and additional provider endpoints.
  • Bug Fixes

    • Added clearer warnings when model configuration details cannot be resolved.
    • Improved API key and endpoint detection for supported providers.
  • Documentation

    • Added guidance covering configuration validation, provider setup, review verification, and troubleshooting workflows.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@POWERFULMOVES, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 18 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ea1d2e7a-41e7-42bd-b69f-3f239ee075d7

📥 Commits

Reviewing files that changed from the base of the PR and between 21302c6 and 73a9ef2.

📒 Files selected for processing (12)
  • .claude/PATTERNS.md
  • .gitignore
  • pmoves/Makefile
  • pmoves/config/provider_catalog.yaml
  • pmoves/docs/AGENTS/AGNOTE4482PHI.t1.md
  • pmoves/docs/handoffs/CRUSH_GLM52_LANES_2026-07-12.md
  • pmoves/docs/handoffs/SPARK_CRUSH_AWAKENING_2026-07-12.md
  • pmoves/mk/kong.mk
  • pmoves/tensorzero/config/tensorzero.toml
  • pmoves/tests/unit/test_kong_route_seeder.py
  • pmoves/tools/crush_configurator.py
  • pmoves/tools/kong_route_seeder.py
📝 Walkthrough

Walkthrough

The 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.

Changes

Kong seeder schema support

Layer / File(s) Summary
Model-suit parsing and validation
pmoves/tools/kong_route_seeder.py, pmoves/tests/unit/test_kong_route_seeder.py
The parser handles nested and legacy YAML layouts, reports unresolved entries, extends provider inference, and tests valid and skipped schemas.
Kong target wiring and schema documentation
pmoves/Makefile, .claude/PATTERNS.md, pmoves/docs/handoffs/...
The top-level Makefile includes Kong targets, while documentation records schema gaps and verification steps.

Z.AI provider configuration

Layer / File(s) Summary
Z.AI provider specification and model selection
pmoves/tools/crush_configurator.py
Adds Z.AI Coding Plan models, broadens GLM role inference, and uses Z.AI as fallback when TensorZero is unavailable.
Conditional provider wiring and catalog entry
pmoves/tools/crush_configurator.py, pmoves/config/provider_catalog.yaml, .claude/PATTERNS.md, pmoves/docs/handoffs/...
Emits Z.AI when Z_AI_API_KEY is present and catalogs the GLM-5.2 model and serving routes.

Operational documentation

Layer / File(s) Summary
Validation and review protocols
.claude/PATTERNS.md, pmoves/docs/handoffs/...
Documents skill frontmatter validation, review-comment verification, cross-reference sweeps, and operational checks.
Crush session lane handoff
pmoves/docs/handoffs/CRUSH_GLM52_LANES_2026-07-12.md
Records session-lane metadata and HuggingFace agent-service and dataset-publication status gaps.

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
Loading
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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and testing, but omits the required checks, review coordination, follow-up, and reviewer notes sections. Add the missing template sections, especially the required checkboxes, review coordination notes, and any follow-up or reviewer notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main changes across Kong seeding, Z.AI support, and handoff docs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/crush-glm52-lanes-and-learnings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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

Copy link
Copy Markdown

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: 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".

Comment thread pmoves/tools/crush_configurator.py
Comment thread pmoves/Makefile
Comment thread pmoves/tools/kong_route_seeder.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
pmoves/tools/crush_configurator.py (1)

262-296: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Update stale build_config docstring.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3270527 and 21302c6.

📒 Files selected for processing (7)
  • .claude/PATTERNS.md
  • pmoves/Makefile
  • pmoves/config/provider_catalog.yaml
  • pmoves/docs/handoffs/CRUSH_GLM52_LANES_2026-07-12.md
  • pmoves/tests/unit/test_kong_route_seeder.py
  • pmoves/tools/crush_configurator.py
  • pmoves/tools/kong_route_seeder.py

Comment thread .claude/PATTERNS.md Outdated
Comment thread pmoves/docs/handoffs/CRUSH_GLM52_LANES_2026-07-12.md
Comment thread pmoves/docs/handoffs/CRUSH_GLM52_LANES_2026-07-12.md
Comment thread pmoves/tools/crush_configurator.py
POWERFULMOVES added a commit that referenced this pull request Jul 12, 2026
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
@POWERFULMOVES
POWERFULMOVES force-pushed the feat/crush-glm52-lanes-and-learnings branch from 9777954 to 73a9ef2 Compare July 12, 2026 22:10
@POWERFULMOVES
POWERFULMOVES merged commit 7ae07ba into main Jul 12, 2026
21 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the feat/crush-glm52-lanes-and-learnings branch July 12, 2026 22:16
POWERFULMOVES added a commit that referenced this pull request Jul 15, 2026
…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
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