[Bug + Community Fix] ZCode GLM Coding Plan Login Failure After Update/Logout β deletedModels Blacklist Issue
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Bug Report & Community Fix Proposal
π Summary
ZCode cannot log back into GLM Coding Plan after update or logout β browser authorization succeeds but app never completes login. Root cause: deletedModels blacklist corrupts provider config.
Community Fix Available: megamen32/zcode-coding-plan-login-fix
π Problem Description
Symptoms
- User updates ZCode to new version
- User logs out of GLM Coding Plan account
- User attempts to log back in (Settings β Z.ai β Log in)
- Browser authorization window opens β
- User completes authorization on website β
- App never logs in β β provider appears empty/broken
Affected Users
- All ZCode users on GLM Coding Plan who:
- Updated ZCode recently, OR
- Logged out and tried to log back in
- Platform: macOS, Linux, Windows
- Severity: HIGH β completely blocks access to Coding Plan features
π¬ Root Cause Analysis
Technical Details (Discovered by @megamen32)
After logout, ZCode incorrectly moves all Coding Plan models into a blacklist called zcode.deletedModels and empties the model list:
// BROKEN STATE in ~/.zcode/v2/config.json
{
"builtin:zai-coding-plan": {
"name": "Z.ai - Coding Plan",
"enabled": true,
"source": "custom",
"models": {}, // β EMPTY! No models
"zcode": {
"deletedModels": [ // β Models blacklisted here
"glm-4.5-air",
"glm-4.7",
"GLM-5-Turbo",
"GLM-5.2"
]
}
}
}
Why this breaks login:
- Provider has empty models β App sees empty provider
- deletedModels blacklist prevents model restoration on re-login
- Authorization succeeds but provider initialization fails silently
- User stuck in infinite login loop
π οΈ Community Fix (by @megamen32)
Repository: megamen32/zcode-coding-plan-login-fix
Author: @megamen32 (GitHub)
Discord Thread: https://discord.com/channels/1346756824233148527/1537719656574615592
Fix Components
| File | Purpose |
|---|---|
| zcode_fix.py | Auto-fix script (Python 3.7+, cross-platform) |
| config.zai-coding-plan.json | Ready-to-paste model config for manual fix |
| README.md | Full documentation (EN/RU) |
Quick Fix (One-Liner)
macOS / Linux / Debian:
# Quit ZCode COMPLETELY first (Cmd+Q + check tray)
curl -fsSL https://raw.githubusercontent.com/megamen32/zcode-coding-plan-login-fix/main/zcode_fix.py | python3 -
Windows (PowerShell):
# Quit ZCode from system tray first
python -c "import urllib.request;exec(urllib.request.urlopen('https://raw.githubusercontent.com/megamen32/zcode-coding-plan-login-fix/main/zcode_fix.py').read())"
What the Fix Script Does
- Backs up ~/.zcode/v2/config.json with timestamp
- Finds all affected providers (zai-coding-plan, bigmodel-coding-plan, etc.)
- Removes zcode.deletedModels blacklist block
- Restores full model list with correct specs:
- GLM-5.3: 1M context, 128K output, reasoning variants (high/low/max)
- GLM-5.2: 1M context, 128K output
- GLM-5-Turbo: 200K context, 128K output, reasoning enabled/off
- Never touches API keys or other settings
Dry-Run Mode (Safe Check)
python3 zcode_fix.py --check # Shows what would be fixed, changes nothing
π Manual Fix (No Python Required)
- Quit ZCode completely (Cmd+Q + tray / system tray exit)
- Open config file:
- macOS/Linux: ~/.zcode/v2/config.json
- Windows: %USERPROFILE%.zcode\v2\config.json
- Backup the file β config.json.bak
- Find builtin:zai-coding-plan section
- Delete entire zcode.deletedModels block
- Replace empty models {} with full model list from repo config file
- Save, validate JSON, restart ZCode, log in again
π§ͺ Advanced Troubleshooting
| Symptom | Solution |
|---|---|
| Empty apiKey after login | Close ZCode, re-authenticate through UI |
| Auth window opens/closes instantly | Check popup blockers; try different default browser |
| Provider still broken | Delete entire provider block; let ZCode recreate it |
| Cache corruption | delete coding-plan-cache.json, re-login |
| Wrong auth mode | Ensure setting.json has zai family mode = oauth not api-key |
β Official Fix Recommendations
Immediate (Hotfix)
Patch the logout flow to NOT move models to deletedModels:
// CURRENT (BROKEN):
function logoutCodingPlan(provider) {
provider.models = {};
provider.zcode.deletedModels = Object.keys(provider.models);
}
// PROPOSED FIX:
function logoutCodingPlan(provider) {
// Clear session/auth only, preserve model definitions
provider.apiKey = "";
delete provider.zcode?.deletedModels;
}
Short-Term (Next Release)
- Validate provider state on login β auto-migrate if models empty but deletedModels exists
- Add Repair Provider button in Settings β Z.ai β Troubleshoot
- Show meaningful error instead of silent failure when provider broken
Long-Term (Architecture)
- Separate provider configuration from session state
- Server-side model list β fetch from API on login instead of cached config
- Config validation β detect corruption and offer repair on startup
π Impact Assessment
| Metric | Value |
|---|---|
| Severity | HIGH β Complete feature blockage |
| Affected Users | All Coding Plan users who updated/logout (widespread) |
| Platforms | macOS, Linux, Windows |
| Workaround Available | Yes (community script by @megamen32) |
| Official Fix Effort | Small (logout logic patch) |
π Acknowledgments
- Original Research & Fix: @megamen32 β Identified root cause, created cross-platform fix tool
- Community Repository: megamen32/zcode-coding-plan-login-fix
- Discord Discussion: https://discord.com/channels/1346756824233148527/1537719656574615592
Submitted by:
Regards,
Roman (Discord: bignavi_x)
- Z.ai Volunteer Ambassador
- Tech resources channel: https://t.me/VibeCodePrompterSystem
- Tech Blog: http://claw.rommark.dev/blog
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up β it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the community repository's zcode_fix.py, config.zai-coding-plan.json, and README.md to understand the reported config corruption and affected providers. Then locate the ZCode logout and provider-login entry points; done means logout preserves model definitions, login restores a usable provider, and the empty-model/deletedModels case is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100