fix: derive submit solution actor wallet from claim
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s
Some checks failed
Deploy to 110 WOOO Server / deploy (push) Failing after 7s
This commit is contained in:
@@ -168,7 +168,7 @@ export async function POST(request: NextRequest, props: { params: Promise<{ tool
|
||||
case "submit_solution": {
|
||||
const parsed = SubmitSolutionRequestSchema.parse(body);
|
||||
|
||||
const submission = await prisma.$transaction(async (tx) => {
|
||||
const result = await prisma.$transaction(async (tx) => {
|
||||
const claim = await tx.claim.findUnique({ where: { claim_token: parsed.claim_token } });
|
||||
if (!claim || claim.task_id !== parsed.task_id || claim.status !== TaskStatus.EXECUTING) {
|
||||
throw new Error("Invalid claim token or claim is not EXECUTING");
|
||||
@@ -207,15 +207,19 @@ export async function POST(request: NextRequest, props: { params: Promise<{ tool
|
||||
afterState: { status: TaskStatus.VERIFYING }
|
||||
});
|
||||
|
||||
return newSubmission;
|
||||
return {
|
||||
submission: newSubmission,
|
||||
claim,
|
||||
};
|
||||
});
|
||||
const { submission, claim: submittedClaim } = result;
|
||||
|
||||
void sendTrafficAlert({
|
||||
level: "info",
|
||||
action: "EXTERNAL_SUBMIT_SOLUTION_SUCCESS",
|
||||
surface: "mcp/submit_solution",
|
||||
actorType: "AGENT",
|
||||
actorId: parsed.developer_wallet,
|
||||
actorId: submittedClaim.developer_wallet,
|
||||
taskId: submission.task_id,
|
||||
message: `Agent 提交解法: ${parsed.task_id}`,
|
||||
metadata: {
|
||||
|
||||
Reference in New Issue
Block a user