Skip to content

feat(self-driving): prioritise codebase-detected tools in the connected-tools ask - #1022

Merged
gewenyu99 merged 6 commits into
mainfrom
tom/self-driving-detected-sources
Jul 29, 2026
Merged

feat(self-driving): prioritise codebase-detected tools in the connected-tools ask#1022
gewenyu99 merged 6 commits into
mainfrom
tom/self-driving-detected-sources

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

The self-driving connected-tools multi-select (STEP 5) ballooned from 5 → 35 sources and is heading toward the full ~500-source warehouse catalog. It overflows the terminal — you can't see the whole list (thread).

The agreed fix: show the tools we can detect in the user's codebase first, then the SaaS basics, then an "others" bucket — instead of dumping the whole catalog.

Changes

The wizard already has the detection for this. The same deterministic detectWarehouseSources scanner that powers the warehouse program already covers ~16 of the self-driving inbox tools (GitHub, GitLab, Gitea, Linear, Jira, Sentry, Rollbar, Bugsnag, Zendesk, Freshdesk, Front, Gorgias, Intercom, …). This wires it into the self-driving flow and feeds the result to the agent:

  • The self-driving detect step now runs the scan and stashes the result under the shared DETECTED_WAREHOUSE_SOURCES_KEY. Best-effort — a scan failure or an empty result never blocks the flow (no detectError, unlike the standalone warehouse program).
  • buildSelfDrivingPrompt renders a "Tools detected in this codebase" block and points STEP 4 (enable matching sources) and STEP 5 (order the ask) at it. An empty scan says so explicitly, so the agent falls back to the skill's default ordering rather than inventing its own flaky scan.

The boundary

The wizard only provides the deterministic facts (what's in the codebase). Which tools are inbox-relevant, and how the ask is ordered (detected → basics → others), stays in the context-mill self-driving skill — that's the companion PR (context-mill), which restructures 5-connected-tools.md step 5 to consume this block. Keeps product knowledge out of wizard code, matching the repo's design discipline.

This half is inert without the skill change: the prompt block is additive context, and the current skill will simply ignore it until step 5 is updated to read it. Safe to land in either order.

Test plan

pnpm build && pnpm test && pnpm fix — build passes, 1666 tests pass, 0 lint errors.

New tests:

  • self-driving-detect.test.ts — a @sentry/node dep gets stashed as a detected Sentry tool; a bare dir writes nothing (and still clears detection).
  • self-driving-prompt.test.ts — the block lists each tool with its source_type and matched signal, sits before STEP 5, points STEP 5 at "detected → basics → others", and states "none found" on an empty scan (so no invented scan).

Not yet run end-to-end against a real self-driving run — the prompt block is verified by construction, and it's inert until the skill consumes it.

…ed-tools ask

The self-driving connected-tools multi-select (STEP 5) grew from 5 to 35
sources and is heading toward the full ~500-source warehouse catalog, so it
overflows the terminal. The fix agreed in the thread: surface the tools we can
detect in the user's codebase first, then the SaaS basics, then an "others"
bucket — rather than dumping the whole list.

The wizard already has the detection for this: the same deterministic
`detectWarehouseSources` scanner that powers the warehouse program already
covers ~16 of the self-driving inbox tools (GitHub, GitLab, Gitea, Linear,
Jira, Sentry, Rollbar, Bugsnag, Zendesk, Freshdesk, Front, Gorgias, Intercom,
and more). This wires that detection into the self-driving flow and feeds it to
the agent.

- The self-driving detect step now runs the scan and stashes the result under
  the shared `DETECTED_WAREHOUSE_SOURCES_KEY` (best-effort; a scan failure or an
  empty result never blocks the flow).
- `buildSelfDrivingPrompt` renders a "Tools detected in this codebase" block and
  points STEP 4/STEP 5 at it. Empty scan states so explicitly, so the agent
  falls back to the skill's default ordering instead of inventing its own scan.

The wizard only provides the deterministic facts; which tools are inbox-relevant
and how the ask is ordered stays in the context-mill skill (companion change),
keeping product knowledge out of wizard code.
@Gilbert09
Gilbert09 requested review from a team as code owners July 29, 2026 11: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 basic-integration
  • /wizard-ci mcp-analytics
  • /wizard-ci revenue
  • /wizard-ci self-driving

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /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 mcp-analytics/custom-dispatcher
  • /wizard-ci mcp-analytics/typescript-sdk
  • /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

Results will be posted here when complete.

@Gilbert09

Copy link
Copy Markdown
Member Author

Companion context-mill PR (restructures the step-5 ask to consume the detected-tools block): PostHog/context-mill#291

@gewenyu99 gewenyu99 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try this. I'll keep an eye out on telemetry here.

Tentative approve and will send a robot to reiview this as well. I'll merge and release this when I'm done with it

@gewenyu99

Copy link
Copy Markdown
Collaborator
Screen.Recording.2026-07-29.at.6.58.59.PM.mov

Much better, but I'll make a change to that button name in another PR.

@gewenyu99
gewenyu99 enabled auto-merge (squash) July 29, 2026 23:01
@gewenyu99
gewenyu99 merged commit dd4572a into main Jul 29, 2026
16 checks passed
@gewenyu99
gewenyu99 deleted the tom/self-driving-detected-sources branch July 29, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants