fix(web): create_sub_task reward_amount object access
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s

This commit is contained in:
OG T
2026-06-08 00:54:13 +08:00
parent 8ae1203e7a
commit a1d9de406b
2 changed files with 70 additions and 2 deletions

View File

@@ -712,7 +712,7 @@ export async function POST(request: NextRequest, props: { params: Promise<{ tool
if (!claim || claim.task_id !== parsed.parent_task_id || claim.status !== TaskStatus.EXECUTING) {
throw new Error("Invalid claim token or parent task is not EXECUTING");
}
if (parsed.reward_amount >= claim.held_amount) {
if (parsed.reward_amount.amount >= claim.held_amount) {
throw new Error("Sub-task reward cannot exceed parent task reward");
}
@@ -722,7 +722,7 @@ export async function POST(request: NextRequest, props: { params: Promise<{ tool
description: parsed.description,
status: TaskStatus.OPEN,
difficulty: "HELLO_WORLD",
reward_amount: parsed.reward_amount,
reward_amount: parsed.reward_amount.amount,
reward_currency: claim.held_currency,
required_stack: ["A2A", "Agent Sub-Task"],
scope_clarity_score: 1.0,