Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(e2e): wire __e2ePiPromptCaptures hook in standalone-chat.tsx

Louis Beaumontd2d550e46923
diff --git a/apps/screenpipe-app-tauri/components/standalone-chat.tsx b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
index 83c6841ef..a348ea84b 100644
--- a/apps/screenpipe-app-tauri/components/standalone-chat.tsx
+++ b/apps/screenpipe-app-tauri/components/standalone-chat.tsx
@@ -6417,6 +6417,18 @@ export function StandaloneChat({
queuedPrompt = `<conversation_history>\n${historyLines}\n</conversation_history>\n\n${userMessage}`;
}
+ // E2E test hook — capture queued prompts for context-loss assertions
+ {
+ const g = window as any;
+ if (Array.isArray(g.__e2ePiPromptCaptures)) {
+ g.__e2ePiPromptCaptures.push({
+ sessionId: piSessionIdRef.current,
+ message: queuedPrompt,
+ at: Date.now(),
+ });
+ }
+ }
+
try {
const result = await commands.piQueuePrompt(
piSessionIdRef.current,
@@ -6780,6 +6792,18 @@ export function StandaloneChat({
}
piSessionSyncedRef.current = true;
+ // E2E test hook — write to __e2ePiPromptCaptures when the recorder is installed
+ {
+ const g = window as any;
+ if (Array.isArray(g.__e2ePiPromptCaptures)) {
+ g.__e2ePiPromptCaptures.push({
+ sessionId: piSessionIdRef.current,
+ message: promptMessage,
+ at: Date.now(),
+ });
+ }
+ }
+
// Send prompt — abort/new_session now await completion, so no retry needed
let result = await commands.piPrompt(
piSessionIdRef.current,