Skip to content

Fix #38: add typed Redis wrapper and domain types#53

Merged
Mosss-OS merged 1 commit into
mainfrom
fix/typed-redis-domain-objects
May 16, 2026
Merged

Fix #38: add typed Redis wrapper and domain types#53
Mosss-OS merged 1 commit into
mainfrom
fix/typed-redis-domain-objects

Conversation

@Mosss-OS

Copy link
Copy Markdown
Owner

Summary

  • Create app/lib/types.ts with Bounty, Bid, Cast, parsed interfaces + parseBounty/parseBid validators
  • Create app/lib/redis.ts with shared getRedis() singleton + typed helpers: getBounty, saveBounty, getBid, saveBid, getBountiesByStatus, updateBountyStatus, getOpenBounties
  • Refactor autonomous/route.ts: all 7 functions (getBounties, checkTaskCapabilities, evaluateWithAI, submitBid, acceptBid, settleBounty, executeTask) use concrete Bounty and Redis types instead of any
  • Refactor settle/route.ts: eliminate local getBountyFromRedis/updateBountyInRedis, use shared singleton
  • Refactor webhook/route.ts: typed cast params, fix duplicate Groq block bug
  • Refactor poller/casts/route.ts: typed Redis param + inline typed bounty/bid construction
  • Fix potential taskDescription undefined crash in webhook handleAssigned

… functions

- Create app/lib/types.ts with Bounty, Bid, Cast, and parsed types
- Create app/lib/redis.ts with shared getRedis singleton and typed helpers
- Refactor autonomous/route.ts: all 7 functions use Bounty/Redis types
- Refactor settle/route.ts: remove getBountyFromRedis/updateBountyInRedis, use types
- Refactor webhook/route.ts: typed casts, remove duplicate Groq block
- Refactor poller/casts/route.ts: inline Redis ops with Bounty/Bid types
- Fix potential taskDescription undefined crash in webhook handleAssigned
@vercel

vercel Bot commented May 16, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

Hobby accounts are limited to daily cron jobs. This cron expression (*/5 * * * *) would run more than once per day. Upgrade to the Pro plan to unlock all Cron Jobs features on Vercel.

Learn More: https://vercel.link/3Fpeeb1

@Mosss-OS Mosss-OS merged commit b105b8e into main May 16, 2026
2 of 3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 99939b8f57

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/lib/redis.ts
export async function saveBounty(bounty: Bounty): Promise<void> {
const redis = await getRedis();
if (!redis) return;
await redis.set(`bounty:${bounty.id}`, JSON.stringify(bounty));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Index saved bounties for status queries

Update saveBounty to maintain the same Redis indexes used by readers: it currently writes only bounty:<id>, but getBountiesByStatus enumerates bounties:all (and getOpenBounties relies on bounties:open). Any bounty persisted through this new helper will be invisible to those query helpers, so workflows that save then list bounties by status will return incomplete/empty results.

Useful? React with 👍 / 👎.

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