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(ci): restore gateway builds and desktop test runtimes (#7201)

Ezra Elletteb15733e7b1a2
diff --git a/.github/workflows/gateway-e2e.yml b/.github/workflows/gateway-e2e.yml
index 637763b4a..37c3620c1 100644
--- a/.github/workflows/gateway-e2e.yml
+++ b/.github/workflows/gateway-e2e.yml
@@ -40,6 +40,8 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
+ - name: Install D-Bus development library
+ run: sudo apt-get update && sudo apt-get install -y --no-install-recommends pkg-config libdbus-1-dev
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
diff --git a/apps/screenpipe-app-tauri/e2e/wdio.conf.ts b/apps/screenpipe-app-tauri/e2e/wdio.conf.ts
index f955fbacb..1cb8f77f9 100644
--- a/apps/screenpipe-app-tauri/e2e/wdio.conf.ts
+++ b/apps/screenpipe-app-tauri/e2e/wdio.conf.ts
@@ -4,9 +4,9 @@
import type { Options } from '@wdio/types';
import { mkdirSync, rmSync, writeFileSync } from 'node:fs';
+import { createRequire } from 'node:module';
import { resolve, dirname } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';
-import { Agent, setGlobalDispatcher } from 'undici';
import { startApp, stopApp, WEBDRIVER_PORT } from './helpers/app-launcher.js';
import { GatewayRequestProxy } from './helpers/gateway-request-proxy.js';
import { getReporters, getMochaTimeout } from './helpers/reporter-utils.js';
@@ -16,7 +16,12 @@ import { TestRecorder } from './helpers/test-recorder.js';
// WebdriverIO passes the current dispatcher explicitly into every WebDriver
// fetch; that wrapper rejects the explicit `dispatcher` option with
// UND_ERR_INVALID_ARG. E2E only talks to the local Tauri WebDriver server, so use
-// a plain Agent here.
+// a plain Agent here. Resolve WebDriver's own undici: a hoisted v8 Agent
+// rejects the numeric Content-Length sent by WebDriver's v6 fetch.
+const wdioRequire = createRequire(import.meta.resolve('@wdio/cli'));
+const webdriverioRequire = createRequire(wdioRequire.resolve('webdriverio'));
+const webdriverRequire = createRequire(webdriverioRequire.resolve('webdriver'));
+const { Agent, setGlobalDispatcher } = webdriverRequire('undici');
setGlobalDispatcher(new Agent());
const __dirname = dirname(fileURLToPath(import.meta.url));
diff --git a/apps/screenpipe-app-tauri/scripts/webdriver-transport.test.ts b/apps/screenpipe-app-tauri/scripts/webdriver-transport.test.ts
new file mode 100644
index 000000000..e872f77f4
--- /dev/null
+++ b/apps/screenpipe-app-tauri/scripts/webdriver-transport.test.ts
@@ -0,0 +1,55 @@
+// screenpipe — AI that knows everything you've seen, said, or heard
+// https://screenpipe.com
+
+import { expect, test } from "bun:test";
+import { spawnSync } from "node:child_process";
+import { resolve } from "node:path";
+
+test("E2E dispatcher creates and deletes a WebDriver session", () => {
+ // WDIO runs under Node. Bun substitutes its built-in undici shim, which
+ // would hide incompatibilities between the installed dispatcher and fetch.
+ const result = spawnSync("node", ["--import", "tsx", "--input-type=module", "--eval", `
+ import assert from "node:assert/strict";
+ import { createServer } from "node:http";
+ import { remote } from "webdriverio";
+ import { config } from "./e2e/wdio.conf.ts";
+
+ const requests = [];
+ const server = createServer(async (req, res) => {
+ let body = "";
+ for await (const chunk of req) body += chunk;
+ requests.push({ method: req.method, url: req.url, body, length: req.headers["content-length"] });
+ res.setHeader("Content-Type", "application/json");
+ res.end(JSON.stringify({ value: req.method === "POST"
+ ? { sessionId: "transport-check", capabilities: { browserName: "chrome" } }
+ : req.method === "GET" ? "transport-window" : null }));
+ });
+ await new Promise(resolve => server.listen(0, "127.0.0.1", resolve));
+ try {
+ // Import the real config but never invoke its app/recording hooks.
+ const browser = await remote({
+ hostname: config.hostname, path: config.path,
+ port: server.address().port, logLevel: "error",
+ connectionRetryCount: 0, connectionRetryTimeout: 5000,
+ capabilities: config.capabilities[0],
+ });
+ assert.equal(browser.sessionId, "transport-check");
+ await browser.deleteSession();
+ assert.deepEqual(requests.map(({ method, url }) => [method, url]), [
+ ["POST", "/session"], ["GET", "/session/transport-check/window"],
+ ["DELETE", "/session/transport-check"],
+ ]);
+ assert.equal(Number(requests[0].length), Buffer.byteLength(requests[0].body));
+ assert.equal(JSON.parse(requests[0].body).capabilities.alwaysMatch.browserName, "chrome");
+ } finally {
+ server.closeAllConnections();
+ await new Promise(resolve => server.close(resolve));
+ }
+ `], {
+ cwd: resolve(import.meta.dir, ".."),
+ encoding: "utf8",
+ timeout: 15000,
+ });
+ expect({ status: result.status, error: result.error?.message }, result.stdout + result.stderr)
+ .toEqual({ status: 0, error: undefined });
+}, 20000);
diff --git a/crates/screenpipe-core/assets/pi-context-compaction.test.ts b/crates/screenpipe-core/assets/pi-context-compaction.test.ts
index 60e7dc584..7980ab28d 100644
--- a/crates/screenpipe-core/assets/pi-context-compaction.test.ts
+++ b/crates/screenpipe-core/assets/pi-context-compaction.test.ts
@@ -32,7 +32,10 @@ async function harness(options: { steps?: number; enabled?: boolean; failSummary
const settings = sdk.SettingsManager.inMemory({ compaction: { enabled: options.enabled ?? true }, retry: { enabled: false } });
const loader = new sdk.DefaultResourceLoader({ cwd: root, agentDir: root, settingsManager: settings,
noExtensions: true, noSkills: true, noPromptTemplates: true, noThemes: true, noContextFiles: true,
- systemPrompt: "System context. ".repeat(4000) });
+ // systemPrompt probes its input with existsSync before treating it as text.
+ // This 64K fixture overflows Bun 1.2.2's Windows path buffer. Supply the
+ // same context directly so the eval stresses compaction, not path parsing.
+ systemPromptOverride: () => "System context. ".repeat(4000) });
await loader.reload();
const toolCalls: number[] = [];
const { session } = await sdk.createAgentSession({ cwd: root, agentDir: root, modelRuntime: runtime,
diff --git a/crates/screenpipe-gateway/Dockerfile b/crates/screenpipe-gateway/Dockerfile
index 396f152b0..bc3d32b62 100644
--- a/crates/screenpipe-gateway/Dockerfile
+++ b/crates/screenpipe-gateway/Dockerfile
@@ -8,14 +8,19 @@
# docker build -f crates/screenpipe-gateway/Dockerfile .
#
# Runtime choice: debian-slim (glibc) rather than musl-static — the closure
-# has exactly one C dependency (bundled SQLite + sqlite-vec), and sqlite-vec
+# includes bundled SQLite + sqlite-vec, and sqlite-vec
# 0.1.3 does not compile under musl/alpine (cc failure in its extension
# glue). glibc is the toolchain every other screenpipe artifact already
# builds against. A fully-static scratch image is an M5 release-pipeline
# refinement, not a functional need; debian:bookworm-slim is ~75MB and
# gives us ca-certificates (TLS to S3) + curl (compose healthchecks).
+# Database migration recovery uses screenpipe-secrets, whose Linux keyring
+# backend also needs D-Bus at build time and in the runtime image.
FROM rust:1-bookworm AS builder
+RUN apt-get update \
+ && apt-get install -y --no-install-recommends pkg-config libdbus-1-dev \
+ && rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates
@@ -23,7 +28,7 @@ RUN cargo build --locked --release -p screenpipe-gateway --bins
FROM debian:bookworm-slim AS base
RUN apt-get update \
- && apt-get install -y --no-install-recommends ca-certificates curl \
+ && apt-get install -y --no-install-recommends ca-certificates curl libdbus-1-3 \
&& rm -rf /var/lib/apt/lists/* \
# uid/gid PINNED, not left to useradd's "next free system id". The
# customer-facing Fargate template (website