Conversation
This reverts commit bf1cf1d.
…ching Add a yolo agent definition to agent-config/opencode.json with permissive permissions, implement AgentConnector.setSessionMode() and getSessionModeOverride() helper, wire setSessionMode() into all 5 session types in SessionOrchestrator, and remove the unused OPENCODE_YOLO env var. - Add yolo agent with "*": "allow" permissions to opencode.json - Add default_agent: "build" to ensure restricted mode by default - Implement AgentConnector.setSessionMode() using stable ACP SDK method - Add getSessionModeOverride() in agent-factory.ts for opencode+yolo - Call setSessionMode() after setSessionModel() in all session flows - Remove OPENCODE_YOLO env var from agent-factory and sandbox-manager - Update AGENTS.md, DESIGN.md, AGENT_PERMISSIONS.md, BDD feature specs - Add comprehensive tests for all changes (1139 tests pass) Resolves #264, #265, #266, #267, #268 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Jim Chen <Jim@ChenJ.im>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
jim60105
approved these changes
Mar 9, 2026
This was
linked to
issues
Mar 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
工作報告
概述
實作 OpenCode YOLO Agent 配置與 ACP
setSessionMode模式切換功能。當 YOLO 模式啟用時,OpenCode 會透過 ACPsetSessionMode("yolo")切換到具有完全寬鬆權限的yoloAgent,取代先前無效的OPENCODE_YOLO環境變數方案。變更內容
1. OpenCode 配置 (
agent-config/opencode.json)yoloAgent 定義,權限為"*": "allow"(完全不受限)"default_agent": "build"確保預設使用受限模式buildAgent 權限規則完全未修改2. ACP 層 (
src/acp/)agent-connector.ts:新增setSessionMode()方法,使用穩定的 ACP SDKconnection.setSessionMode()agent-factory.ts:新增getSessionModeOverride()函數,僅在opencode + yolo時回傳"yolo"agent-factory.ts:移除無效的OPENCODE_YOLO環境變數設定,改為說明性註解sandbox-manager.ts:從 OpenCode 允許環境變數列表移除OPENCODE_YOLO3. SessionOrchestrator 整合 (
src/core/session-orchestrator.ts)setSessionModel()之後插入setSessionMode()調用:processMessageInternal()(一般訊息 + 頻道潛伏)processSpontaneousPost()(自發性發文)processSelfResearch()(自我研究)processMemoryMaintenance()(記憶維護)processReminder()(提醒)4. 文件更新
AGENTS.md:更新 Session Flow 範例、新增 OpenCode YOLO Mode 說明docs/DESIGN.md:更新 opencode.json 描述docs/AGENT_PERMISSIONS.md:更新 OPENCODE_YOLO 相關說明docs/features/28-*.feature:新增 3 個 OpenCode setSessionMode 場景docs/features/29-*.feature:移除 OPENCODE_YOLO 環境變數相關場景測試結果
deno fmt --check src/ tests/通過deno lint src/ tests/通過deno check src/main.ts通過新增測試
AgentConnector.setSessionMode成功呼叫與未連線拋錯getSessionModeOverride四種組合(opencode±yolo, copilot+yolo, gemini+yolo)SessionOrchestratoropencode+yolo 呼叫 setSessionMode、opencode 非 yolo 不呼叫、copilot+yolo 不呼叫設計決策
OPENCODE_YOLO環境變數setSessionMode("yolo")而非 CLI flag--yoloCLI flag,需透過 ACP 協定切換 AgentgetSessionModeOverride()放在agent-factory.tsyoloAgent 的mode: "primary"availableModes列表中Resolves #264, #265, #266, #267, #268