fix(discord): make the table separator test linear, record a posted message only after it posts, say which CLIs raise a turn end

This commit is contained in:
Devvyn committed 2026-10-30 21:28:35 +08:00
1 parent e5d82eb044
commit 021641911e
9 files changed
+97 -32

No files matched your search

+4 -2
View File
@@ -3134,13 +3134,15 @@ export class WebServer extends EventEmitter {
* segmented into turns for the CLIs that keep none); undefined for a shell, which has no turns, and the
* screen tail stands in whenever the reader finds nothing.
*/
private async discordFullText(session: Session): Promise<string | undefined> {
private async discordFullText(session: Session): Promise<{ text: string; version?: string } | undefined> {
if (!this.lastResponseFor) return undefined;
// A CLI with a transcript reader, or whose pane the viewer segments into turns; a shell has neither.
if (getCli(session.mode)?.capabilities.transcript === 'none' && !isExternalCliTranscriptMode(session.mode)) {
return undefined;
}
return (await this.lastResponseFor(session)).text;
const r = await this.lastResponseFor(session);
// The turn it came from: the transcript's stamp, else when the person last submitted (a pane has no stamp).
return { text: r.text, version: r.timestamp || String(session.lastSubmitAt ?? '') };
}
/** The notification body for an event (shared by Web Push and the webhook channel). */