fix(support): agent-demo self-seeds (join default queue + go online); tickets always get a queue
Root cause of 'waiting for escalations': no queue/membership meant tickets were never assigned. Now: createTicket find-or-creates a default queue; new joinDefault endpoint + useGoOnline hook; agent-demo joins+goes-AVAILABLE on load (assignPending picks up any waiting ticket). smoke-support self-seeds (no seed script needed). Also: vitest singleFork to end cross-file DB races (45 tests deterministic). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -36,10 +36,16 @@ function waitForMessage(socket, pred, ms = 6000) {
|
||||
}
|
||||
|
||||
const custToken = sign('cust');
|
||||
const agentId = process.env.AGENT_ID ?? 'agent1';
|
||||
const agentToken = sign(agentId);
|
||||
const cust = connect('cust');
|
||||
const agent = connect(process.env.AGENT_ID ?? 'agent1');
|
||||
const agent = connect(agentId);
|
||||
|
||||
try {
|
||||
// Agent self-seeds exactly like the agent-demo does (join default queue + go online).
|
||||
await api('/v1/support/agents/me/join', 'POST', agentToken);
|
||||
await api('/v1/support/members/me/availability', 'PATCH', agentToken, { state: 'AVAILABLE' });
|
||||
|
||||
const { threadId } = await cust.emitWithAck('open_thread', {});
|
||||
await cust.emitWithAck('send_message', { threadId, content: 'my payment failed' });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user