fix(core): 修复多工作区模式下 /mode 未作用到当前 workspace agent 的问题#363
Open
JrDw0 wants to merge 2 commits intochenhg5:mainfrom
Open
fix(core): 修复多工作区模式下 /mode 未作用到当前 workspace agent 的问题#363JrDw0 wants to merge 2 commits intochenhg5:mainfrom
JrDw0 wants to merge 2 commits intochenhg5:mainfrom
Conversation
chenhg5
approved these changes
Mar 29, 2026
Owner
chenhg5
left a comment
There was a problem hiding this comment.
LGTM. Correct fix for multi-workspace /mode issue.
Review notes:
- ✅ CI passes
- Properly uses
commandContext()to get workspace-specific agent - Card actions also updated to use
sessionContextForKey() - Good test coverage for multi-workspace scenarios
- Fixes issue #233
Approved for merge.
|
你这里修复的在codex下用不了skills命令,/quiet 目前也只有一个生效 |
Owner
|
This PR has merge conflicts with the main branch. Please resolve: git fetch origin
git checkout your-branch
git merge origin/main
# Resolve conflicts, then:
git pushAlso, there was a comment from @archerjty noting that:
Please verify if these issues are addressed in this PR or need separate fixes. |
f2f087c to
0ae4d58
Compare
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.
关联 issue #233
变更说明
修复多工作区模式下
/mode只更新全局 agent、没有更新当前 workspace agent 的问题。在
multi-workspace模式下,普通消息会路由到当前工作区对应的 workspace agent。但原来的
/mode yolo和卡片动作act:/mode ...实际修改的是全局e.agent,导致界面上看起来已经切到 YOLO,当前工作区会话却仍然按旧模式运行。
这会表现为:
/mode yolo后日志显示切换成功full-auto修改内容
cmdMode改为通过commandContext()获取当前会话对应的 agent 和 session manager/mode改为通过sessionContextForKey()获取当前 workspace agent/mode卡片渲染改为显示当前 workspace agent 的真实模式/mode更新 workspace agent为什么 #240 还不够
#240 修复了模式切换后需要重置 session 才能生效的问题,但它仍然操作的是全局
e.agent/e.sessions。在多工作区模式下,真正处理消息的是按工作区缓存的 workspace agent,因此仅修复 session
重置还不够,必须把 mode 切换应用到当前 workspace agent 上。
测试
已执行: