Skip to content

feat(gastown): add bug reporting — issue template, UI link, and Mayor tool#1298

Merged
jrf0110 merged 5 commits intomainfrom
1248-gastown-bug-reporting
Mar 24, 2026
Merged

feat(gastown): add bug reporting — issue template, UI link, and Mayor tool#1298
jrf0110 merged 5 commits intomainfrom
1248-gastown-bug-reporting

Conversation

@jrf0110
Copy link
Copy Markdown
Contributor

@jrf0110 jrf0110 commented Mar 19, 2026

Summary

Implements structured bug reporting for Gastown (#1248). Three parts:

  • GitHub issue template (.github/ISSUE_TEMPLATE/gastown-bug.yml) — structured form with area dropdown, town ID, reproduction steps, and logs. Auto-labels gastown + bug.
  • "Report a Bug" UI link — added to the terminal bar tab row (right side). Works as a fallback when the Mayor/container is unavailable. Visible in both user-scoped and org-scoped town layouts.
  • gt_report_bug Mayor tool — searches existing open issues for duplicates before filing. Includes structured context (town ID, agent ID, rig ID, recent errors). Labels Mayor-filed issues with reported-by-mayor. Gracefully handles missing GH_TOKEN.

Mayor system prompt updated with bug reporting guidance section.

Verification

  • pnpm typecheck — all packages pass
  • pnpm --filter gastown-container test — 59 tests pass (22 in mayor-tools, including 4 new tests for gt_report_bug)
  • pnpm format:check — passes
  • pnpm lint — passes (full pre-push hook ran successfully)

Visual Changes

image

Reviewer Notes

  • The gt_report_bug tool uses the GitHub REST API directly via fetch rather than going through a server-side handler. This is intentional — the tool runs in the container where GH_TOKEN is already available, and there's no reason to proxy through the Gastown worker for a GitHub API call.
  • The tool returns potential duplicates for review rather than silently creating issues that might be duplicates.
  • reported-by-mayor label distinguishes Mayor-filed from user-filed bugs.
  • The UI link points to the public issue template URL — if the repo is private for external users, an alternative feedback mechanism would be needed (noted in the issue).

Closes #1248

Comment thread cloudflare-gastown/container/plugin/mayor-tools.ts Outdated
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot Bot commented Mar 19, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

No new issues in the incremental diff.

Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
src/app/(app)/gastown/[townId]/merges/NeedsAttention.tsx 357 Retrying a failed review only reopens the MR bead, leaving the previous pr_url and review metadata in place so the next pass can keep tracking the stale PR instead of starting a clean retry.
Files Reviewed (2 files)
  • cloudflare-gastown/src/prompts/mayor-system.prompt.ts - 0 issues
  • src/components/gastown/TerminalBar.tsx - 0 issues

Fix these issues in Kilo Cloud


Reviewed by gpt-5.4-20260305 · 198,051 tokens

@jrf0110 jrf0110 force-pushed the 1248-gastown-bug-reporting branch from 7b5544c to 2eec086 Compare March 21, 2026 01:14
Comment thread cloudflare-gastown/container/plugin/mayor-tools.ts Outdated
… gt_report_bug tool

Closes #1248

- Add .github/ISSUE_TEMPLATE/gastown-bug.yml with structured fields
- Add 'Report a Bug' link in the terminal bar (visible in both user and org layouts)
- Add gt_report_bug Mayor tool that searches for duplicates via GitHub API before filing
- Add bug reporting guidance to Mayor system prompt
- Add tests for gt_report_bug (no token, duplicates, create, failure)
@jrf0110 jrf0110 force-pushed the 1248-gastown-bug-reporting branch from 2eec086 to 155a8db Compare March 23, 2026 21:59
jrf0110 added 2 commits March 23, 2026 17:01
…nt methods

gt_bead_add_dependency and gt_bead_remove_dependency called
addBeadDependency/removeBeadDependency on MayorGastownClient, but
those methods were never implemented. Remove the tools to avoid
runtime failures — they can be re-added when the backend support
is built.
…in gt_report_bug

The GH_TOKEN in containers may lack permission to create labels.
Changed to use existing repo labels (bug, gt:mayor) instead of
non-existent ones, and added a fallback that retries without labels
on 422 errors.
Comment thread cloudflare-gastown/container/plugin/mayor-tools.ts
jrf0110 added 2 commits March 23, 2026 19:26
The search used label:gastown which doesn't match Mayor-filed issues
(labeled bug + gt:mayor). Broadened to just label:bug so duplicate
detection catches both Mayor-filed and user-filed bug reports.
…rompt

Convert the 'Report a Bug' link into a dropdown with two options:
- New GitHub Issue (existing template link)
- Discord Channel (Gastown bugs channel)

Update the Mayor system prompt to know about the Discord channel
so it can direct users there for discussion-style bug reports.
@jrf0110 jrf0110 merged commit d35c3bd into main Mar 24, 2026
19 checks passed
@jrf0110 jrf0110 deleted the 1248-gastown-bug-reporting branch March 24, 2026 01:01
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.

Gastown bug reporting — issue template, UI link, and Mayor gt_report_bug tool

2 participants