dinil balasuriya/ projects / loopback

2nd, agent forge mini hackathon3 jul 2026

loopback

an agent that turns a support inbox into tickets and a draft pull request.

  1. 01the inbox15 seeded emails written to form clusters, plus two that should not become tickets.
  2. 02read everythinglist_inbox once, then read_email for each one.
  3. 03group and ranksimilar complaints become one cluster. 3 or more reports of a bug makes it p0.
  4. 04ticketscreate_ticket for each cluster: bug, feature or question.
  5. 05a draft fixcreate_github_pr for the top p0 bug. simulated: the link is generated, nothing is opened on github.
  6. 06reportfinalize_report. every tool call streams to the screen as it happens.
01 / story
  • eventagent forge mini hackathon
  • when3 jul 2026
  • built in1 hour
agent forge mini hackathon, 3 jul: 2nd
agent forge mini hackathon, 3 jul: 2nd

every support inbox hides the roadmap. the same bug gets reported five times, handled five times, and nobody joins the dots.

loopback reads the inbox, groups the complaints, ranks them, and drafts the fix.

we had about an hour at the agent forge mini hackathon in san francisco, on 3 jul 2026.

the demo run reads 15 sample emails, makes tickets for the clusters, and proposes a pull request for the worst bug.

the hard part was making the agent's work visible: every tool call streams to the screen, so you watch it read, group and ticket in real time.

02 / how it works
  • an agent built on the OpenAI Agents SDK (TypeScript), hosted on Tencent EdgeOne Makers, with five tools: list_inbox, read_email, create_ticket, create_github_pr, finalize_report (agents/_tools.ts).
  • the system prompt fixes the workflow: list the inbox once, read every email, cluster similar ones, one ticket per cluster, P0 for a bug reported by 3 or more people, a draft PR for the top P0 bug, then a summary report (agents/chat/index.ts).
  • each tool call, with its arguments, streams to the browser over server-sent events, so the interface shows a live read cursor, ticket cards and a PR card as they happen.
  • the frontend is React, Vite and TypeScript: a two-panel dashboard (inbox on one side, tickets and PR on the other) with tickets colour-coded as bug, feature or question.
  • the demo inbox is 15 seeded emails written to form clusters (a Safari login bug, dark mode requests, slow CSV export, pricing questions) plus two that should not become tickets (agents/_inbox.ts).
  • it talks to any OpenAI-compatible model endpoint through environment variables; the default is DeepSeek V4 Flash via the EdgeOne gateway.
  • honest scope: the inbox is seeded and the pull request is a simulated draft (the PR link is generated, not opened on GitHub). real Gmail and GitHub integration are listed in the readme as post-hackathon work.
03 / numbers
  • built in about 1 hour
  • about 15seconds per run on the demo inbox
  • 15seeded emails, 5 agent tools
  • about 1,470lines of TypeScript across agents/ and src/ (excluding styles and the starter's cloud functions)
  • 5commits, 3 to 7 jul 2026, three authors including the starter template