evolclaw 2.7.1 → 2.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -207,8 +207,11 @@ export class AgentRunner {
207
207
  return this.handleAskUserQuestionFallback(input, questions);
208
208
  }
209
209
  const answers = {};
210
- // 闭包捕获当前 sendPromptFn,避免异步等待期间被其他会话覆盖
211
- const sendPrompt = this.sendPromptFn;
210
+ // permCtx 构造 per-session 的发送函数,避免全局 sendPromptFn 被其他 channel 实例覆盖
211
+ // 注意:sendPromptFn 是全局单例,多 channel 并发时会被覆盖,导致提示发到错误 channel
212
+ const sendPrompt = permCtx.adapter && permCtx.channelId
213
+ ? async (text) => permCtx.adapter.sendText(permCtx.channelId, text, permCtx.replyContext)
214
+ : this.sendPromptFn;
212
215
  // 逐个 question 发送卡片并等待用户选择
213
216
  for (let i = 0; i < questions.length; i++) {
214
217
  const q = questions[i];
@@ -328,7 +331,10 @@ export class AgentRunner {
328
331
  */
329
332
  async handleExitPlanMode(sessionId, input, options) {
330
333
  const permCtx = this.permissionContexts.get(sessionId);
331
- const sendPrompt = this.sendPromptFn;
334
+ // permCtx 构造 per-session 的发送函数,避免全局 sendPromptFn 被其他 channel 实例覆盖
335
+ const sendPrompt = permCtx?.adapter && permCtx?.channelId
336
+ ? async (text) => permCtx.adapter.sendText(permCtx.channelId, text, permCtx.replyContext)
337
+ : this.sendPromptFn;
332
338
  // 无交互上下文,直接 allow(防御性兜底)
333
339
  if (!permCtx?.adapter?.sendInteraction || !permCtx?.channelId || !sendPrompt) {
334
340
  return { behavior: 'allow', updatedInput: input, decisionClassification: 'user_temporary' };
@@ -1,3 +1,4 @@
1
+ import { DEFAULT_PERMISSION_MODE } from '../types.js';
1
2
  import { hasModelSwitcher, hasPermissionController } from '../agents/claude-runner.js';
2
3
  import { saveConfig, resolvePaths, getPackageRoot, getOwner, getChannelShowActivities, setChannelShowActivities } from '../config.js';
3
4
  import { logger } from '../utils/logger.js';
@@ -555,7 +556,7 @@ export class CommandHandler {
555
556
  // guest 在群聊和私聊中均可访问的只读命令:纯查询形态(带参写操作由各 handler 内部守卫拦截)
556
557
  const guestGroupCommands = [
557
558
  '/status', '/help', '/check', '/chatmode',
558
- '/model', '/effort', '/agent', '/perm', '/activity', '/safe',
559
+ '/model', '/effort', '/agent', '/perm', '/activity', '/safe', '/stop',
559
560
  ];
560
561
  const userCommands = activeChatType === 'group' && !isAdmin
561
562
  ? guestGroupCommands
@@ -708,8 +709,7 @@ export class CommandHandler {
708
709
  if (!hasPermissionController(permAgent)) {
709
710
  return '❌ 权限控制不可用';
710
711
  }
711
- const defaultPermMode = identity.role === 'owner' ? 'bypass' : 'auto';
712
- const currentMode = permSession.metadata?.permissionMode ?? defaultPermMode;
712
+ const currentMode = permSession.metadata?.permissionMode ?? DEFAULT_PERMISSION_MODE;
713
713
  const modes = permAgent.listModes();
714
714
  // 尝试发送交互卡片
715
715
  if (this.interactionRouter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evolclaw",
3
- "version": "2.7.1",
3
+ "version": "2.7.3",
4
4
  "description": "Lightweight AI Agent gateway connecting Claude Agent SDK to messaging channels (Feishu, ACP) with multi-project session management",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",