Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions apps/link-service/chaos/run.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ async function bringUp() {
*/
function createProbe(world) {
const pings = [], gaps = [];
let live = null, lastEventAt = 0, stopped = false, timer = null, inFlight = 0, liveReq = null;
let live = null, lastEventAt = 0, openedAt = 0, stopped = false, timer = null, inFlight = 0, liveReq = null;
const port = () => Number(new URL(world.app.origin()).port);
const host = () => world.app.host();
function call(path, { method = "GET", body = null, timeoutMs = 8000, port: at = port(), host: name = host() } = {}) {
Expand Down Expand Up @@ -180,6 +180,7 @@ function createProbe(world) {
res.on("close", () => closed("closed"));
});
liveReq = req;
openedAt = Date.now();
let done = false;
function closed() {
if (done) return;
Expand All @@ -198,7 +199,10 @@ function createProbe(world) {
const up = now - lastEventAt < 5000;
if (!up && downSince === null) downSince = Math.max(lastEventAt, now - 5000);
if (up && downSince !== null) { gaps.push({ from: downSince, to: now }); downSince = null; }
if (liveReq && now - lastEventAt > 20_000 && live) { liveReq.destroy(); }
// as the app does (src/lib/live-events.ts): a dial that sends nothing in LIVE_EVENTS_OPEN_MS (8 s) is dialled again,
// and a stream that went quiet after it sent something is dialled again after 20 s
const quietFor = now - Math.max(lastEventAt, openedAt);
if (liveReq && quietFor > (live ? 20_000 : 8_000)) { liveReq.destroy(); }
}, 250);
return {
start() { timer = setInterval(tick, 500); openLive(); },
Expand Down Expand Up @@ -336,5 +340,6 @@ if (!process.env.DUSK_CHAOS_DIR) {
} else {
process.env.DUSK_CHAOS_PARENT = String(process.pid);
for (const signal of ["SIGINT", "SIGTERM"]) process.on(signal, () => process.exit(130));
main().catch((error) => { console.error(error); process.exit(2); });
// the results are written by then; a socket or timer some scenario left open would otherwise hold the run until CI's job limit
main().then(() => process.exit(process.exitCode ?? 0), (error) => { console.error(error); process.exit(2); });
}
35 changes: 31 additions & 4 deletions apps/link-service/chaos/scenarios.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// things route around it) and answers { clearedAt, pass, note, sees }. run.mjs measures the rest.
import { createHash } from "node:crypto";
import { chmodSync } from "node:fs";
import { Agent as HttpsAgent, request as httpsRequest } from "node:https";
import { join } from "node:path";

import { createTunnelAgent } from "../agent.mjs";
Expand All @@ -27,17 +28,43 @@ async function failover(world, { kill = true } = {}) {
return { pass: moved !== home && moved !== null, note: `moved ${home} -> ${moved} in ${Math.round((workedAt - started) / 1000)} s`, clearedAt: started };
}

/** `count` more servers and apps on the default node, in this process: the agent's and the app's relay code each */
/** a fetch that keeps to one connection of its own. Node's built-in fetch shares one pool for the whole process, and the
* chaos workflow runs without installing packages, so this uses node:https. `close()` ends the connection. */
function fetchOverOwnConnection() {
const agent = new HttpsAgent({ keepAlive: true, maxSockets: 1 });
const ownFetch = (url, { method = "GET", headers = {}, body, signal } = {}) => new Promise((resolve, reject) => {
const request = httpsRequest(url, { method, headers, agent, signal }, (answer) => {
const chunks = [];
answer.on("data", (chunk) => chunks.push(chunk));
answer.on("error", reject);
answer.on("end", () => {
const noBody = [204, 205, 304].includes(answer.statusCode);
const answerHeaders = Object.entries(answer.headers).flatMap(([name, value]) => (Array.isArray(value) ? value.map((one) => [name, one]) : [[name, value]]));
resolve(new Response(noBody ? null : Buffer.concat(chunks), { status: answer.statusCode, headers: answerHeaders }));
});
});
request.on("error", reject);
request.end(body);
});
return { fetch: ownFetch, close: () => agent.destroy() };
}

/** `count` more servers and apps on the default node, in this process: the agent's and the app's relay code each. Each
* sets up its link over its own connection, so the node's front gives it its own address, as `count` machines would have:
* on one connection they would be one address, over the node's limit on new links an address may make in a minute. */
async function crowd(world, count) {
const base = world.url("contabo"), relay = createRelayClient({ base }), out = [];
const base = world.url("contabo"), out = [];
for (let i = 0; i < count; i += 1) {
const own = fetchOverOwnConnection();
const ownFetch = own.fetch;
const keys = newLinkKeys();
const made = await relay.create({ verifier: keys.verifier, appPub: keys.pub });
const made = await createRelayClient({ base, fetch: ownFetch }).create({ verifier: keys.verifier, appPub: keys.pub });
const vps = vpsTokenOf(keys.secret);
const post = (path, body) => fetch(`${base}/v1/sessions/${made.id}/${path}`, { method: "POST", headers: { authorization: `Bearer ${vps}`, "content-type": "application/json" }, body: JSON.stringify(body) });
const post = (path, body) => ownFetch(`${base}/v1/sessions/${made.id}/${path}`, { method: "POST", headers: { authorization: `Bearer ${vps}`, "content-type": "application/json" }, body: JSON.stringify(body) });
await post("claim", {});
const tunnel = { key: randomBytes(32).toString("base64url"), vps: randomBytes(32).toString("base64url"), app: randomBytes(32).toString("base64url") };
const done = await post("result", { sealed: seal(Buffer.alloc(32), made.id, Buffer.from("{}")), vpsPub: keys.pub, tunnel: { vps: sha256hex(tunnel.vps), app: sha256hex(tunnel.app) } });
await own.close();
if (!done.ok) throw new Error(`crowd link ${i} answered ${done.status}`);
const agent = createTunnelAgent({ base, id: made.id, key: tunnel.key, token: tunnel.vps, server: { host: "127.0.0.1", port: world.bot.port }, log: () => {} });
const running = agent.run();
Expand Down
2 changes: 2 additions & 0 deletions apps/site/pages/docs/routines.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ a routine can start from an event instead of a clock:

this needs the app to be [connected](/docs/files-and-apps#connected-apps). gmail is checked every 15 minutes; slack, github and most others arrive at once.

say which events need work: "when a support email arrives, only when a customer asks for a refund, draft it." with a decision model set up (settings → decision and extraction, with your own key), the others start no AI run at all, and the automation's history says why each was skipped. without one, the bot still follows the rule when it runs.

## good routines

- **small and specific beats big and vague.** "flag invoices over €500" works better than "handle my finances".
Expand Down
4 changes: 3 additions & 1 deletion docs/composio.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ message in a channel, a HubSpot deal changing stage. It uses Composio triggers t
3. The server long-polls the queue (`GET /v1/events`, 25 seconds at a time) while it has an automation switched
on. Each event becomes a routine run, with the event fenced as untrusted data. A burst shares runs: at most 3
waiting runs per automation, up to 20 events each. The cursor that acknowledges events moves only after the
run is saved, and a redelivered event is recognised by its id, so each event runs once.
run is saved, and a redelivered event is recognised by its id, so each event runs once. An automation with an
"only when" rule asks the decision model about each event first; only a confident no skips one
(docs/decision-model.md).
4. The server compares its automations with the service at start and every 15 minutes (hourly while all are
paused) and fixes any difference by itself: a lost copy is made again, an unwanted one is removed, on/off is
matched. An expired connection shows as **Needs you** with **Reconnect**.
Expand Down
19 changes: 19 additions & 0 deletions docs/decision-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,20 @@ New rooms start on Auto while the decider and its room job are on. Existing
rooms keep their mode. With Jev off, an Auto room shows a one-line hint and
answers like lead mode.

**Which app events need work.** An app-event automation can carry a rule in
the person's words, "only when a customer asks for a refund" (`only_when` on
the `trigger` tool, `server/app-event-gate.ts`). Before an event starts a run,
the decision model reads the rule and the event, cleaned and clipped to 6,000
characters, and answers yes or no on the `eventGate` seam within 3 seconds.
Only a probability of yes under 0.15 skips the event: it starts no AI run, and
the automation's history lists it as filtered, with the rule as the reason.
Anything else runs, and the run's instructions carry the rule, so the AI still
applies it to an event the model did not judge. The plain filter (from,
subject, label, words) is checked first and costs nothing. Cloud's included
relay does not take this seam yet, so it needs the person's own key. Jev and
Clef return a calibrated probability; an OpenRouter or AI Gateway chat model
writes its own estimate, so with one of those the line is that model's word.

Browser clicks, tool selection and where work runs are listed as "Coming
soon" and have no switch yet.

Expand Down Expand Up @@ -161,6 +175,11 @@ the model to, under OpenRouter's privacy settings and your account's data
policy; dusk bot does not set a data-collection preference. Use Jev, or
leave the job off, for rooms that must not leave the machine.

An app-event automation with an "only when" rule sends each of its events
(cleaned, at most 6,000 characters) and the rule to the same provider. An
automation without a rule sends nothing; removing the rule, or turning the
decision model off, stops it.

## Turning it off

Switch off **Use Jev for fast decisions** (**Use OpenRouter for fast
Expand Down
126 changes: 126 additions & 0 deletions scripts/testing/ci-retry-list.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,132 @@
"owner": "siddharth",
"reason": "Failed once in the 0.2.33 release CI (run 45993068105, ubuntu shard 5 or parallel-threads, a different test each attempt); passes locally on a quiet machine.",
"since": "2026-11-27"
},
{
"file": "server/settings-sync.e2e.test.ts",
"test": "a setting changed in any one place reaches the others, and the last change wins",
"owner": "Yabuku-xD",
"reason": "Failed on Dec 1 in CI of PRs #479 (run 46726301408, all five), #481 (run 46636209589) and #483 (run 46637592516): a loopback request with no forwarding header was answered 403 'this request came through a proxy'. Passed in the other PR runs that day; passes locally (macOS, Node 26) alone, as four copies at once and in its full ubuntu shard 7/8 with 4 workers.",
"since": "2026-12-01"
},
{
"file": "server/settings-sync.e2e.test.ts",
"test": "what belongs to one computer stays there",
"owner": "Yabuku-xD",
"reason": "Failed on Dec 1 in CI of PRs #479 (run 46726301408, all five), #481 (run 46636209589) and #483 (run 46637592516): a loopback request with no forwarding header was answered 403 'this request came through a proxy'. Passed in the other PR runs that day; passes locally (macOS, Node 26) alone, as four copies at once and in its full ubuntu shard 7/8 with 4 workers.",
"since": "2026-12-01"
},
{
"file": "server/settings-sync.e2e.test.ts",
"test": "keys travel only over the person's own links, and a Team Cloud keeps no person's settings",
"owner": "Yabuku-xD",
"reason": "Failed on Dec 1 in CI of PRs #479 (run 46726301408, all five), #481 (run 46636209589) and #483 (run 46637592516): a loopback request with no forwarding header was answered 403 'this request came through a proxy'. Passed in the other PR runs that day; passes locally (macOS, Node 26) alone, as four copies at once and in its full ubuntu shard 7/8 with 4 workers.",
"since": "2026-12-01"
},
{
"file": "server/settings-sync.e2e.test.ts",
"test": "the move to My Cloud and the way home keep settings level",
"owner": "Yabuku-xD",
"reason": "Failed on Dec 1 in CI of PRs #479 (run 46726301408, all five), #481 (run 46636209589) and #483 (run 46637592516): a loopback request with no forwarding header was answered 403 'this request came through a proxy'. Passed in the other PR runs that day; passes locally (macOS, Node 26) alone, as four copies at once and in its full ubuntu shard 7/8 with 4 workers.",
"since": "2026-12-01"
},
{
"file": "server/settings-sync.e2e.test.ts",
"test": "a computer whose bots moved to My Cloud is left as it was, with nothing failing, until they come back",
"owner": "Yabuku-xD",
"reason": "Failed on Dec 1 in CI of PRs #479 (run 46726301408, all five), #481 (run 46636209589) and #483 (run 46637592516): a loopback request with no forwarding header was answered 403 'this request came through a proxy'. Passed in the other PR runs that day; passes locally (macOS, Node 26) alone, as four copies at once and in its full ubuntu shard 7/8 with 4 workers.",
"since": "2026-12-01"
},
{
"file": "server/steer-e2e.test.ts",
"test": "mid-turn steering e2e > a steer the CLI runs as its next native turn keeps the turn, its busy state and its internal tool pass until that reply lands",
"owner": "Yabuku-xD",
"reason": "Failed in CI of PR #477 (run 46623618361, ubuntu shard 8/8) and of the diag/connector-issues branch on Dec 1; passes locally on dev and on #477.",
"since": "2026-12-01"
},
{
"file": "server/drivers/antigravity.test.ts",
"test": "starting Google sign-in again > hands back the same link while it is live, so a code from the first page still completes",
"owner": "Yabuku-xD",
"reason": "Failed in CI of main (run 46580994542), a release (run 46616055192) and PR #478 (run 46623629685) on Dec 1; failed 1 of 3 local runs on one commit.",
"since": "2026-12-01"
},
{
"file": "server/connected-app-tools.e2e.test.ts",
"test": "a bot given Gmail by its app switch reaches gmail.search_emails by name on Claude and on an ACP engine alike",
"owner": "Yabuku-xD",
"reason": "Failed in CI of main (run 46615872847) and PR #478 (run 46623629685) on Dec 1; passes locally on dev.",
"since": "2026-12-01"
},
{
"file": "server/direct-coordination.e2e.test.ts",
"test": "runs the owed direct follow-up while the same bot works in another thread",
"owner": "Yabuku-xD",
"reason": "Failed in CI of PR #478 (run 46623629685) and of fix-app-trigger-restore-enabled (run 46370208019); passed 3 of 3 local runs.",
"since": "2026-12-01"
},
{
"file": "server/index.test.ts",
"test": "harness HTTP API > reports a failed routine once, not twice",
"owner": "Yabuku-xD",
"reason": "Failed in CI of PRs #480 (run 46636190164) and #481 (run 46636209589) on Dec 1, at about 10.7 s; passes locally on dev.",
"since": "2026-12-01"
},
{
"file": "server/setup-connect-card.e2e.test.ts",
"test": "/setup connects an app through a Connect card, against the real server > names the switch, and mounts nothing to call, when the bot's connected apps are off",
"owner": "Yabuku-xD",
"reason": "Failed in CI of PR #479 (run 46636167463) on Dec 1; passes locally on dev, twice.",
"since": "2026-12-01"
},
{
"file": "server/host-lazy-claim.e2e.test.ts",
"test": "lazy host claim and pin on use (issue #1650) > a No is an answer, not a failure: the screen stays untouched and the bot is told to finish another way",
"owner": "Yabuku-xD",
"reason": "Failed in CI of PR #482 (run 46636235332, windows shard 5/8, 'Fixture wait expired') on Dec 1; that PR changes only electron/main.mjs.",
"since": "2026-12-01"
},
{
"file": "server/copilot-engine.e2e.test.ts",
"test": "creates and updates a routine through Copilot's launcher-owned tools",
"owner": "Yabuku-xD",
"reason": "Failed in CI of main (run 46615872847) on Dec 1.",
"since": "2026-12-01"
},
{
"file": "server/usage-trace/recorder.test.ts",
"test": "trace recorder > records 2,000 tool calls in one turn without holding up the event loop",
"owner": "Yabuku-xD",
"reason": "Failed in CI of PR #479 (run 46726301408, ubuntu shard 7/8) on Dec 1 at 53 ms against its 50 ms bound; that PR changes only src/lib/live-events.ts.",
"since": "2026-12-01"
},
{
"file": "server/teammate-follow-ups.e2e.test.ts",
"test": "F4 keeps a second assignment Clive hands Mira in the same turn its own job, though the first is already running",
"owner": "Yabuku-xD",
"reason": "Failed in CI of PR #479 (run 46726301408, ubuntu shard 7/8) on Dec 1 ('the first was running when the second was sent'); that PR changes only src/lib/live-events.ts.",
"since": "2026-12-01"
},
{
"file": "server/drivers/chat-mcp-tools.test.ts",
"test": "Chat MCP shutdown verdict > an unconfirmed shutdown still fails close when a call was in flight",
"owner": "Yabuku-xD",
"reason": "Failed in CI of PR #479 (run 46740020170, ubuntu shard 3/8) on Dec 1 ('Unexpected end of JSON input'); that PR changes only src/lib/live-events.ts. Passes locally.",
"since": "2026-12-01"
},
{
"file": "server/memory-order.e2e.test.ts",
"test": "starts the person's own line ahead of a hand-off that was already waiting for memory, and the hand-off right after",
"owner": "Yabuku-xD",
"reason": "Failed in CI of PR #479 (run 46740020170, ubuntu shard 5/8) on Dec 1; that PR changes only src/lib/live-events.ts. Passes locally.",
"since": "2026-12-01"
},
{
"file": "server/workspace-backup-workflow.test.ts",
"test": "restores an encrypted workspace through the real server and continues its original chat",
"owner": "Yabuku-xD",
"reason": "Failed in CI of PR #479 (run 46740020170, windows shard 5/8) on Dec 1; that PR changes only src/lib/live-events.ts. Passes locally.",
"since": "2026-12-01"
}
]
}
Loading
Loading