zai-org / zai-org/feedback

[Feature Request] ZCode: API key rotation, auto-retry, worktree orchestration & performance diagnostics

Open
#229 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Feature Request: ZCode Improvements

Feedback from a new ZCode power user (Luke) who loves the platform but identified rough edges requiring custom workarounds.


Reporter Info

  • User: Luke (Discord OP)
  • Experience: New user, calls it "state of the art"
  • Use Case: DeepSeek via API provider (not GLM)
  • Timestamp: 8/8/26, 6:56 AM + 9:42 PM update

Feature #1: Native API Key Rotation

Problem:

User has multiple API keys on subscription plans and wants to distribute load evenly to maximize usage within rate limit windows.

Current Workaround:

"I created a proxy endpoint that does this key-rotation logic for me."

Requested Feature:
  • Configure multiple API keys in settings
  • Choose rotation strategy: Round-Robin / Least-Used / Random
  • Built-in usage tracking per key
  • Automatic failover when one key hits limits
Benefits:
  • Maximize subscription value across keys
  • No external proxy needed
  • Works for users with multiple API subscriptions

Bug Fix #2: Auto-Retry for empty_message Errors

Problem:

~1 in 1000 API requests fail with empty_message response. This does NOT happen in Claude Code, OpenCode, PI, etc.

Impact:
  • Background agents fail silently - particularly annoying
  • Breaks automation workflows
  • Requires manual retry or workaround
Current Workaround:

"Solution is endpoint proxy which can retry for errors like these."

Requested Fix:

ZCode should natively implement automatic retry with exponential backoff for:

  • empty_message errors (the ~1/1000 case)
  • Network timeouts (transient issues)
  • Rate limit 429 (after appropriate wait)
  • 502/503 server errors

Suggested: 3 retries with [500ms, 1000, 2000ms] backoff.


Feature #3: Git Worktree Orchestration Workflow

Problem:

User wants multiple features developed simultaneously using git worktrees, but ZCode lacks:

  • Managing multiple worktree agents
  • Automatic conflict resolution on merge
  • Orchestrator pattern for parallel development
Current Workaround:

"I vibe-coded a plugin that uses an orchestrator - one per project - which implements features in background agents, then reports back."

Requested Architecture:
        ORCHESTRATOR (Main Branch)
        - Receives feature requests
        - Dispatches background agents
        - Has full context for conflict resolution
        - Stays idle for new user requests
              |
    +-----+-----+-----+
    |     |     |     |
Agent A   Agent B   Agent C
(Feature)  (Feature)  (Feature)
Worktree   Worktree    Worktree
Key Features Needed:
  1. Parallel Development: Spawn agents per worktree with isolated context
  2. Orchestrator Pattern: Main agent idle, background agents report progress
  3. Auto Conflict Resolution: Orchestrator has ALL feature context, can intelligently merge
  4. Status Dashboard: Show all features, progress, conflicts detected

Feature #4: Performance Diagnostics Dashboard

Problem:

ZCode becomes significantly slower as users accumulate memory, plugins, skills:

Configuration Response Time Example
Clean install ~4 seconds for simple question
With memory + plugins + skills ~40 seconds same question
The Hidden Problem:

"Long term users keep adding skills, plugins, memory - making it slower without realizing why."

Requested Feature: Performance Breakdown

Show users WHAT is causing slowness:

  • Time-to-First-Token (TTFT) total breakdown
  • Per-component cost:
    • Memory/context: X seconds (Y%)
    • Each skill loaded: X seconds (Y%)
    • Each plugin active: X seconds (Y%)
    • System prompt overhead: X seconds (Y%)
  • Payload size: Total KB vs context window
  • Trend over time: Getting slower? By how much?
Proactive Alerts:
Warning: Response time increased 300% this week
Main cause: Memory grew from 50KB -> 180KB
Suggestion: Review/archive old entries

Summary

# Type Title Priority Effort
1 Feature API Key Rotation Medium Low
2 Bug Fix Auto-Retry empty_message High Low
3 Feature Worktree Orchestration Medium High
4 Feature Performance Diagnostics High Medium

Why This Matters

From reporter:

"Love everything about it, feels state of the art, but had to vibe-code fixes before I could use it productively."

These features bridge gap between casual use and productive/professional use.


Submitted on behalf of power user Luke who provided detailed technical feedback with existing workarounds.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. First split the request into separate proposals for key rotation, retry handling, worktree orchestration, and performance diagnostics, then locate the existing settings, API error, worktree, and timing components; each proposal is done only when its scope and acceptance criteria are independently testable.

Written by the indexing model from the issue text.

Assessment

Tech stack
git
Domain
backend-api-design, developer-experience, performance, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.