chore: directory migration - gateway→server, web→client/electron
This commit is contained in:
@ -32,7 +32,7 @@
|
||||
*
|
||||
* # 为什么必须共用
|
||||
*
|
||||
* 标记格式是**服务端正则的镜像**(`gateway/internal/handler/rename_proposal.go`)。
|
||||
* 标记格式是**服务端正则的镜像**(`server/internal/handler/rename_proposal.go`)。
|
||||
* 各平台各写一遍拼接,某一处少个空格或把双引号写成单引号,服务端匹配不上 ——
|
||||
* 而失败是静默的:邮件照常发出,提议凭空消失,模型以为自己提过了。
|
||||
*/
|
||||
|
||||
@ -1789,6 +1789,23 @@ export function apply(ctx: any, config: PluginConfig): void {
|
||||
case 'permission_decision':
|
||||
handlePermissionDecision(data);
|
||||
break;
|
||||
case 'session_update': {
|
||||
// 人类在 WebUI 切换权限档位后,DSH 运行时必须立刻更新 sandbox/mode +
|
||||
// approval/policy,否则模型仍按旧档位执行。
|
||||
const sid = String(data?.session_id || '');
|
||||
const pm = String(data?.permission_mode || '');
|
||||
if (sid && pm) {
|
||||
const bound = sessionMap.peek(sid);
|
||||
if (bound) {
|
||||
const live = ctx.agents.get(bound.dshSessionId);
|
||||
if (live?.session) {
|
||||
applyPermissionMode(live.session, pm);
|
||||
console.error(`[dsh-mail-bridge] session_update ${sid} -> 权限档位 ${pm}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 'session_archived':
|
||||
// 会话归档 = 那条会话再也不会收信,映射可以确定性地清掉(不必等上限淘汰)。
|
||||
forgetSession(String(data?.session_id || ''));
|
||||
|
||||
@ -7,7 +7,7 @@ import {
|
||||
} from '../lib/rename-proposal.js';
|
||||
|
||||
// 这一组测试钉住的是「插件拼的标记与服务端正则逐字符对应」。
|
||||
// 服务端那条正则在 gateway/internal/handler/rename_proposal.go:
|
||||
// 服务端那条正则在 server/internal/handler/rename_proposal.go:
|
||||
// <!--\s*agentmail:rename-session\s+alias="([^"]*)"(?:\s+reason="([^"]*)")?\s*-->
|
||||
// 拼错不会报错 —— 邮件照常发出,提议凭空消失。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user