feat(gastown): babysit existing PR feature#3601
Merged
jrf0110 merged 6 commits intoMay 30, 2026
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe duplicate Resolved Issues
Files Reviewed (7 files)
Reviewed by claude-sonnet-4.6 · 191,127 tokens Review guidance: REVIEW.md from base branch |
…unk 0) (#3576) * feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) * fix(gastown): address PR review feedback on slingExistingPr - Remove async from submitExternalPrToReviewQueue (no awaits inside) - Add GitLab host validation in slingExistingPr URL parsing to prevent non-GitLab URLs (e.g. Bitbucket) from matching the GitLab regex - Replace vacuous state validation tests with meaningful checkPRStatus integration tests that exercise the actual status resolution path --------- Co-authored-by: John Fawcett <john@kilcoode.ai>
Add gastown.babysitPr tRPC mutation, gastown.previewPr tRPC query, mayor-tools babysit-pr HTTP route, refinery bypass for babysat beads, and reconciler fast-track extension for babysat MR beads.
feat(web): BeadPanel babysit badge + metadata surfacing (chunk 4) - Add 'Babysat external PR' badge (cyan) when gt:babysit label present - Hide source bead link for babysit beads (no source_bead_id) - Add babysit metadata panel: head_sha (7-char, linked), force_push_allowed (Lock/Unlock icons), babysit_started_at (relative time) - Add event formatters for babysit_started, pr_feedback_detected, pr_conflict_detected, pr_auto_merge, pr_status_changed - Mirror babysit badge + metadata in BeadInspectorDashboard - Extract buildRelatedBeads and eventDescription into separate files for testability - Add unit tests for eventDescription and buildRelatedBeads babysit logic Co-authored-by: John Fawcett <john@kilcoode.ai>
…3582) * feat(gastown): gt_babysit_pr mayor tool + force-push gate (chunk 2) Add gt_babysit_pr mayor tool registration and client method, update mayor and polecat system prompts with babysit PR guidance and force-push policy, surface force_push_allowed in polecat prime context, and add corresponding unit tests. * fix(gastown): address PR review warnings on babysit PR feature - Rewrite PR Conflict Resolution Workflow in polecat-system.prompt.ts to choose strategy upfront (rebase vs merge) based on force_push_allowed, instead of rebase-then-abort which discarded conflict resolution work. - Extract resolveForcePushAllowed() from agents.ts prime() so tests exercise the actual function instead of inlining the logic. --------- Co-authored-by: John Fawcett <john@kilcoode.ai>
- Fix GitLab MR head SHA link in BeadPanel.tsx (regex now handles /-/merge_requests/ URLs) - Extract shared test helpers into babysit-pr-helpers.ts to eliminate ~400 lines of duplication - babysit_started_at already present from staging (confirmed)
jrf0110
force-pushed
the
convoy/babysit-existing-pr-feature-re-staged/254a4b7e/head
branch
from
May 30, 2026 16:53
879a3b7 to
6db98e9
Compare
jrf0110
deleted the
convoy/babysit-existing-pr-feature-re-staged/254a4b7e/head
branch
May 30, 2026 17:08
jrf0110
added a commit
that referenced
this pull request
Jul 22, 2026
* feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) (#3576) * feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) * fix(gastown): address PR review feedback on slingExistingPr - Remove async from submitExternalPrToReviewQueue (no awaits inside) - Add GitLab host validation in slingExistingPr URL parsing to prevent non-GitLab URLs (e.g. Bitbucket) from matching the GitLab regex - Replace vacuous state validation tests with meaningful checkPRStatus integration tests that exercise the actual status resolution path --------- Co-authored-by: John Fawcett <john@kilcoode.ai> * feat(gastown): tRPC + HTTP for babysit PR (chunk 1) Add gastown.babysitPr tRPC mutation, gastown.previewPr tRPC query, mayor-tools babysit-pr HTTP route, refinery bypass for babysat beads, and reconciler fast-track extension for babysat MR beads. * feat(web): BeadPanel babysit badge + metadata (chunk 4) (#3581) feat(web): BeadPanel babysit badge + metadata surfacing (chunk 4) - Add 'Babysat external PR' badge (cyan) when gt:babysit label present - Hide source bead link for babysit beads (no source_bead_id) - Add babysit metadata panel: head_sha (7-char, linked), force_push_allowed (Lock/Unlock icons), babysit_started_at (relative time) - Add event formatters for babysit_started, pr_feedback_detected, pr_conflict_detected, pr_auto_merge, pr_status_changed - Mirror babysit badge + metadata in BeadInspectorDashboard - Extract buildRelatedBeads and eventDescription into separate files for testability - Add unit tests for eventDescription and buildRelatedBeads babysit logic Co-authored-by: John Fawcett <john@kilcoode.ai> * feat(gastown): gt_babysit_pr mayor tool + force-push gate (chunk 2) (#3582) * feat(gastown): gt_babysit_pr mayor tool + force-push gate (chunk 2) Add gt_babysit_pr mayor tool registration and client method, update mayor and polecat system prompts with babysit PR guidance and force-push policy, surface force_push_allowed in polecat prime context, and add corresponding unit tests. * fix(gastown): address PR review warnings on babysit PR feature - Rewrite PR Conflict Resolution Workflow in polecat-system.prompt.ts to choose strategy upfront (rebase vs merge) based on force_push_allowed, instead of rebase-then-abort which discarded conflict resolution work. - Extract resolveForcePushAllowed() from agents.ts prime() so tests exercise the actual function instead of inlining the logic. --------- Co-authored-by: John Fawcett <john@kilcoode.ai> * fix(gastown): address rework feedback for babysit PR feature - Fix GitLab MR head SHA link in BeadPanel.tsx (regex now handles /-/merge_requests/ URLs) - Extract shared test helpers into babysit-pr-helpers.ts to eliminate ~400 lines of duplication - babysit_started_at already present from staging (confirmed) * fix(web): remove duplicate isBabysit declaration in BeadPanel --------- Co-authored-by: John Fawcett <john@kilcoode.ai>
jrf0110
added a commit
that referenced
this pull request
Jul 22, 2026
* feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) (#3576) * feat(gastown): Town DO slingExistingPr method (babysit PR feature, chunk 0) * fix(gastown): address PR review feedback on slingExistingPr - Remove async from submitExternalPrToReviewQueue (no awaits inside) - Add GitLab host validation in slingExistingPr URL parsing to prevent non-GitLab URLs (e.g. Bitbucket) from matching the GitLab regex - Replace vacuous state validation tests with meaningful checkPRStatus integration tests that exercise the actual status resolution path --------- Co-authored-by: John Fawcett <john@kilcoode.ai> * feat(gastown): tRPC + HTTP for babysit PR (chunk 1) Add gastown.babysitPr tRPC mutation, gastown.previewPr tRPC query, mayor-tools babysit-pr HTTP route, refinery bypass for babysat beads, and reconciler fast-track extension for babysat MR beads. * feat(web): BeadPanel babysit badge + metadata (chunk 4) (#3581) feat(web): BeadPanel babysit badge + metadata surfacing (chunk 4) - Add 'Babysat external PR' badge (cyan) when gt:babysit label present - Hide source bead link for babysit beads (no source_bead_id) - Add babysit metadata panel: head_sha (7-char, linked), force_push_allowed (Lock/Unlock icons), babysit_started_at (relative time) - Add event formatters for babysit_started, pr_feedback_detected, pr_conflict_detected, pr_auto_merge, pr_status_changed - Mirror babysit badge + metadata in BeadInspectorDashboard - Extract buildRelatedBeads and eventDescription into separate files for testability - Add unit tests for eventDescription and buildRelatedBeads babysit logic Co-authored-by: John Fawcett <john@kilcoode.ai> * feat(gastown): gt_babysit_pr mayor tool + force-push gate (chunk 2) (#3582) * feat(gastown): gt_babysit_pr mayor tool + force-push gate (chunk 2) Add gt_babysit_pr mayor tool registration and client method, update mayor and polecat system prompts with babysit PR guidance and force-push policy, surface force_push_allowed in polecat prime context, and add corresponding unit tests. * fix(gastown): address PR review warnings on babysit PR feature - Rewrite PR Conflict Resolution Workflow in polecat-system.prompt.ts to choose strategy upfront (rebase vs merge) based on force_push_allowed, instead of rebase-then-abort which discarded conflict resolution work. - Extract resolveForcePushAllowed() from agents.ts prime() so tests exercise the actual function instead of inlining the logic. --------- Co-authored-by: John Fawcett <john@kilcoode.ai> * fix(gastown): address rework feedback for babysit PR feature - Fix GitLab MR head SHA link in BeadPanel.tsx (regex now handles /-/merge_requests/ URLs) - Extract shared test helpers into babysit-pr-helpers.ts to eliminate ~400 lines of duplication - babysit_started_at already present from staging (confirmed) * fix(web): remove duplicate isBabysit declaration in BeadPanel --------- Co-authored-by: John Fawcett <john@kilcoode.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the "babysit existing PR" feature to Gastown, allowing towns to adopt and manage external PRs (created manually, by other tools, or by third parties). The town polls the PR, addresses review feedback, fixes merge conflicts, and auto-merges — bypassing the refinery code review path since the user is opting into "merge this PR", not "review this PR".
Key changes across 4 chunks:
slingExistingPrandpreviewPrmethods onTownDO— validates PR URL against rig repo, checks PR status via SCM, creates amerge_requestbead withgt:babysitlabel and babysit metadata (head_sha,force_push_allowed)babysitPrandpreviewPrtRPC mutations +POST /api/mayor/:townId/tools/babysit-prHTTP handler for mayor tool accessgt_babysit_prmayor tool,force_push_allowedmetadata propagated throughpr_fixup_context/pr_conflict_contextin prime context, polecat prompt updated with force-push policy (default false for babysat PRs = merge-only, no history rewriting)SlingDialogbabysit-PR mode,BeadPanelbabysit badge and metadata display,eventDescriptionextracted to module with babysit event types,buildRelatedBeadsextracted for testability,ActivityFeedicons/colors for babysit events, Gastown platform filter in sessions UIAlso includes infrastructure improvements:
setEnvVar/deleteEnvVarfromTownContainerDOin favor of passing config through control server request protocol (/sync-config,/refresh-token,/agents/start). Eliminates stale persisted env var issues across DO evictions and container restarts.@kilocode/sdk7.2.14 → 7.3.1,@kilocode/cli7.2.14 → 7.3.1Verification
in_progressin reconcilerforce_push_allowed: falsepolecats use merge commits (no force-push)previewPrreturns correct metadata for GitHub and GitLab PRsVisual Changes
Reviewer Notes
slingExistingPrmethod inTownDOhas duplicated PR URL parsing logic withpreviewPr— this is intentional to keeppreviewPras a lightweight read-only path that can fail independentlyforce_push_allowedgate defaults totruewhen absent (backwards compat for pre-babysit beads) — only explicitfalsedisables force-pushsetEnvVar/deleteEnvVar) is a significant infra change that removes the persisted env var store in favor of always-fresh request-scoped delivery. This eliminates stale-token bugs across DO evictions