-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Part of #271 — Gastown Cloud Proposal A (Sandbox-per-Town)
Goal
Build a settings page for gastown towns where users can configure models, agent limits, rigs, and idle behavior.
Requirements
Configuration Page
Route: /gastown/[townId]/settings
Sections:
a) Model Selection
- Default model dropdown (populated from gateway-available models)
- Per-role model overrides:
- Polecat model
- Witness model
- Mayor model
- Refinery model
- Each dropdown shows model name, provider, and pricing tier
- Changes call sandbox internal API
PATCH /config→ writes togtconfig files - New agent sessions pick up the model on next spawn (existing sessions unaffected)
b) Agent Limits
- Max concurrent polecats slider (range: 1–30, default: 8)
- Warning at >8 about resource usage on standard tier
- Persisted in
gastown_towns.configJSONB
c) Rig Management
- List of current rigs with name, repo URL, branch
- "Add rig" form: repo URL, name (auto-derived from URL), default branch
- "Remove rig" button with confirmation
- Calls
gastown.addRig/gastown.removeRigtRPC mutations
d) Idle Settings
- Auto-stop idle timeout input (minutes, default: 30, min: 5, max: 480)
- Toggle to disable auto-stop entirely
- Persisted in
gastown_towns.configJSONB
e) Danger Zone
- "Destroy Town" button with double-confirmation (type town name to confirm)
- Explains: Fly machine + volume destroyed, R2 backup retained 30 days
tRPC Additions
| Route | Type | Description |
|---|---|---|
gastown.updateTownConfig |
mutation | Update config JSONB (models, max_polecats, idle_timeout) |
gastown.getTownConfig |
query | Read current config |
gastown.getAvailableModels |
query | List gateway-available models for dropdowns |
Config Flow
- User changes a setting in the UI
- Frontend calls
gastown.updateTownConfigtRPC mutation - Cloud app updates
gastown_towns.configin Postgres - Cloud app calls sandbox internal API
PATCH /configwith the new settings - Sandbox writes to
gtconfig files:~/gt/settings/config.json→default_agent,role_agentsmap- Per-rig configs if rig-specific overrides
Files
cloud/src/app/gastown/[townId]/settings/page.tsx(new)cloud/src/components/gastown/ModelSelector.tsx(new)cloud/src/components/gastown/RigManager.tsx(new)cloud/src/components/gastown/IdleSettings.tsx(new)- Updates to
cloud/src/server/api/routers/gastown.ts
Acceptance Criteria
- Settings page loads current config from DB + sandbox
- Model dropdowns show available gateway models
- Changing a model updates both Postgres config and sandbox gt config files
- Max polecats slider updates config with warning at >8
- Add rig form validates repo URL and creates rig in both DB and sandbox
- Remove rig confirms and removes from both DB and sandbox
- Idle timeout setting persists and is respected by the health monitor (PR 6)
- Destroy town requires typing town name for confirmation
- All settings changes provide success/error feedback
- Page follows existing settings page patterns in the dashboard
Dependencies
- PR 2 (Provisioning API) —
addRig,removeRig,destroyTown - PR 3 (Sandbox Internal API) —
PATCH /configendpoint - PR 6 (Lifecycle Management) — idle timeout enforcement
- PR 9 (Dashboard Pages) — navigation from town detail to settings
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels