-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
status:todoPlanned but not startedPlanned but not started
Description
🔍 发现的问题 / 原始需求描述
上游 opencode 还提供了一批只读但高可观测性的接口:find.text、find.files、file.read/list/status、path.get、vcs.get、command.list、app.agents、app.skills、lsp.status、formatter.status。这些接口不直接属于 A2A 主聊天路径,但对 IDE 集成、调试面板、诊断客户端很有价值。当前 opencode-a2a 完全没有暴露这部分能力,导致消费方很难把它当成 OpenCode 的远程控制面来使用。
🛠️ 详细实施方案 (必须包含涉及的文件路径和核心逻辑/伪代码)
- 新增只读 runtime inspection 扩展。
涉及文件:
src/opencode_a2a/contracts/extensions.pysrc/opencode_a2a/server/agent_card.pydocs/guide.md
建议方法集合:
opencode.find.textopencode.find.filesopencode.file.readopencode.file.listopencode.file.statusopencode.path.getopencode.vcs.getopencode.commands.listopencode.agents.listopencode.skills.listopencode.lsp.statusopencode.formatter.status
- 在上游 client 中补齐对应 GET 调用,并统一目录/工作区透传。
涉及文件:
src/opencode_a2a/opencode_upstream_client.py
- 在 JSON-RPC 层新增只读 handler,并对结果做最小标准化。
涉及文件:
src/opencode_a2a/jsonrpc/dispatch.pysrc/opencode_a2a/jsonrpc/handlers/runtime_inspection.py(new)src/opencode_a2a/jsonrpc/handlers/common.py
伪代码:
switch method:
opencode.find.text -> GET /find
opencode.file.read -> GET /file/content
opencode.vcs.get -> GET /vcs
opencode.agents.list -> GET /agent
...
return provider-private result with stable field names
- 约束范围:本 issue 只做只读观测面,不包含
pty.*、tui.*、global.dispose/upgrade、auth.*这类高风险或 UI 私有接口。
🧪 回归测试建议
- 为每类只读方法补齐成功、404、payload mismatch、目录边界校验测试。
- 为 Agent Card 契约增加方法声明与 capability snapshot 测试。
- 补充文档示例,验证消费方能基于这些方法实现简单诊断面板。
- 运行
./scripts/doctor.sh。
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
status:todoPlanned but not startedPlanned but not started