fix: stabilize session tools and tests
This commit is contained in:
@@ -44,11 +44,13 @@ export function createClawdbotTools(options?: {
|
||||
/** Mutable ref to track if a reply was sent (for "first" mode). */
|
||||
hasRepliedRef?: { value: boolean };
|
||||
}): AnyAgentTool[] {
|
||||
const imageTool = createImageTool({
|
||||
const imageTool = options?.agentDir?.trim()
|
||||
? createImageTool({
|
||||
config: options?.config,
|
||||
agentDir: options?.agentDir,
|
||||
agentDir: options.agentDir,
|
||||
sandboxRoot: options?.sandboxRoot,
|
||||
});
|
||||
})
|
||||
: null;
|
||||
const memorySearchTool = createMemorySearchTool({
|
||||
config: options?.config,
|
||||
agentSessionKey: options?.agentSessionKey,
|
||||
|
||||
@@ -703,7 +703,10 @@ describe("runEmbeddedPiAgent", () => {
|
||||
).resolves.toBeTruthy();
|
||||
});
|
||||
|
||||
it("persists the first user message before assistant output", async () => {
|
||||
it(
|
||||
"persists the first user message before assistant output",
|
||||
{ timeout: 15_000 },
|
||||
async () => {
|
||||
const agentDir = await fs.mkdtemp(
|
||||
path.join(os.tmpdir(), "clawdbot-agent-"),
|
||||
);
|
||||
@@ -741,7 +744,8 @@ describe("runEmbeddedPiAgent", () => {
|
||||
if (firstAssistantIndex !== -1) {
|
||||
expect(firstUserIndex).toBeLessThan(firstAssistantIndex);
|
||||
}
|
||||
}, 15_000);
|
||||
},
|
||||
);
|
||||
|
||||
it("persists the user message when prompt fails before assistant output", async () => {
|
||||
const agentDir = await fs.mkdtemp(
|
||||
|
||||
@@ -14,7 +14,10 @@ vi.mock("../commands/models.js", async () => {
|
||||
});
|
||||
|
||||
describe("models cli", () => {
|
||||
it("registers github-copilot login command", async () => {
|
||||
it(
|
||||
"registers github-copilot login command",
|
||||
{ timeout: 15_000 },
|
||||
async () => {
|
||||
const { Command } = await import("commander");
|
||||
const { registerModelsCli } = await import("./models-cli.js");
|
||||
|
||||
@@ -44,5 +47,6 @@ describe("models cli", () => {
|
||||
expect.objectContaining({ yes: true }),
|
||||
expect.any(Object),
|
||||
);
|
||||
}, 15_000);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
@@ -325,7 +325,7 @@ vi.mock("./doctor-state-migrations.js", () => ({
|
||||
describe("doctor", () => {
|
||||
it(
|
||||
"migrates routing.allowFrom to whatsapp.allowFrom",
|
||||
{ timeout: 15_000 },
|
||||
{ timeout: 30_000 },
|
||||
async () => {
|
||||
readConfigFileSnapshot.mockResolvedValue({
|
||||
path: "/tmp/clawdbot.json",
|
||||
|
||||
Reference in New Issue
Block a user