Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/recoup/fetchTask.ts
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@recoup-coding-agent add tests for TDD red green refactor.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { logger } from "@trigger.dev/sdk/v3";
import { z } from "zod";
import { NEW_API_BASE_URL } from "../consts";
import { type ChatConfig } from "../schemas/chatSchema";
import { logStep } from "../sandboxes/logStep";

// Zod schema for validating task response from Recoup Tasks API
const taskResponseSchema = z.object({
Expand Down Expand Up @@ -74,6 +75,11 @@ export async function fetchTask(
return undefined;
}

if (task.enabled === false) {
logStep("Task is disabled, skipping", false, { externalId });
return undefined;
}

// Map task data to task config format
return {
prompt: task.prompt,
Expand Down