|
4 | 4 | */ |
5 | 5 |
|
6 | 6 | import type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify'; |
| 7 | +import { SYSTEM_TENANT } from '../config.js'; |
7 | 8 | import { sendMessageSchema, commandSchema, permissionRuleSchema, permissionProfileSchema, type PermissionProfile } from '../validation.js'; |
8 | 9 | import type { PermissionPolicy } from '../validation.js'; |
9 | 10 | import { registerPermissionRoutes } from '../permission-routes.js'; |
@@ -54,7 +55,7 @@ export function registerSessionActionRoutes(app: FastifyInstance, ctx: RouteCont |
54 | 55 | } |
55 | 56 | try { |
56 | 57 | const result = acpBackend && config.acpEnabled |
57 | | - ? await acpBackend.sendPrompt(sessionId, text, { tenantId: (req as any).tenantId ?? 'system', ownerKeyId: (req as any).authKeyId ?? 'master' }) |
| 58 | + ? await acpBackend.sendPrompt(sessionId, text, { tenantId: (req as any).tenantId ?? SYSTEM_TENANT, ownerKeyId: (req as any).authKeyId ?? 'master' }) |
58 | 59 | : await sessions.sendMessage(sessionId, text); |
59 | 60 | // Issue #1809: Re-fetch stall info AFTER delivery to avoid false-positive. |
60 | 61 | // Previously we called getStallInfo BEFORE send, capturing a stale state |
@@ -272,7 +273,7 @@ export function registerSessionActionRoutes(app: FastifyInstance, ctx: RouteCont |
272 | 273 | try { |
273 | 274 | const cmd = command.startsWith('/') ? command : `/${command}`; |
274 | 275 | const cmdResult = acpBackend && config.acpEnabled |
275 | | - ? await acpBackend.sendPrompt(session.id, cmd, { tenantId: (req as any).tenantId ?? 'system', ownerKeyId: (req as any).authKeyId ?? 'master' }) |
| 276 | + ? await acpBackend.sendPrompt(session.id, cmd, { tenantId: (req as any).tenantId ?? SYSTEM_TENANT, ownerKeyId: (req as any).authKeyId ?? 'master' }) |
276 | 277 | : await sessions.sendMessage(session.id, cmd); |
277 | 278 | return { ok: true }; |
278 | 279 | } catch (e: unknown) { |
|
0 commit comments