mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 06:40:44 +00:00
test: use synthetic task channel fixtures
This commit is contained in:
@@ -118,7 +118,7 @@ describe("task-flow-registry store runtime", () => {
|
||||
expectedRevision: created.revision,
|
||||
currentStep: "ask_user",
|
||||
stateJson: { phase: "ask_user" },
|
||||
waitJson: { kind: "external_event", topic: "telegram" },
|
||||
waitJson: { kind: "external_event", topic: "forum" },
|
||||
});
|
||||
expect(waiting).toMatchObject({
|
||||
applied: true,
|
||||
@@ -142,7 +142,7 @@ describe("task-flow-registry store runtime", () => {
|
||||
status: "waiting",
|
||||
currentStep: "ask_user",
|
||||
stateJson: { phase: "ask_user" },
|
||||
waitJson: { kind: "external_event", topic: "telegram" },
|
||||
waitJson: { kind: "external_event", topic: "forum" },
|
||||
cancelRequestedAt: 444,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -132,7 +132,7 @@ function createTaskRegistryMaintenanceHarness(params: {
|
||||
|
||||
describe("task-registry maintenance issue #60299", () => {
|
||||
it("marks stale cron tasks lost once the runtime no longer tracks the job as active", async () => {
|
||||
const childSessionKey = "agent:main:slack:channel:test-channel";
|
||||
const childSessionKey = "agent:main:workspace:channel:test-channel";
|
||||
const task = makeStaleTask({
|
||||
runtime: "cron",
|
||||
sourceId: "cron-job-1",
|
||||
@@ -165,7 +165,7 @@ describe("task-registry maintenance issue #60299", () => {
|
||||
});
|
||||
|
||||
it("marks chat-backed cli tasks lost after the owning run context disappears", async () => {
|
||||
const channelKey = "agent:main:slack:channel:C1234567890";
|
||||
const channelKey = "agent:main:workspace:channel:C1234567890";
|
||||
const task = makeStaleTask({
|
||||
runtime: "cli",
|
||||
sourceId: "run-chat-cli-stale",
|
||||
@@ -185,7 +185,7 @@ describe("task-registry maintenance issue #60299", () => {
|
||||
});
|
||||
|
||||
it("keeps chat-backed cli tasks live while the owning run context is still active", async () => {
|
||||
const channelKey = "agent:main:slack:channel:C1234567890";
|
||||
const channelKey = "agent:main:workspace:channel:C1234567890";
|
||||
const task = makeStaleTask({
|
||||
runtime: "cli",
|
||||
sourceId: "run-chat-cli-live",
|
||||
|
||||
@@ -229,10 +229,10 @@ describe("task-registry store runtime", () => {
|
||||
it("preserves requesterSessionKey when it differs from ownerKey across sqlite restore", () => {
|
||||
const created = createTaskRecord({
|
||||
runtime: "cli",
|
||||
requesterSessionKey: "agent:main:slack:channel:C1234567890",
|
||||
requesterSessionKey: "agent:main:workspace:channel:C1234567890",
|
||||
ownerKey: "agent:main:main",
|
||||
scopeKind: "session",
|
||||
childSessionKey: "agent:main:slack:channel:C1234567890",
|
||||
childSessionKey: "agent:main:workspace:channel:C1234567890",
|
||||
runId: "run-requester-session-restore",
|
||||
task: "Reply to channel task",
|
||||
status: "running",
|
||||
@@ -244,9 +244,9 @@ describe("task-registry store runtime", () => {
|
||||
|
||||
expect(findTaskByRunId("run-requester-session-restore")).toMatchObject({
|
||||
taskId: created.taskId,
|
||||
requesterSessionKey: "agent:main:slack:channel:C1234567890",
|
||||
requesterSessionKey: "agent:main:workspace:channel:C1234567890",
|
||||
ownerKey: "agent:main:main",
|
||||
childSessionKey: "agent:main:slack:channel:C1234567890",
|
||||
childSessionKey: "agent:main:workspace:channel:C1234567890",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user