zai-org / zai-org/feedback

[建议 / Feature] Choose which agent drives the session (like opencode)

Open
#636 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2 status: 待评估 type: 功能建议
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复提议 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category

对话 / Agent 交互 · Agent chat / interaction

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

使用场景 · Use case
Primary pain points

Hardcoded default agent instructions:

  • are actively hostile to "pair programming" style of interaction
  • include arbitrary and subjective preferences about the output style — I can layer my preferences on top, but they will contradict the existing prompt, leaving the agent with incoherent guidance, so it does a random mix of the two

Default agent instructions can not be customized or replaced. AFAIK, custom agents skip the default instructions, and load only the custom instruction, but the default agent is the only one I can speak to (i.e. have it be the main agent in a session).

Problem 1 — discouraging agent from discussion

I use the agent for pair programming with constant back-and-forth. In opencode, I fully replace default agent's system prompt for a custom one. My custom prompt encourages agent to stop and ask if anything is unclear, suggest options, and point out problems that might be worth fixing right now, before the new code entrenches them further.

I asked zcode to quote examples where its system prompt contradicts my custom one:

You are operating autonomously. The user is not watching in real time and cannot answer questions mid-task, so asking 'Want me to…?' or 'Shall I…?' will block the work.

Why this is bad? User IS watching in real time, and can steer, if the agent is going in the wrong direction.

Before ending your turn, check your last paragraph. If it is a plan, an analysis, a question, a list of next steps, or a promise about work you have not done ('I'll…', 'let me know when…'), do that work now with tool calls.

Why this is bad? Doing periodic checkpoints is precisely what I want from the agents. One-shotting complex tasks with no in-progress review wastes time and tokens to produce bad code that needs to be re-written anyway.

When you have enough information to act, act. Do not re-derive facts already established in the conversation, re-litigate a decision the user has already made, or narrate options you will not pursue. If you are weighing a choice, give a recommendation, not an exhaustive survey.

Why this is bad? Double-checking catches real errors — agent's AND mine. If agent observes something contradictory to my stated assumptions, I'd want it to check and alert me, not assume I'm always right. Also, narrating options agents won't pursue can be exceptionally useful. I can see the pros/cons reasoning, evaluate the alternatives, correct wrong assumptions from the agent, oftentimes I end up asking the agent to choose an approach they discarded instead of the one they picked.

Typical model training is already biased towards "shut up and do the thing", which is not always desirable. The built-in prompt makes it worse, with no option to change it.

Problem 2 — bloat and distraction

My custom prompt is shorter, meaning I have more context left for actual work. I did not see full verbatim system prompt from zcode, but oftentimes the default prompt in the harness (e.g. claude code) includes instructions that are irrelevant to my work, yet they take up context space and distract the agent — because it's one more caveat to think about for any given action it takes. Irrelevant instructions are not merely dead weight, they can steal agent's attentions to ensure compliance with a rule I never cared about.

Problem 3 — subjective output style preferences

When discussing code in a long multi-turn session, dense, structured, scannable output saves A LOT of time and effort, compared to loose, "flowy" prose. Structured output conveys information faster, and pushes agents towards precision over narrative.

Default prompt, meanwhile, says:

The way to keep output short is to be selective about what you include (drop details that don't change what the reader would do next), not to compress the writing into fragments, abbreviations, arrow chains like A → B → fails, or jargon

a simple question gets a direct answer in prose, not headers and sections

This may be a reasonable default, but personally, I want the tables, and the headings, and the arrow→chains.

Loose prose vs concrete structured delivery is the main reason I strongly favor Kimi over Claude — the way an agent communicates can make even a significantly more intelligent model useless, because the way it speaks obscures the information I need to steer it, effectively running as if unsupervised, or forcing me to read through walls of text and request elaboration of "helpful" metaphors. Structured text is scannable, and prose isn't.

建议方案 · Proposal

Basic version:

  • Allow the user to select which agent is the main/default one for the session (like opencode).
  • Allow the user to configure which agent is auto-selected for new sessions

Advanced version:
In opencode, I can additionally:

  • Have fully custom default agent, plus custom agents that append their specific instructions
  • Switch the driving agent mid-session (this dumps agent-specific instructions into chat, switches permission config to that agent's, but does not duplicate the shared baseline agent prompt).

What agent sees:

1. You are ZCode ( ... generic instructions ...)                         ← default/baseline agent 
2. You are a builder agent ( ... builder specific instructions ... )     ← specific agent
3. (exchanging messages with user, doing some work)
4. You are researcher agent ( ... researcher specific instructions ... ) ← new specific agent + permission config switched to "researcher"
5. (session continues, agent now acting as researcher)
预期价值 · Expected value
  • Customize default agent behavior when the default prompt actively works against the intended usage style (e.g. active supervision, "driving" the agent)
  • Customize agent's output style without conflicting instructions hardcoded in the prompt.
  • Directly chat to purpose-built agents prompted for the task at hand, not distracted and weighed down by generic instructions
  • Switch between task-specific instructions and roles mid-session. E.g. Investigate (locally) → Research (online) → Brainstorm → Build → Test. All in one context window, if desired. It eliminates the broken telephone situation, where the main agent doesn't actually understand what subagent said and only relays surface-level bullet points. There is no inherent need to bind "isolated context" with "specific role instructions", i.e. agent can assume new roles mid-session.

Opencode already allows all these things.

你认为的优先级 · Your perceived priority

中 · Medium

你使用的 ZCode 版本 / 环境 · ZCode version / environment

Windows — ZCode 3.11.2 (build 6792) — desktop app (not CLI)

补充材料 · Additional context

Agent selection in opencode desktop (you can flip it mid-session too):
Image
Image

Relevant portion of my opencode config:

{
	"$schema": "https://opencode.ai/config.json",
	"instructions": [
		".opencode/custom/default.md", // baseline agent prompt (for all agents)
		".opencode/rules/*.md",
	],
	"lsp": true,
	"shell": "bash",
	"permission": {
		"question": "deny", // ask in chat instead
	},
	"agent": {
		"build": {
			"prompt": "\n", // Force empty → custom instructions supply *shared* baseline prompt.
			// CAUTION: empty string treated as "use default"
		},
		"explore": {
			"disable": true, // use custom "investigator" agent instead
		},
		"scout": {
			"disable": true, // use custom "investigator" agent instead
		},
	},
}

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

Start by tracing the desktop session and agent-selection flow described in the issue, then compare its behavior with the provided opencode configuration and examples. Define how the default agent is chosen, how users switch agents mid-session, and how custom instructions and permissions are applied; done means these behaviors are specified and verifiable in the desktop app.

Written by the indexing model from the issue text.

Assessment

Domain
ai, desktop, developer-experience
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.