test: isolate heartbeat workspace

This commit is contained in:
Johnny 2026-01-28 11:12:52 +08:00
parent 63efac0792
commit a03243f016

View File

@ -333,6 +333,7 @@ describe("runHeartbeatOnce", () => {
const cfg: ClawdbotConfig = { const cfg: ClawdbotConfig = {
agents: { agents: {
defaults: { defaults: {
workspace: tmpDir,
heartbeat: { every: "5m", target: "whatsapp" }, heartbeat: { every: "5m", target: "whatsapp" },
}, },
}, },
@ -390,12 +391,14 @@ describe("runHeartbeatOnce", () => {
const cfg: ClawdbotConfig = { const cfg: ClawdbotConfig = {
agents: { agents: {
defaults: { defaults: {
workspace: tmpDir,
heartbeat: { every: "30m", prompt: "Default prompt" }, heartbeat: { every: "30m", prompt: "Default prompt" },
}, },
list: [ list: [
{ id: "main", default: true }, { id: "main", default: true },
{ {
id: "ops", id: "ops",
workspace: tmpDir,
heartbeat: { every: "5m", target: "whatsapp", prompt: "Ops check" }, heartbeat: { every: "5m", target: "whatsapp", prompt: "Ops check" },
}, },
], ],
@ -461,6 +464,7 @@ describe("runHeartbeatOnce", () => {
const cfg: ClawdbotConfig = { const cfg: ClawdbotConfig = {
agents: { agents: {
defaults: { defaults: {
workspace: tmpDir,
heartbeat: { heartbeat: {
every: "5m", every: "5m",
target: "last", target: "last",
@ -542,6 +546,7 @@ describe("runHeartbeatOnce", () => {
const cfg: ClawdbotConfig = { const cfg: ClawdbotConfig = {
agents: { agents: {
defaults: { defaults: {
workspace: tmpDir,
heartbeat: { every: "5m", target: "whatsapp" }, heartbeat: { every: "5m", target: "whatsapp" },
}, },
}, },
@ -597,6 +602,7 @@ describe("runHeartbeatOnce", () => {
const cfg: ClawdbotConfig = { const cfg: ClawdbotConfig = {
agents: { agents: {
defaults: { defaults: {
workspace: tmpDir,
heartbeat: { heartbeat: {
every: "5m", every: "5m",
target: "whatsapp", target: "whatsapp",
@ -668,6 +674,7 @@ describe("runHeartbeatOnce", () => {
const cfg: ClawdbotConfig = { const cfg: ClawdbotConfig = {
agents: { agents: {
defaults: { defaults: {
workspace: tmpDir,
heartbeat: { heartbeat: {
every: "5m", every: "5m",
target: "whatsapp", target: "whatsapp",
@ -737,7 +744,7 @@ describe("runHeartbeatOnce", () => {
try { try {
const cfg: ClawdbotConfig = { const cfg: ClawdbotConfig = {
agents: { agents: {
defaults: { heartbeat: { every: "5m" } }, defaults: { workspace: tmpDir, heartbeat: { every: "5m" } },
list: [{ id: "work", default: true }], list: [{ id: "work", default: true }],
}, },
channels: { whatsapp: { allowFrom: ["*"] } }, channels: { whatsapp: { allowFrom: ["*"] } },