feat: bind AgentBus work to account workers

This commit is contained in:
inman committed 2026-09-02 15:09:07 +08:00
1 parent d034f649c4
commit 6f9fd0f0bd
31 files changed
+1119 -257

No files matched your search

+16 -3
View File
@@ -145,6 +145,11 @@ function publicChannelFixture(overrides: Partial<PublicAgentBusChannel> = {}): P
display_name: '外部用户 A',
external_user_ref: 'external-user-a',
agentbus_bot_address: 'bot:test:listener',
owner_user_id: 'user-a',
owner_username: 'employee-a',
owner_role: 'user',
owner_erp_account: 'ERP-A',
routing_ready: true,
enabled: true,
status: 'disabled',
key_configured: true,
@@ -1199,7 +1204,9 @@ test('durable channel listener persists route and resends accepted/result delive
displayName: '外部用户 A',
wsUrl: 'wss://mesh.nianxx.cn/ws',
wsToken: 'channel-ws-token',
botAddress: 'bot:channel-a:listener'
botAddress: 'bot:channel-a:listener',
ownerUserId: 'user-a',
ownerRole: 'user'
}
});
@@ -1228,6 +1235,8 @@ test('durable channel listener persists route and resends accepted/result delive
await new Promise((resolve) => setTimeout(resolve, 50));
}
assert.equal(receivedContext.channelId, 'channel-1');
assert.equal(receivedContext.userId, 'user-a');
assert.equal(receivedContext.role, 'user');
assert.equal(receivedInput.channelId, 'channel-1');
assert.deepEqual(receivedInput.agentBusRoute, {
inboundFrameId: 'channel-durable-1',
@@ -1399,7 +1408,9 @@ test('durable roster lifecycle assigns the final result only to the attachment f
displayName: '外部用户 A',
wsUrl: 'wss://mesh.nianxx.cn/ws',
wsToken: 'channel-ws-token',
botAddress: 'bot:channel-a:listener'
botAddress: 'bot:channel-a:listener',
ownerUserId: 'user-a',
ownerRole: 'user'
}
});
t.after(() => listener.stop());
@@ -1555,7 +1566,9 @@ test('durable channel persists and sends an attachment rejection result while th
displayName: '外部用户 A',
wsUrl: 'wss://mesh.nianxx.cn/ws',
wsToken: 'channel-ws-token',
botAddress: 'bot:channel-a:listener'
botAddress: 'bot:channel-a:listener',
ownerUserId: 'user-a',
ownerRole: 'user'
},
logger: {
info(metadata, message) {