Skip to content

fix(self-driving): honor the enabled-scout cap when sizing the troop - #414

Merged
andrewm4894 merged 2 commits into
mainfrom
posthog-self-driving/fixself-driving-honor-the-enabled-scout-acd9d3
Sep 26, 2026
Merged

andrewm4894 merged 2 commits into
mainfrom
posthog-self-driving/fixself-driving-honor-the-enabled-scout-acd9d3

Conversation

@posthog

@posthog posthog Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • A project with a low max_enabled_scouts override can approve scouts that setup then cannot start. The server rejects the enable, and the planned coverage is absent.
  • Step 6 and step 6b size the troop against the ten-scout ceiling and the daily run budget only. They ignore max_enabled_scouts, which scout-metadata-get returns.
  • The server counts every enabled config against the cap (_reject_if_enabled_cap_reached, enabled_scout_count). Operational scouts seed enabled past the cap but still use a slot. Existing custom scouts use slots too.

Origin

  • Scout: a custom scout
  • First signal: 2026-09-26
  • Inbox report: open
  • Task started by: auto-start, after the report was rated P2 and ready to fix

Changes

  • New step 1c: read max_enabled_scouts, then slots = cap − enabled operational − enabled custom. The step 6 pick and the step 6b room (min(10, budget, slots) − step 6 count) both stay inside slots.
  • When the cap removes a scout, setup records a follow-up (raise max_enabled_scouts or disable a scout). Step 6b skips the proposal when no slot remains.
  • Step 3 skips custom scouts (scout_origin: "custom"): they use a slot but setup never disables them.
  • Step 3 sends disables before enables, because the server checks the cap at the time of each enable.
  • Corrects the claim that operational scouts sit outside the enabled-scout cap. The report now states the cap and the free slots.
Case Before After
Default cap (far above 10) about 10 about 10 (unchanged)
Cap 6, 1 operational + 2 custom enabled up to 10 planned, enables fail 3 slots: general + 2 specialists, 6b room 0
Older deploy, no field — soft-degrade to current sizing

Note

Instruction-only change. npm test (215 passed) and npm run build pass.

Agent context

  • Contract read from PostHog/posthog master (limits.py, team_limits.py, config_registry.py, views.py, serializers.py). The serializer help text says operational scouts are exempt from the cap, but the enforcement code counts them. The guide follows the enforcement code.

Created with PostHog Desktop from this inbox report.

🤖 Generated with Claude Code

Step 6 and step 6b now read max_enabled_scouts from scout-metadata-get, count the free slots after enabled operational and custom scouts, and cap both picks by that number. Step 6 does its disables before its enables, and it does not disable custom scouts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Generated-By: PostHog Desktop
Task-Id: 73b9b10f-e3c8-4ea1-a3d0-577e49f41eda
@posthog posthog Bot added the self-driving label Sep 26, 2026
@posthog
posthog Bot marked this pull request as ready for review September 26, 2026 10:07
@github-actions

Copy link
Copy Markdown

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci ai-observability
  • /wizard-ci basic-integration
  • /wizard-ci feature-flags
  • /wizard-ci mcp-analytics
  • /wizard-ci replay-vision
  • /wizard-ci revenue
  • /wizard-ci self-driving
  • /wizard-ci warehouse
  • /wizard-ci warehouse-seeded

Test an individual app:

  • /wizard-ci ai-observability/anthropic
  • /wizard-ci ai-observability/google-adk
  • /wizard-ci ai-observability/groq
Show more apps
  • /wizard-ci ai-observability/manual-capture
  • /wizard-ci ai-observability/openai
  • /wizard-ci ai-observability/openai-agents
  • /wizard-ci ai-observability/opentelemetry
  • /wizard-ci ai-observability/vercel-ai
  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/flutter
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci feature-flags/django
  • /wizard-ci feature-flags/next-js
  • /wizard-ci mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /wizard-ci replay-vision/javascript-node
  • /wizard-ci replay-vision/next-js
  • /wizard-ci replay-vision/react-vite
  • /wizard-ci revenue/stripe
  • /wizard-ci self-driving/astro
  • /wizard-ci self-driving/fastapi
  • /wizard-ci self-driving/nuxt
  • /wizard-ci self-driving/react-router
  • /wizard-ci self-driving/sveltekit
  • /wizard-ci warehouse/monorepo-env
  • /wizard-ci warehouse/multi-source-next
  • /wizard-ci warehouse/stripe-node
  • /wizard-ci warehouse/zero-source
  • /wizard-ci warehouse-seeded/next-stripe
  • /wizard-ci warehouse-seeded/next-stripe-declined

Test against a wizard branch:

  • /wizard-ci all wizard:my-branch

Add wizard:<branch> to any command above to pin the wizard branch. It defaults to main.

Results will be posted here when complete.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Generated-By: PostHog Desktop
Task-Id: 73b9b10f-e3c8-4ea1-a3d0-577e49f41eda
@andrewm4894
andrewm4894 merged commit 001831b into main Sep 26, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant