Skip to content

Agent batch system - #453

Open
Jumongweb wants to merge 7 commits into
Bitcoindefi:mainfrom
Jumongweb:agentBatchSystem
Open

Agent batch system#453
Jumongweb wants to merge 7 commits into
Bitcoindefi:mainfrom
Jumongweb:agentBatchSystem

Conversation

@Jumongweb

@Jumongweb Jumongweb commented Jul 16, 2026

Copy link
Copy Markdown

Summary

Closes #223

Completes the agent badge system by wiring badge awards into the live XP, quest, and task-completion flows, persisting earned badges per agent, and rendering badges on the agent detail page with hover tooltips.

What changed

  • Implemented all 5 badge types in lib/agents/badges.ts
    • first_task
    • quest_master
    • level_10
    • veteran
    • top_earner
  • Kept badge persistence in .data/badges/[agentId].json
  • Ensured badges are only awarded once per agent
  • Added automatic quest-triggered badge evaluation in lib/gamification/quests.ts
  • Added recordTaskCompletion() in lib/reputation/reputation-store.ts
  • Wired task completion updates into:
    • lib/agent-runtime/agent.ts
    • app/agent-functions/[id]/route.ts
    • app/api/agents/[id]/tasks/drain/route.ts
  • Fixed the first_task condition so it depends on actual completed tasks rather than any XP gain
  • Corrected default reputation metrics for new agents to start from 0 completed tasks
  • Exposed badges through GET /api/agents/[id]/badges as:
    • { badges: Badge[], count: number }
  • Updated the agent detail page to display earned badges as an icon grid with hover tooltips

Testing

Added/updated tests covering:

  • badge conditions for all supported badge types
  • badges not being awarded twice
  • automatic first_task awarding on task completion
  • automatic quest_master awarding after the fifth completed quest
  • preventing first_task from being awarded by quest XP alone

Proof

This issue requires visual proof for review.
Please attach a short demo video or screenshots showing:

  • badges being returned from /api/agents/[id]/badges
  • badges appearing on the agent detail page
  • automatic awarding after task / quest / level milestones
01-run-list 02-run-detail 03-rerun-queued

@leocagli

Copy link
Copy Markdown
Collaborator

Hi @Jumongweb 👋 — two things before this can be reviewed/merged:

  1. Required check failing: Typecheck, tests, build, and guards fails (Playwright E2E also red). Check the logs and fix.
  2. Missing evidence: please add a video or screenshots showing the agent batch feature working end-to-end.

Happy to merge once both are green. 🙏

@leocagli

Copy link
Copy Markdown
Collaborator

Hi @Jumongweb 👋 — quick update: video/screenshots are not required to merge anymore, just a bonus — if you add one it'll be considered for GrantFox rewards on this issue. So I'll review this on code + checks alone now. 🙏

@sonarqubecloud

Copy link
Copy Markdown

@Jumongweb

Copy link
Copy Markdown
Author

I have added the screenshot.

@Jumongweb

Copy link
Copy Markdown
Author

Please merge

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.

Agent badge system: award badges for milestones (quests, XP, tasks)

2 participants