fix: channelId extraction, sender identification, and per-channel turn order #9

Merged
hzhang merged 18 commits from fix/turn-gate-and-handoff into main 2026-03-01 11:12:18 +00:00
Showing only changes of commit 385990ab90 - Show all commits

View File

@@ -607,8 +607,9 @@ export default {
} }
} }
// Turn-based check: if channel has turn order, only current speaker can respond // Turn-based check: ALWAYS check turn order regardless of evaluateDecision result.
if (!rec.decision.shouldUseNoReply && derived.channelId) { // This ensures only the current speaker can respond even for human messages.
if (derived.channelId) {
ensureTurnOrder(api, derived.channelId); ensureTurnOrder(api, derived.channelId);
const accountId = resolveAccountId(api, ctx.agentId || ""); const accountId = resolveAccountId(api, ctx.agentId || "");
if (accountId) { if (accountId) {