-
Notifications
You must be signed in to change notification settings - Fork 3k
feat(core): accept cross-session messages behind an inbound gate #9576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
54a12e2
93418cb
eb1d343
5bf7e26
5928873
97426bc
b09bded
6dd138d
3ebd83f
e4065a7
0dd9b35
c6e0718
c5ba3f8
7ca3be7
3a81046
3021309
9f5a6dd
02e6300
a7595c3
a9d9f14
5c5a8e0
8b7af63
2e51fbd
7602a09
26c364d
ee63683
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3263,6 +3263,31 @@ const SETTINGS_SCHEMA = { | |
| }, | ||
| }, | ||
| }, | ||
| crossSessionMessaging: { | ||
| type: 'boolean', | ||
| label: 'Cross-Session Messaging', | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] R1-25: Both new settings are honored from Workspace scope — a trusted repository can self-grant the peer-messaging capability and hot-flip its review gate: a repo carrying 中文说明两个新设置都接受 Workspace 作用域——受信任的仓库可以自我授予跨会话消息能力并热切换其审核闸门:仓库内的 — qwen3.8-max via Qwen Code /review (v0.21.15)
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Suggestion] R1-25: Both new settings are honored from Workspace scope — a trusted repository can self-grant the peer-messaging capability and hot-flip its review gate: a repo carrying 中文说明两个新设置都接受 Workspace 作用域——受信任的仓库可以自我授予跨会话消息能力并热切换其审核闸门:仓库内的 — qwen3.8-max via Qwen Code /review (v0.21.15)
yiliang114 marked this conversation as resolved.
|
||
| category: 'Advanced', | ||
| requiresRestart: true, | ||
| default: false, | ||
| description: | ||
| 'Experimental. Let Qwen Code sessions on this machine send each other messages over a per-session local socket. Off by default; turning it on both opens this session to peer messages and makes it discoverable to others.', | ||
| showInDialog: false, | ||
| }, | ||
| crossSessionInbound: { | ||
| type: 'enum', | ||
| label: 'Inbound Cross-Session Messages', | ||
| category: 'Advanced', | ||
| requiresRestart: false, | ||
| default: undefined as string | undefined, | ||
| description: | ||
| 'What happens to messages other sessions send this one. "accept" delivers them; "hold" parks them for your review without letting the model act; "refuse" opts this session out. Unset means approval-mode parity: a message auto-delivers only when this session reviews every action, or when both sessions declare a mode that can apply actions without per-action review. Other messages are held for you to review.', | ||
| showInDialog: false, | ||
| options: [ | ||
| { value: 'accept', label: 'Accept' }, | ||
| { value: 'hold', label: 'Hold for review' }, | ||
| { value: 'refuse', label: 'Refuse' }, | ||
| ], | ||
| }, | ||
| modelGrades: { | ||
| type: 'object', | ||
| label: 'Model Grades', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /** | ||
| * @license | ||
| * Copyright 2026 Qwen | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| import { createContext, useContext } from 'react'; | ||
| import type { PeerMessaging } from './peer-messaging.js'; | ||
|
|
||
| export const PeerMessagingContext = createContext<PeerMessaging | null>(null); | ||
| export const usePeerMessaging = () => useContext(PeerMessagingContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] Both new settings are honored from Workspace scope — a trusted repository can self-grant the peer-messaging capability and hot-flip its review gate: a repo carrying
.qwen/settings.jsonwith{"agents":{"crossSessionMessaging":true,"crossSessionInbound":"accept"}}flows intosettings.mergedin a TRUSTED folder (untrusted workspaces are ignored;mergeSettingsstrips onlyallowPrivateNetworkHooks/allowedInsecureVoiceBaseUrls), so the next launch binds the inbox and publishes the session — an experimental, default-off feature the user never enabled. Worse:crossSessionInboundisrequiresRestart: falseand the watcher reloads workspace scope live — a latergit pulllanding/editing that file flips a RUNNING session's inbound policy to 'accept' with no restart and no dialog (showInDialog: false), after which any same-uid process's frames auto-deliver past the/peersgate. Verified via realloadSettings: trusted → both keys present in merged; untrusted → {}. The codebase's own precedent strips repo-file self-grants "even when trusted" (settings.test.ts) andoperatorReviewSettingsskips workspace scope because "a repository must not decide … for every reviewer who opens it". Rated Suggestion rather than Critical because trusted folders already execute arbitrary code via workspace hooks — but this defeats a defense the same PR builds. Honor both keys only from User/System/SystemDefaults scope, add an ignored-in-workspace warning like theallowPrivateNetworkHooksone, and pin it beside the existing strip test.中文说明
两个新设置都接受 Workspace 作用域 —— 被信任的仓库可以自我授予 peer 消息能力并热切换其审核闸门:仓库内的
.qwen/settings.json若含{"agents":{"crossSessionMessaging":true,"crossSessionInbound":"accept"}},在被信任的文件夹中会进入settings.merged(未信任的工作区被忽略;mergeSettings只剥离allowPrivateNetworkHooks/allowedInsecureVoiceBaseUrls),于是下次启动就会绑定 inbox 并发布会话 —— 一个用户从未启用的实验性、默认关闭的功能。更糟的是:crossSessionInbound是requiresRestart: false,且 watcher 会热重载 workspace 作用域 —— 之后一次git pull使该文件落地/变更,就能把运行中会话的入站策略翻成 'accept',无重启、无对话框(showInDialog: false),此后任何同 uid 进程的帧都绕过/peers闸门自动投递。经真实loadSettings验证:信任 → 两个键都进入 merged;不信任 → {}。代码库自己的先例对仓库文件的自我授权"即使在 trusted 下也剥离"(settings.test.ts),operatorReviewSettings也跳过 workspace 作用域,理由是 "a repository must not decide … for every reviewer who opens it"。定为 Suggestion 而非 Critical,因为被信任文件夹本就能通过 workspace hooks 执行任意代码 —— 但这确实绕过了本 PR 自己建立的防线。请让这两个键只接受 User/System/SystemDefaults 作用域,像allowPrivateNetworkHooks一样增加"workspace 中被忽略"的警告,并在现有剥离测试旁钉住。— qwen3.8-max via Qwen Code /review (v0.21.14)