feat(gastown): add staged convoys for plan-review-iterate workflow#1077
Merged
feat(gastown): add staged convoys for plan-review-iterate workflow#1077
Conversation
jeanduplessis
approved these changes
Mar 13, 2026
Adds staged mode to convoys so users can plan work before executing. gt_sling_batch gains a staged param that creates convoy + beads without hooking agents. New gt_convoy_start tool transitions staged convoys to open, triggering agent dispatch. Dashboard shows staged convoys with draft visual state and a Start button. Mayor prompt updated with staged convoy instructions. Closes #1006
d7ae2d0 to
c57b9a2
Compare
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (24 files)
Reviewed by gpt-5.4-20260305 · 1,669,552 tokens |
… convoys from deacon patrol SlingBatchResult.agent is null for staged convoys since agents aren't assigned until gt_convoy_start. The gt_sling_batch tool now handles this gracefully instead of crashing on b.agent.name. feedStrandedConvoys now joins convoy_metadata and filters on staged=0 so the deacon patrol doesn't auto-assign agents to staged convoy beads.
…utton - Add staged field to ConvoyOutput tRPC schema - Add startConvoy tRPC mutation - Add convoy ResourceRef type to DrawerStack - Create ConvoyPanel drawer with DAG wave layout, metadata, and start button - Update ConvoyTimeline with staged badge, clickable title to open drawer, and inline start button for staged convoys - Wire startConvoy mutation in TownOverviewPageClient and RigDetailPageClient - Fix convoy_id -> id field in dashboard.ui.ts (PR review comment) - Regenerate gastown tRPC type declarations
Adds a town-level config toggle that forces all convoys to be created in staged mode by default. When enabled, the mayor must explicitly start each convoy before agents are dispatched. - Add staged_convoys_default to TownConfigSchema (default: false) - slingConvoy resolves staged as input.staged ?? config.staged_convoys_default - Add Switch toggle in town settings UI under new Convoys section - Add field to admin router TownConfigRecord
- Fix duplicate mayorToken DOM id in dashboard convoy panel (use convoyMayorToken) - Remove 'staged' from Convoy status enum in container plugin types (staging is tracked by the boolean field, not status) - Re-read bead after hookBead in startConvoy so assignee is up to date - Change convoy.created to convoy.started event in startConvoy
- Use result.convoy.staged instead of args.staged in gt_sling_batch so tool output reflects actual server state (respects town config default) - Add getConvoy tRPC query so ConvoyPanel uses a by-id query instead of filtering listConvoys (drawer no longer breaks when convoy lands) - Emit convoy.created event in slingConvoy so batch-created convoys appear in the activity feed/analytics - Fix prettier formatting on generated .d.ts files
startConvoy now clears the staged flag only after all agents are successfully hooked. If getOrCreateAgent or hookBead throws partway through, the convoy remains staged so the caller can safely retry.
…beads If startConvoy throws after hooking some beads, the convoy stays staged for retry. On retry, skip beads that already have an assignee to avoid duplicate hooks and orphaned agents.
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
stagedstatus to convoy metadata — staged convoys have beads defined but no agents hooked or dispatchedgt_sling_batchwith astaged: booleanparameter (defaultfalse); whentrue, creates convoy + beads without triggering agent dispatchgt_convoy_starttool that transitions a staged convoy toopen, hooks agents to all tracked beads, and triggers dispatch on the next alarm tickCloses #1006
Verification
origin/mainVisual Changes
N/A (dashboard staged convoy display added but not visually verified)
Reviewer Notes
gt_convoy_starthooks agents and dispatches atomically; if a rig has no available agents, the bead will wait in the dispatch queueconvoy_metadata.table.tsgains thestagedcolumn — ensure migration runs cleanly in production