test: speed up default test env

This commit is contained in:
Peter Steinberger
2026-01-23 18:31:33 +00:00
parent fdc50a0feb
commit 29353e2e81
6 changed files with 22 additions and 13 deletions

View File

@@ -28,6 +28,7 @@ export async function getReplyFromConfig(
opts?: GetReplyOptions,
configOverride?: ClawdbotConfig,
): Promise<ReplyPayload | ReplyPayload[] | undefined> {
const isFastTestEnv = process.env.CLAWDBOT_TEST_FAST === "1";
const cfg = configOverride ?? loadConfig();
const targetSessionKey =
ctx.CommandSource === "native" ? ctx.CommandTargetSessionKey?.trim() : undefined;
@@ -62,7 +63,7 @@ export async function getReplyFromConfig(
const workspaceDirRaw = resolveAgentWorkspaceDir(cfg, agentId) ?? DEFAULT_AGENT_WORKSPACE_DIR;
const workspace = await ensureAgentWorkspace({
dir: workspaceDirRaw,
ensureBootstrapFiles: !agentCfg?.skipBootstrap,
ensureBootstrapFiles: !agentCfg?.skipBootstrap && !isFastTestEnv,
});
const workspaceDir = workspace.dir;
const agentDir = resolveAgentDir(cfg, agentId);
@@ -81,12 +82,14 @@ export async function getReplyFromConfig(
const finalized = finalizeInboundContext(ctx);
await applyMediaUnderstanding({
ctx: finalized,
cfg,
agentDir,
activeModel: { provider, model },
});
if (!isFastTestEnv) {
await applyMediaUnderstanding({
ctx: finalized,
cfg,
agentDir,
activeModel: { provider, model },
});
}
const commandAuthorized = finalized.CommandAuthorized;
resolveCommandAuthorization({