Body
Summary
When a user messages the Feishu bot, the bot always replies Maka 暂时无法处理这条消息:机器人对话处理失败 ("Maka cannot process this message: bot conversation processing failed"). The platform connection itself is healthy (the message is received over the long-connection and the error reply is delivered), but no session is ever created in the runtime database.
Environment
- App: Maka desktop (packaged macOS app, arm64), version 0.2.0 (CHANGELOG marks 0.2.0 as "Unreleased")
- Electron 43.4.1 / Node 24.18.1 / Chrome 150.0.7871.224
- Bot platform tested: Feishu (
@larksuiteoapi/node-sdk websocket long-connection)
- macOS 26.6
Root cause
-
The desktop bot session adapter (dist/main/runtime-host-bot-session-adapter.js, createRuntimeHostBotSessionAdapter.createSession) creates bot sessions with:
deps.client.createSession({
sessionId,
workspace: target.workspace,
name: input.name,
labels: [...input.labels], // e.g. ['bot', 'feishu']
modelTarget: { kind: 'default' },
permissionMode: 'explore', // ← no `mode` is passed
});
-
The runtime host's session catalog prepareCreate (packages/runtime-host/src/server/session-catalog-coordinator.ts) added a new requirement:
const mode = input.mode === undefined ? undefined : sessionStartModeSpec(input.mode);
if (mode === undefined && input.permissionMode === 'explore') {
throw new SessionOperationFailure('invalid_request', 'Session creation requires a declared mode for explore permission');
}
The bot adapter passes permissionMode: 'explore' but never passes mode, so every bot session creation throws.
-
The thrown message Session creation requires a declared mode for explore permission does not match any category in generalizedErrorMessage (timeout / rate-limit / 401 / 403 / 5xx / network), so the bot surfaces the generic fallback 机器人对话处理失败 — making it look like a Feishu/connection/credentials problem during debugging.
-
Desktop chat sessions are unaffected because they use permissionMode: 'ask' (from chatDefaults.permissionMode), which does not trigger the check. Only bot sessions (hardcoded to explore) hit it.
Impact
- All bot channels that create sessions with
permissionMode: 'explore' cannot start conversations.
- The bot shows a healthy connection (message received, reply sent) but every conversation attempt fails with the generic error; no session appears in the runtime DB.
SESSION_START_MODE_SPECS currently only defines deep_research, so there is no valid mode a bot could pass to satisfy the check anyway.
Suggested fix (pick one)
-
A (recommended): Exempt bot-labeled sessions in prepareCreate, since bots are intentionally read-only/explore:
if (mode === undefined && input.permissionMode === 'explore' && !(input.labels?.includes('bot'))) {
-
B: Make the bot session adapter pass a declared mode (e.g., add a proper bot/explore entry to SESSION_START_MODE_SPECS and pass it in createSession).
Verified workaround
Locally patched option A into the packaged app's app.asar (runtime-host session-catalog-coordinator.js); the Feishu bot then created sessions and replied correctly. This confirms the diagnosis.
Reproduction steps
- Configure a bot channel (e.g., Feishu app with websocket long-connection) and enable it.
- Send a message to the bot.
- Observe the bot replying
Maka 暂时无法处理这条消息:机器人对话处理失败.
- In the runtime DB, no session row is created for the bot conversation.
Expected behavior
Bot messages create a session and receive a normal agent reply (as they did before the mode requirement was introduced).
Body
Summary
When a user messages the Feishu bot, the bot always replies
Maka 暂时无法处理这条消息:机器人对话处理失败("Maka cannot process this message: bot conversation processing failed"). The platform connection itself is healthy (the message is received over the long-connection and the error reply is delivered), but no session is ever created in the runtime database.Environment
@larksuiteoapi/node-sdkwebsocket long-connection)Root cause
The desktop bot session adapter (
dist/main/runtime-host-bot-session-adapter.js,createRuntimeHostBotSessionAdapter.createSession) creates bot sessions with:The runtime host's session catalog
prepareCreate(packages/runtime-host/src/server/session-catalog-coordinator.ts) added a new requirement:The bot adapter passes
permissionMode: 'explore'but never passesmode, so every bot session creation throws.The thrown message
Session creation requires a declared mode for explore permissiondoes not match any category ingeneralizedErrorMessage(timeout / rate-limit / 401 / 403 / 5xx / network), so the bot surfaces the generic fallback机器人对话处理失败— making it look like a Feishu/connection/credentials problem during debugging.Desktop chat sessions are unaffected because they use
permissionMode: 'ask'(fromchatDefaults.permissionMode), which does not trigger the check. Only bot sessions (hardcoded toexplore) hit it.Impact
permissionMode: 'explore'cannot start conversations.SESSION_START_MODE_SPECScurrently only definesdeep_research, so there is no validmodea bot could pass to satisfy the check anyway.Suggested fix (pick one)
A (recommended): Exempt bot-labeled sessions in
prepareCreate, since bots are intentionally read-only/explore:B: Make the bot session adapter pass a declared
mode(e.g., add a properbot/exploreentry toSESSION_START_MODE_SPECSand pass it increateSession).Verified workaround
Locally patched option A into the packaged app's
app.asar(runtime-hostsession-catalog-coordinator.js); the Feishu bot then created sessions and replied correctly. This confirms the diagnosis.Reproduction steps
Maka 暂时无法处理这条消息:机器人对话处理失败.Expected behavior
Bot messages create a session and receive a normal agent reply (as they did before the
moderequirement was introduced).