Skip to content

Commit 73e2489

Browse files
steipetejoshavant
andauthored
test: delete final plugin and UI duplicates (#123214)
* test: delete final plugin and UI duplicates * test(ios): remove duplicate watch reply case * test(nostr): isolate ambient private key Co-authored-by: Josh Avant <[email protected]> --------- Co-authored-by: Josh Avant <[email protected]>
1 parent 00dbf6f commit 73e2489

10 files changed

Lines changed: 22 additions & 314 deletions

File tree

‎apps/ios/Tests/NodeAppModelInvokeTests.swift‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5469,30 +5469,6 @@ private func overrideNotificationServingPreference(_ enabled: Bool) -> () -> Voi
54695469
#expect(reply == "Collected reply")
54705470
}
54715471

5472-
@Test func `watch voice reply accepts terminal message tool mirror`() throws {
5473-
let rawMessages = try [
5474-
makeWatchChatRawMessage(
5475-
role: "user",
5476-
text: "Send the update",
5477-
timestamp: 3000,
5478-
idempotencyKey: "watch-run:user"),
5479-
makeProjectedWatchChatRawMessage(
5480-
role: "assistant",
5481-
text: "Update sent",
5482-
timestamp: 4000,
5483-
serverId: "tool-result-1",
5484-
isMessageToolMirror: true),
5485-
]
5486-
5487-
let reply = WatchChatPresentation.replyText(
5488-
from: rawMessages,
5489-
runID: "watch-run",
5490-
submittedText: "Send the update",
5491-
submittedAtMs: 2500)
5492-
5493-
#expect(reply == "Update sent")
5494-
}
5495-
54965472
@Test func `watch chat completion bounds reply text`() {
54975473
let message = OpenClawWatchChatCompletionMessage(
54985474
commandId: "watch-voice",

‎extensions/memory-core/src/dreaming-phases.test.ts‎

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1517,75 +1517,6 @@ describe("memory-core dreaming phases", () => {
15171517
expect(Object.keys(sessionIngestion.files)).toHaveLength(0);
15181518
});
15191519

1520-
it("skips dreaming transcripts when the session store identifies them before bootstrap lands", async () => {
1521-
const workspaceDir = await createDreamingWorkspace();
1522-
setDreamingTestEnv(path.join(workspaceDir, ".state"));
1523-
await seedDreamingSessionTranscript({
1524-
sessionId: "dreaming-narrative",
1525-
sessionKey: "agent:main:dreaming-narrative-light-1775894400455",
1526-
messages: [
1527-
{
1528-
role: "user",
1529-
timestamp: "2026-04-05T18:01:00.000Z",
1530-
content: [
1531-
{ type: "text", text: "Write a dream diary entry from these memory fragments." },
1532-
],
1533-
},
1534-
{
1535-
role: "assistant",
1536-
timestamp: "2026-04-05T18:02:00.000Z",
1537-
content: [{ type: "text", text: "I drift through the same archive again." }],
1538-
},
1539-
],
1540-
});
1541-
1542-
const { beforeAgentReply } = createHarness(
1543-
{
1544-
agents: {
1545-
defaults: {
1546-
workspace: workspaceDir,
1547-
},
1548-
list: [{ id: "main", workspace: workspaceDir }],
1549-
},
1550-
plugins: {
1551-
entries: {
1552-
"memory-core": {
1553-
config: {
1554-
dreaming: {
1555-
enabled: true,
1556-
phases: {
1557-
light: {
1558-
enabled: true,
1559-
limit: 20,
1560-
lookbackDays: 7,
1561-
},
1562-
},
1563-
},
1564-
},
1565-
},
1566-
},
1567-
},
1568-
},
1569-
workspaceDir,
1570-
);
1571-
1572-
try {
1573-
await beforeAgentReply(
1574-
{ cleanedBody: "__openclaw_memory_core_light_sleep__" },
1575-
{ trigger: "heartbeat", workspaceDir },
1576-
);
1577-
} finally {
1578-
restoreDreamingTestEnv();
1579-
}
1580-
1581-
await expectPathMissing(
1582-
path.join(workspaceDir, "memory", ".dreams", "session-corpus", "2026-04-05.txt"),
1583-
);
1584-
1585-
const sessionIngestion = await dreamingTestState.readSessionIngestionState(workspaceDir);
1586-
expect(Object.keys(sessionIngestion.files)).toHaveLength(0);
1587-
});
1588-
15891520
it("skips isolated cron run transcripts during session ingestion", async () => {
15901521
const workspaceDir = await createDreamingWorkspace();
15911522
setDreamingTestEnv(path.join(workspaceDir, ".state"));

‎extensions/nostr/src/channel.test.ts‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,21 @@ const nostrTestPlugin = {
114114

115115
const nostrConfigure = createPluginSetupWizardConfigure(nostrTestPlugin);
116116

117+
function withoutNostrPrivateKey<T>(run: () => T): T {
118+
const hadValue = Object.hasOwn(process.env, "NOSTR_PRIVATE_KEY");
119+
const previous = process.env.NOSTR_PRIVATE_KEY;
120+
delete process.env.NOSTR_PRIVATE_KEY;
121+
try {
122+
return run();
123+
} finally {
124+
if (hadValue && previous !== undefined) {
125+
process.env.NOSTR_PRIVATE_KEY = previous;
126+
} else {
127+
delete process.env.NOSTR_PRIVATE_KEY;
128+
}
129+
}
130+
}
131+
117132
function requireNostrLooksLikeId() {
118133
const looksLikeId = nostrTestPlugin.messaging?.targetResolver?.looksLikeId;
119134
if (!looksLikeId) {
@@ -210,7 +225,7 @@ describe("nostrPlugin", () => {
210225
describe("config adapter", () => {
211226
it("listAccountIds returns empty array for unconfigured", () => {
212227
const cfg = { channels: {} };
213-
const ids = nostrTestPlugin.config.listAccountIds(cfg);
228+
const ids = withoutNostrPrivateKey(() => nostrTestPlugin.config.listAccountIds(cfg));
214229
expect(ids).toStrictEqual([]);
215230
});
216231

@@ -447,12 +462,12 @@ describe("nostr account helpers", () => {
447462
describe("listNostrAccountIds", () => {
448463
it("returns empty array when not configured", () => {
449464
const cfg = { channels: {} };
450-
expect(listNostrAccountIds(cfg)).toStrictEqual([]);
465+
expect(withoutNostrPrivateKey(() => listNostrAccountIds(cfg))).toStrictEqual([]);
451466
});
452467

453468
it("returns empty array when nostr section exists but no privateKey", () => {
454469
const cfg = { channels: { nostr: { enabled: true } } };
455-
expect(listNostrAccountIds(cfg)).toStrictEqual([]);
470+
expect(withoutNostrPrivateKey(() => listNostrAccountIds(cfg))).toStrictEqual([]);
456471
});
457472

458473
it("returns default when privateKey is configured", () => {
@@ -503,7 +518,7 @@ describe("nostr account helpers", () => {
503518

504519
it("resolves unconfigured account with defaults", () => {
505520
const cfg = { channels: {} };
506-
const account = resolveNostrAccount({ cfg });
521+
const account = withoutNostrPrivateKey(() => resolveNostrAccount({ cfg }));
507522

508523
expect(account.accountId).toBe("default");
509524
expect(account.enabled).toBe(true);
@@ -602,7 +617,9 @@ describe("nostr account helpers", () => {
602617
throw new Error("nostr setup credential inspect missing");
603618
}
604619

605-
expect(credential.inspect({ cfg, accountId: "default" })).toEqual({
620+
expect(
621+
withoutNostrPrivateKey(() => credential.inspect({ cfg, accountId: "default" })),
622+
).toEqual({
606623
accountConfigured: false,
607624
hasConfiguredValue: true,
608625
resolvedValue: undefined,

‎extensions/oc-path/src/oc-path/tests/scenarios/malformed-input.test.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ describe("malformed-input", () => {
2020
expect(() => parseMd("---\n")).not.toThrow();
2121
});
2222

23-
it("only `---\\n---`", () => {
24-
const { ast } = parseMd("---\n---");
25-
expect(ast.frontmatter).toEqual([]);
26-
});
27-
2823
it("binary-ish bytes (non-ASCII control chars)", () => {
2924
const raw = "## H\n\x00\x01\x02\n";
3025
expect(() => parseMd(raw)).not.toThrow();

‎extensions/oc-path/src/oc-path/tests/scenarios/oc-path-parse-edges.test.ts‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ function expectErr(fn: () => unknown, code: string): void {
1313
}
1414

1515
describe("oc-path-parse-edges", () => {
16-
it("file-only", () => {
17-
expect(parseOcPath("oc://SOUL.md")).toEqual({ file: "SOUL.md" });
18-
});
19-
2016
it("file + section", () => {
2117
expect(parseOcPath("oc://SOUL.md/Boundaries").section).toBe("Boundaries");
2218
});

‎extensions/oc-path/src/oc-path/tests/scenarios/sentinel-cross-kind.test.ts‎

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -37,49 +37,6 @@ describe("sentinel guard cross-kind", () => {
3737
expect(() => emitMd(ast, { acceptPreExistingSentinel: false })).toThrow(OcEmitSentinelError);
3838
});
3939

40-
it("jsonc render mode walks every leaf for sentinel", () => {
41-
const ast = parseJsonc('{ "x": "ok" }').ast;
42-
const tampered = {
43-
...ast,
44-
root: {
45-
kind: "object" as const,
46-
entries: [
47-
{
48-
key: "x",
49-
line: 1,
50-
value: { kind: "string" as const, value: REDACTED_SENTINEL },
51-
},
52-
],
53-
},
54-
};
55-
expect(() => emitJsonc(tampered, { mode: "render" })).toThrow(OcEmitSentinelError);
56-
});
57-
58-
it("jsonl render mode walks every value-line leaf", () => {
59-
const ast = parseJsonl('{"a":"ok"}\n').ast;
60-
const tampered = {
61-
...ast,
62-
lines: [
63-
{
64-
kind: "value" as const,
65-
line: 1,
66-
raw: '{"a":"ok"}',
67-
value: {
68-
kind: "object" as const,
69-
entries: [
70-
{
71-
key: "a",
72-
line: 1,
73-
value: { kind: "string" as const, value: REDACTED_SENTINEL },
74-
},
75-
],
76-
},
77-
},
78-
],
79-
};
80-
expect(() => emitJsonl(tampered, { mode: "render" })).toThrow(OcEmitSentinelError);
81-
});
82-
8340
it("jsonc edits reject caller-injected sentinels before mutation", () => {
8441
const ast = parseJsonc('{ "x": "ok" }').ast;
8542
expect(() =>

‎extensions/oc-path/src/oc-path/tests/scenarios/sentinel-guard.test.ts‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,6 @@ describe("sentinel-guard", () => {
3434
);
3535
});
3636

37-
it("error attaches the OcPath context", () => {
38-
try {
39-
guardSentinel(REDACTED_SENTINEL, "oc://config/plugins.entries.foo.token");
40-
expect.fail("should have thrown");
41-
} catch (err) {
42-
expect(err).toBeInstanceOf(OcEmitSentinelError);
43-
const e = err as OcEmitSentinelError;
44-
expect(e.path).toBe("oc://config/plugins.entries.foo.token");
45-
expect(e.code).toBe("OC_EMIT_SENTINEL");
46-
}
47-
});
48-
4937
it("round-trip echoes pre-existing sentinel; strict mode rejects", () => {
5038
const raw = "## Section\n\n- token: __OPENCLAW_REDACTED__\n";
5139
const { ast } = parseMd(raw);

‎extensions/signal/src/monitor/event-handler.inbound-context.test.ts‎

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -713,48 +713,6 @@ describe("signal createSignalEventHandler inbound context", () => {
713713
}
714714
});
715715

716-
it("uses the curated Signal soft-stall emoji for hard stalls", async () => {
717-
vi.useFakeTimers();
718-
let releaseDispatch!: () => void;
719-
try {
720-
dispatchInboundMessageMock.mockImplementationOnce(
721-
async (params: DispatchInboundMessageMockParams) => {
722-
capture.ctx = params.ctx;
723-
await new Promise<void>((resolve) => {
724-
releaseDispatch = resolve;
725-
});
726-
return { queuedFinal: false, counts: { tool: 0, block: 0, final: 1 } };
727-
},
728-
);
729-
const handler = createTestHandler({
730-
cfg: createStatusReactionConfig({
731-
messages: {
732-
statusReactions: { enabled: true, timing: { ...shortStatusReactionTiming } },
733-
},
734-
}),
735-
statusReactionTiming: { ...shortStatusReactionTiming },
736-
});
737-
738-
const handled = receiveDirectMessage(handler);
739-
await vi.advanceTimersByTimeAsync(0);
740-
await vi.advanceTimersByTimeAsync(15_000);
741-
742-
let sentEmojis = sentReactionEmojis();
743-
expect(sentEmojis).toContain("⏳");
744-
expect(sentEmojis).not.toContain("⚠️");
745-
746-
releaseDispatch();
747-
await handled;
748-
await vi.advanceTimersByTimeAsync(0);
749-
750-
sentEmojis = sentReactionEmojis();
751-
expect(sentEmojis).toContain("✅");
752-
expect(sentEmojis.at(-1)).toBe("👀");
753-
} finally {
754-
vi.useRealTimers();
755-
}
756-
});
757-
758716
it("restores the initial Signal ack reaction after a successful reply", async () => {
759717
dispatchInboundMessageMock.mockImplementationOnce(
760718
async (params: DispatchInboundMessageMockParams) => {

‎extensions/twitch/src/access-control.test.ts‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,6 @@ describe("checkTwitchAccessControl", () => {
8686
expect(result.reason).toContain(params.reason);
8787
}
8888

89-
describe("when no restrictions are configured", () => {
90-
it("allows messages that mention the bot (default requireMention)", async () => {
91-
const result = await runAccessCheck({
92-
message: {
93-
message: "@testbot hello",
94-
},
95-
});
96-
expect(result.allowed).toBe(true);
97-
});
98-
});
99-
10089
describe("requireMention default", () => {
10190
it("defaults to true when undefined", async () => {
10291
const result = await runAccessCheck({

0 commit comments

Comments
 (0)