Add GLM-4.7 Z.ai smoke lane handoff (Opencode)

This commit is contained in:
Sam & Claude 2026-05-24 22:02:05 +02:00
parent ec56c941a8
commit ecdac60b36

84
doc/GLM-4.7-SMOKE.md Normal file
View file

@ -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 '<EXACT_GLM_MODEL_ID>' -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