Skip to content

feat: swarm foundation for nostown consensus extension#3624

Open
kab0rn wants to merge 7 commits intogastownhall:mainfrom
kab0rn:feat/swarm-foundation
Open

feat: swarm foundation for nostown consensus extension#3624
kab0rn wants to merge 7 commits intogastownhall:mainfrom
kab0rn:feat/swarm-foundation

Conversation

@kab0rn
Copy link
Copy Markdown
Contributor

@kab0rn kab0rn commented Apr 13, 2026

Summary

Prepares GasTown for multi-agent swarm consensus via the nostown extension.
All existing behavior is unchanged — swarm path only activates when
SlingParams.SwarmConfig is non-nil, which no existing caller sets.
The nostown binary is optional; if absent, single-agent fallback runs with a warning.

Changes

  • Add SwarmConfig + NonInteractiveConfig types to SlingParams
  • Add trySwarmDelegate hook in executeSling — subprocess JSON protocol to nostown
  • Guard refinery role against groq routing (always forces claude at merge gate)
  • Inject JSON enforcement into groq-compound headless system prompts
  • Add gt doctor groq-compound JSON probe check

Test checklist

  • go build ./... passes
  • gt doctor passes with new probe (skips gracefully if groq not configured)
  • Existing gt sling invocations unaffected
  • gt sling with SwarmConfig set delegates to nostown when binary present

kab0rn and others added 7 commits April 12, 2026 14:18
Adds TierCustomGroqOpus ("custom-groq-opus") which routes
mayor/polecat/crew to the default Opus model and all patrol/utility
roles (deacon, witness, refinery, boot, dog) to Groq Compound for
cost savings on background orchestration work.

- Adds TierCustomGroqOpus constant
- Adds groqCompoundPreset() RuntimeConfig helper
- Wires groq-compound agent into CostTierAgents
- Updates ValidCostTiers, IsValidTier, TierDescription
- ApplyCostTier now cleans up groq-compound on TierStandard switch
- Add AgentGroqCompound builtin preset in agents.go with correct
  ANTHROPIC_BASE_URL and GROQ_API_KEY→ANTHROPIC_API_KEY env injection
  so claude CLI routes requests to Groq's OpenAI-compatible endpoint.
- Update groqCompoundPreset() in cost_tier.go to use the builtin
  RuntimeConfigFromPreset() path instead of a bare ad-hoc RuntimeConfig,
  so all claude SDK / hooks / tmux detection plumbing is inherited.
- Model string is groq/compound-beta (Groq's compound reasoning model).
- ANTHROPIC_API_KEY is expanded at runtime from $GROQ_API_KEY so no
  secrets are hardcoded; falls back gracefully when GROQ_API_KEY unset.
- Add TierCustomGroqOpus cost tier: mayor/crew on Opus, everything else on groq-compound
- Move polecat to groq-compound in this tier
- Fix hardcoded Groq API key: now reads GROQ_API_KEY from environment at runtime
- Fix model name: groq/compound → compound-beta (actual Groq API model ID)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds custom-groq-sonnet cost tier that uses:
- Claude Sonnet for mayor (quality-critical work)
- Groq compound-beta for all other roles (fast, low-cost)
This document provides an overview of NOS Town's integration with Gas Town, detailing architecture, configuration, workflow, and key differences.
The PR evolved through multiple commits that left cost_tier.go and
agents.go in an internally inconsistent state post-rebase:

- Commit 22c6408 introduced TierCustomGroqSonnet with mis-indented
  code (stray tabs breaking the switch syntax).
- agents.go used --model arg for groq-compound, while the PR test
  expected ANTHROPIC_MODEL env var.
- ANTHROPIC_API_KEY was stored as literal \"\$GROQ_API_KEY\" string,
  while the test expected the resolved env value.

Resolution:
- Reformat TierCustomGroqSonnet block and the IsValidTier switch.
- AgentGroqCompound: drop --model arg, set ANTHROPIC_MODEL=compound-beta
  in Env, keep the base-URL + API-key overrides.
- groqCompoundPreset: resolve \$GROQ_API_KEY at preset build time.
- Update TestValidCostTiers to expect 5 tiers (adds custom-groq-sonnet).

Co-authored-by: kab0rn <37914030+kab0rn@users.noreply.github.com>
…guard, groq JSON enforcement, doctor probe, nostown hook

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions bot added the status/needs-triage Inbox — we haven't looked at it yet label Apr 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/needs-triage Inbox — we haven't looked at it yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant