feat(gastown): custom per-role prompt instructions in town settings#1827
feat(gastown): custom per-role prompt instructions in town settings#1827
Conversation
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Fix these issues in Kilo Cloud Other Observations (not in diff)N/A Files Reviewed (2 files)
Reviewed by gpt-5.4-20260305 · 171,643 tokens |
|
Due to the monorepo restructure you will need to recreate this PR on a new branch from main. Pass the prompt found at, https://github.com/Kilo-Org/cloud/blob/main/plans/monorepo-migration-prompt.md, to your coding agent while running in this branch. Please close this PR once done or if you don't plan to proceed with it. |
…tion, and bug fixes - Add Workers AI (Gemma 4 26B) to classify unresolved PR review threads as blocking vs non-blocking for auto-merge decisions. Informational comments (LGTM, bot status reports) no longer block auto-merge. - Fix mergePR to try squash/merge/rebase in order instead of hardcoding merge method (repos with squash-only policy were failing with 405). - Fix resetAgent to also zero dispatch_attempts so agents recover immediately after container evictions instead of being stuck in exponential backoff. - Fix code_review=false bypass: fast-track ALL open MR beads (not just those with pr_url) to prevent the refinery from being dispatched for code review when code_review is disabled. - Fix cross-tick race in pr_feedback_detected: re-verify PR is still open before creating feedback beads to prevent duplicate PRs on merged branches. - Add AI binding to wrangler.jsonc for both production and dev environments. - Add diagnostic logging for poll_pr auto-merge flow (allGreen, readySince, elapsed/delay, convoy dispatch target branch). - Update local-debug-testing.md with Workers AI documentation.
Migrated from pre-monorepo branch (1794-agent-prompts) to new monorepo structure (services/gastown/, apps/web/). - Add custom_instructions field to town config schema (polecat, refinery, mayor) - Add Custom Instructions section to town settings UI with per-role textareas - Instructions appended via appendCustomInstructions() in dispatch path - Mayor prompt updates rewrite AGENTS.md via PUT /agents/:agentId/system-prompt - Deep-merge custom_instructions per-role in updateTownConfig - Propagate mayor instructions from both tRPC and HTTP admin routes - Widen all gastown drawers ~120px, remove truncate from drawer titles - Regenerate gastown tRPC type declarations Closes #1794
b6e3da2 to
256bdcf
Compare
|
Rebased onto gastown-staging with the monorepo restructure applied. All file paths updated from |
…1827) * fix(gastown): auto-merge pipeline fixes, Workers AI thread classification, and bug fixes - Add Workers AI (Gemma 4 26B) to classify unresolved PR review threads as blocking vs non-blocking for auto-merge decisions. Informational comments (LGTM, bot status reports) no longer block auto-merge. - Fix mergePR to try squash/merge/rebase in order instead of hardcoding merge method (repos with squash-only policy were failing with 405). - Fix resetAgent to also zero dispatch_attempts so agents recover immediately after container evictions instead of being stuck in exponential backoff. - Fix code_review=false bypass: fast-track ALL open MR beads (not just those with pr_url) to prevent the refinery from being dispatched for code review when code_review is disabled. - Fix cross-tick race in pr_feedback_detected: re-verify PR is still open before creating feedback beads to prevent duplicate PRs on merged branches. - Add AI binding to wrangler.jsonc for both production and dev environments. - Add diagnostic logging for poll_pr auto-merge flow (allGreen, readySince, elapsed/delay, convoy dispatch target branch). - Update local-debug-testing.md with Workers AI documentation. * feat(gastown): custom per-role prompt instructions in town settings Migrated from pre-monorepo branch (1794-agent-prompts) to new monorepo structure (services/gastown/, apps/web/). - Add custom_instructions field to town config schema (polecat, refinery, mayor) - Add Custom Instructions section to town settings UI with per-role textareas - Instructions appended via appendCustomInstructions() in dispatch path - Mayor prompt updates rewrite AGENTS.md via PUT /agents/:agentId/system-prompt - Deep-merge custom_instructions per-role in updateTownConfig - Propagate mayor instructions from both tRPC and HTTP admin routes - Widen all gastown drawers ~120px, remove truncate from drawer titles - Regenerate gastown tRPC type declarations Closes #1794
…1827) * fix(gastown): auto-merge pipeline fixes, Workers AI thread classification, and bug fixes - Add Workers AI (Gemma 4 26B) to classify unresolved PR review threads as blocking vs non-blocking for auto-merge decisions. Informational comments (LGTM, bot status reports) no longer block auto-merge. - Fix mergePR to try squash/merge/rebase in order instead of hardcoding merge method (repos with squash-only policy were failing with 405). - Fix resetAgent to also zero dispatch_attempts so agents recover immediately after container evictions instead of being stuck in exponential backoff. - Fix code_review=false bypass: fast-track ALL open MR beads (not just those with pr_url) to prevent the refinery from being dispatched for code review when code_review is disabled. - Fix cross-tick race in pr_feedback_detected: re-verify PR is still open before creating feedback beads to prevent duplicate PRs on merged branches. - Add AI binding to wrangler.jsonc for both production and dev environments. - Add diagnostic logging for poll_pr auto-merge flow (allGreen, readySince, elapsed/delay, convoy dispatch target branch). - Update local-debug-testing.md with Workers AI documentation. * feat(gastown): custom per-role prompt instructions in town settings Migrated from pre-monorepo branch (1794-agent-prompts) to new monorepo structure (services/gastown/, apps/web/). - Add custom_instructions field to town config schema (polecat, refinery, mayor) - Add Custom Instructions section to town settings UI with per-role textareas - Instructions appended via appendCustomInstructions() in dispatch path - Mayor prompt updates rewrite AGENTS.md via PUT /agents/:agentId/system-prompt - Deep-merge custom_instructions per-role in updateTownConfig - Propagate mayor instructions from both tRPC and HTTP admin routes - Widen all gastown drawers ~120px, remove truncate from drawer titles - Regenerate gastown tRPC type declarations Closes #1794
…1827) * fix(gastown): auto-merge pipeline fixes, Workers AI thread classification, and bug fixes - Add Workers AI (Gemma 4 26B) to classify unresolved PR review threads as blocking vs non-blocking for auto-merge decisions. Informational comments (LGTM, bot status reports) no longer block auto-merge. - Fix mergePR to try squash/merge/rebase in order instead of hardcoding merge method (repos with squash-only policy were failing with 405). - Fix resetAgent to also zero dispatch_attempts so agents recover immediately after container evictions instead of being stuck in exponential backoff. - Fix code_review=false bypass: fast-track ALL open MR beads (not just those with pr_url) to prevent the refinery from being dispatched for code review when code_review is disabled. - Fix cross-tick race in pr_feedback_detected: re-verify PR is still open before creating feedback beads to prevent duplicate PRs on merged branches. - Add AI binding to wrangler.jsonc for both production and dev environments. - Add diagnostic logging for poll_pr auto-merge flow (allGreen, readySince, elapsed/delay, convoy dispatch target branch). - Update local-debug-testing.md with Workers AI documentation. * feat(gastown): custom per-role prompt instructions in town settings Migrated from pre-monorepo branch (1794-agent-prompts) to new monorepo structure (services/gastown/, apps/web/). - Add custom_instructions field to town config schema (polecat, refinery, mayor) - Add Custom Instructions section to town settings UI with per-role textareas - Instructions appended via appendCustomInstructions() in dispatch path - Mayor prompt updates rewrite AGENTS.md via PUT /agents/:agentId/system-prompt - Deep-merge custom_instructions per-role in updateTownConfig - Propagate mayor instructions from both tRPC and HTTP admin routes - Widen all gastown drawers ~120px, remove truncate from drawer titles - Regenerate gastown tRPC type declarations Closes #1794
Summary
custom_instructionsfield to town config schema, allowing users to append free-text instructions (up to 2000 chars each) to the system prompt for polecat, refinery, and mayor agents## Custom Instructions (from town settings)section at the end of each role's system prompt viaappendCustomInstructions()in the dispatch pathPUT /agents/:agentId/system-promptcontainer endpoint rewrites AGENTS.md when instructions change, triggered automatically from theupdateTownConfigmutationtruncatefrom drawer title headers for better readabilityCloses #1794
Verification
pnpm typecheckpasses (only pre-existingcsv-parse/syncerror in a migration script)oxfmt --list-different .passes (no formatting issues)pnpm build:typesVisual Changes
Reviewer Notes
appendCustomInstructionshelper incontainer-dispatch.tsis applied at the single point wheresystemPromptis assembled instartAgentInContainer, covering all roles (polecat usessystemPromptForRole, refinery usessystemPromptOverride, mayor usessystemPromptForRole— all get wrapped)AGENTS.md(read by kilo serve) rather than passed via the session API. The newupdateMayorSystemPrompt()method on TownDO rebuilds the prompt and pushes it to the container whencustom_instructions.mayorchangescustom_instructionsfield is fully optional and backward-compatible — existing towns without it behave identically