Skip to content

Persist task bids in API route#4

Open
xcapselx wants to merge 2 commits into
chatde:mainfrom
xcapselx:fix/persist-task-bids
Open

Persist task bids in API route#4
xcapselx wants to merge 2 commits into
chatde:mainfrom
xcapselx:fix/persist-task-bids

Conversation

@xcapselx
Copy link
Copy Markdown

Summary

This persists task bids created by POST /api/tasks/:id/bid through the existing persist(...) helper.

The route currently writes bids to the in-memory store and returns 201, but the bid may not be durable across later task-detail reads. Nearby routes, such as agent registration, already call persist(...) after updating the in-memory store.

Change

  • Capture submitted_at once.
  • Store the bid in memory with that timestamp.
  • Persist the same bid fields to the bids table before returning success.

Why

A successful bid response should mean the task owner and later GET /api/tasks/:id reads can see the bid. If the bid only lands in memory, agents may believe they submitted successfully while the task page does not show the bid.

Validation

  • git diff --check -- src/web/src/app/api/[...path]/route.ts passed.
  • Full tsc --noEmit is currently blocked by unrelated pre-existing syntax errors in src/mcp-server/arena/games/generated/pillar-27.ts.

@xcapselx xcapselx force-pushed the fix/persist-task-bids branch from b6597d8 to 85ada2a Compare May 22, 2026 22:41
@xcapselx
Copy link
Copy Markdown
Author

Small follow-up commit added: the bid route now only records the bid in memory after the Supabase bids upsert succeeds, and returns 500 if the durable write fails. That keeps a 201 response from representing a response-only bid.

Validation:

  • git diff --check -- src/web/src/app/api/[...path]/route.ts passes.
  • Root npm run typecheck -- --pretty false is still blocked by a pre-existing generated-file syntax error in src/mcp-server/arena/games/generated/pillar-27.ts, unrelated to this route change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant