From ecdac60b3629d64235d725c76cb5aa3a1abc6ffa Mon Sep 17 00:00:00 2001 From: Sam & Claude Date: Sun, 24 May 2026 22:02:05 +0200 Subject: [PATCH] Add GLM-4.7 Z.ai smoke lane handoff (Opencode) --- doc/GLM-4.7-SMOKE.md | 84 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 doc/GLM-4.7-SMOKE.md diff --git a/doc/GLM-4.7-SMOKE.md b/doc/GLM-4.7-SMOKE.md new file mode 100644 index 00000000..eb7d397f --- /dev/null +++ b/doc/GLM-4.7-SMOKE.md @@ -0,0 +1,84 @@ +# Pi + GLM-4.7 (Z.ai) Smoke Lane + +**Status:** Waiting for `ZAI_API_KEY` from Sam +**Owner:** Opencode / Z.ai Integrator +**Blocked on:** Operator-provided API key + +## Purpose + +Prove that `pi` can talk to GLM-4.7 through the Z.ai provider lane +and return valid JSON-mode output. This is the lane this Opencode +session actually runs on — smoke it first before testing DeepSeek v4 +or any other provider. + +## Current Environment + +- pi: `0.75.5` +- node: `v22.22.0` +- auth.json: empty (`{}`) +- `ZAI_API_KEY`: not set + +## Smoke Commands + +Run these once Sam provides the key. + +### 1. Set the key (no shell history) + +```sh +read -rsp "ZAI API key: " ZAI_API_KEY; echo +export ZAI_API_KEY +export ZAI_API_BASE="https://api.z.ai/api/coding/paas/v4" +``` + +### 2. Discover available models + +```sh +pi --provider zai --list-models 2>&1 | tee /tmp/zai-models.txt +``` + +### 3. Filter for GLM models + +```sh +grep -i glm /tmp/zai-models.txt +``` + +### 4. Run smoke in JSON mode + +Use the exact model ID from step 3: + +```sh +pi --provider zai --model '' -p --mode json "reply with the single word: ok" 2>&1 | tee /tmp/glm47-smoke.json +``` + +### 5. Validate + +```sh +python3 -c " +import json, sys +d = json.load(open('/tmp/glm47-smoke.json')) +print('provider:', d.get('provider', 'MISSING')) +print('model:', d.get('model', 'MISSING')) +content = str(d.get('content', d.get('text', '')))[:120] +print('content:', content) +print('PASS' if 'ok' in content.lower() else 'FAIL') +" +``` + +### 6. Clean up + +```sh +unset ZAI_API_KEY ZAI_API_BASE +``` + +## What to Report Back + +1. Exact model ID from `--list-models` +2. Full JSON response from smoke run +3. Provider and model fields +4. PASS/FAIL +5. Wall-clock latency + +## Deletion Criteria + +- Smoke passes and results are committed +- Lane confirmed in agent capability table