Skip to content

docs(rfc): RFC-0060 Agent Mode Declaration for OpenCode At-Mention Visibility - #376

Open
Million-mo wants to merge 2 commits into
wolf1069b:mainfrom
Million-mo:docs/rfc-0060-agent-mode-opencode-mention
Open

docs(rfc): RFC-0060 Agent Mode Declaration for OpenCode At-Mention Visibility#376
Million-mo wants to merge 2 commits into
wolf1069b:mainfrom
Million-mo:docs/rfc-0060-agent-mode-opencode-mention

Conversation

@Million-mo

Copy link
Copy Markdown
Collaborator

Summary

Adds RFC-0060: Agent Mode Declaration for OpenCode At-Mention Visibility — a DRAFT proposal to fix the inability to delegate to custom agents via at-mention (@agent) in the OpenCode integration.

Problem

wolfharness's OpenCode server hardcodes every manifest agent as mode="primary" (agent_routes.py:154), while the OpenCode client's at-mention popup filters candidates to mode !== "primary" (prompt-input-v2.tsx:275). Result: custom agents like visionary never appear in the @ popup, making @visionary-style delegation impossible.

Proposed Solution

Add a mode field to the manifest agent config (NativeAgentConfig) with vocabulary subagent | primary | all:

  • primary → switcher only (backward-compatible default)
  • subagent → at-mention popup only
  • all → both

list_agents reads the declared mode instead of the hardcoded literal. The wire Agent.mode field already supports the full vocabulary.

RFC Contents

  • Background & context with evidence (line-level citations for both server and client)
  • Goals / non-goals / measurable success criteria
  • 3 options evaluated against weighted criteria (declared field → recommended; auto-derive; hidden flag)
  • Technical design (config field + route wiring)
  • Implementation plan & rollback strategy
  • Open questions (incl. where AgentMode should live to avoid core→server import inversion)

Note

This is a DRAFT RFC for review only — no implementation code is included. Per the project pipeline (docs/rfcs/STATUS.md), once accepted it moves to an OpenSpec change.

… (RFC-0060)

Add a configurable mode field (primary/subagent/all, default primary) to
agent manifests. list_agents now returns each agent's declared mode
instead of the hardcoded 'primary', so OpenCode clients correctly place
subagents in the @-mention popup and primary agents in the switcher.

- Define AgentMode in wolfharness_config.nodes (config layer, avoids
  core->server circular import) and re-export from opencode server model
- Add mode to BaseAgentConfig, inherited by NativeAgentConfig
- Update tests (manifest parsing + list_agents routes) and docs
@Million-mo

Copy link
Copy Markdown
Collaborator Author

存在遗留问题,就是@subagent,应该转换成什么prompt,要让主agent知道要委派,要让subagent知道具体的任务。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant