修复 local agent「始终允许」跨会话泄漏,限制为当前聊天会话生效#10
Draft
Copilot wants to merge 5 commits into
Draft
Conversation
Open
Agent-Logs-Url: https://github.com/LiteyukiStudio/agent/sessions/b222c897-7521-4d49-8269-36cfe06e2874 Co-authored-by: snowykami <79104275+snowykami@users.noreply.github.com>
Agent-Logs-Url: https://github.com/LiteyukiStudio/agent/sessions/b222c897-7521-4d49-8269-36cfe06e2874 Co-authored-by: snowykami <79104275+snowykami@users.noreply.github.com>
Agent-Logs-Url: https://github.com/LiteyukiStudio/agent/sessions/b222c897-7521-4d49-8269-36cfe06e2874 Co-authored-by: snowykami <79104275+snowykami@users.noreply.github.com>
Agent-Logs-Url: https://github.com/LiteyukiStudio/agent/sessions/b222c897-7521-4d49-8269-36cfe06e2874 Co-authored-by: snowykami <79104275+snowykami@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix permission issue for local agent consent
修复 local agent「始终允许」跨会话泄漏,限制为当前聊天会话生效
May 21, 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.
当前行为中,一次点击「始终允许」会影响后续所有聊天会话;预期应仅在当前会话内生效。该 PR 将“始终允许”从进程级放行改为按 chat session 维度生效,并保留无会话标识场景的兼容路径。
变更概览:按 chat session 限定审批范围
local_agent/src/connection.ts中新增按__chat_session_id记录的会话级放行集合。上下文透传:将 chat session 标识带到 local agent
root_agent/tools/local_agent.py的_call(...)中,将tool_context.state["__chat_session_id"]注入到下发给 local agent 的args,供本地审批逻辑使用。兼容性处理
__chat_session_id的请求,继续走现有连接内 fallback(sessionAlwaysApprove),避免旧路径立即失效。