if (!String(sendResult.sessionId || streamSmoke.sessionId || '').startsWith(expectedSessionPrefix)) {
throw new Error('Workspace-entry smoke did not bind the session to the expected project: ' + String(sendResult.sessionId || streamSmoke.sessionId || ''));
}
if (Number(streamSmoke.deltaEventCount || 0) < 1) {
if (!workspaceLaunchAccepted && Number(streamSmoke.deltaEventCount || 0) < 1) {
throw new Error('Workspace-entry smoke did not emit a delta event.');
}
if (Number(sendResult.messageCount || 0) < 2) {
if (!workspaceLaunchAccepted && Number(sendResult.messageCount || 0) < 2) {
throw new Error('Workspace-entry smoke did not persist the expected user/assistant message pair.');
assert(resolvedTarget.autoRouted,"Chat target resolver did not auto-route the default chat request.");
assert(resolvedTarget.sessionState.projectId===xiaohongshu.id,"Chat target resolver did not rebind the request into the Xiaohongshu workspace session.");
assert(resolvedTarget.sessionState.sessionId!==seedSession.id,"Chat target resolver should not reuse the original Douyin session for a Xiaohongshu request.");
assert(resolvedTarget.autoRouted,"Chat target resolver did not auto-route the home chat request.");
assert(resolvedTarget.previousProjectId==="home-chat","Chat target resolver should report home-chat as the previous project.");
assert(resolvedTarget.sessionState.projectId===xiaohongshu.id,"Chat target resolver did not rebind the home chat request into the Xiaohongshu workspace session.");
assert(resolvedTarget.sessionState.sessionId!==homeSession.id,"Chat target resolver should not reuse the original home session for a Xiaohongshu request.");
assert(publisherRoute?.skillId==="xiaohongshu-publisher","Skill router did not choose the Xiaohongshu publisher skill for the existing-draft publish request.");
assert(workspaceEntryDecision.kind==="workspace-entry","Execution router did not prefer workspace-entry for publish intent when a skill was already selected.");
throw new Error('Live run did not produce assistant content.');
}
if (!assistantContent.includes('XHS automation completed.')) {
throw new Error('Live run did not report a completed automation summary. content=' + assistantContent);
if (String(sendResult.selectedSkillId || streamSmoke.selectedSkillId || '')) {
throw new Error('Live run unexpectedly selected a skill instead of workspace-entry: ' + String(sendResult.selectedSkillId || streamSmoke.selectedSkillId || ''));
}
if (assistantContent.includes('Pipeline status: error')) {
throw new Error('Live run reported pipeline failure. content=' + assistantContent);
if (statusLabels.some((label) => label.includes('Routing to skill'))) {
throw new Error('Live run still routed through a skill: ' + JSON.stringify(statusLabels));
}
if (!assistantContent.includes('Submission status: published')) {
throw new Error('Live run did not report a published submission. content=' + assistantContent);
if (!workspaceLaunchAccepted) {
throw new Error('Live run did not expose a workspace-entry launch status: ' + JSON.stringify(statusLabels));