Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): stop routine events from rescanning thread history #7356

Closeddain(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/7356/headopened View on GitHub

Showing 2 changed files with 97 additions and 1 deletion.

x
0 of 2 viewed, 2 left
72 additions and 0 deletionsapps/server/src/orchestration/Layers/ProjectionPipeline.test.tsModified
View file
@@ -174,6 +174,78 @@
assert.equal(row.lastAppliedSequence, 3);
​
+ // Assistant messages and routine activities only update the shell timestamp.
+ // A summary refresh would produce a second projection_threads update.
+ yield* sql`CREATE TABLE thread_shell_update_count (count INTEGER NOT NULL)`;
+ yield* sql`INSERT INTO thread_shell_update_count (count) VALUES (0)`;
+ yield* sql`
+ CREATE TRIGGER count_thread_shell_updates
+ AFTER UPDATE ON projection_threads
+ WHEN NEW.thread_id = 'thread-1'
+ BEGIN
+ UPDATE thread_shell_update_count SET count = count + 1;
+ END;
+ `;
+​
+ yield* eventStore.append({
+ type: "thread.message-sent",
+ eventId: EventId.make("evt-assistant-update"),
+ aggregateKind: "thread",
+ aggregateId: ThreadId.make("thread-1"),
+ occurredAt: "2026-01-01T00:00:00.100Z",
+ commandId: CommandId.make("cmd-assistant-update"),
+ causationEventId: null,
+ correlationId: CommandId.make("cmd-assistant-update"),
+ metadata: {},
+ payload: {
+ threadId: ThreadId.make("thread-1"),
+ messageId: MessageId.make("message-2"),