Skip to content

fix(self-driving): reconcile promoted tools with the real ask, restore the leak test - #1031

Merged
gewenyu99 merged 1 commit into
tom/self-driving-detected-sourcesfrom
posthog-code/self-driving-tool-kinds-reconcile
Jul 29, 2026
Merged

fix(self-driving): reconcile promoted tools with the real ask, restore the leak test#1031
gewenyu99 merged 1 commit into
tom/self-driving-detected-sourcesfrom
posthog-code/self-driving-tool-kinds-reconcile

Conversation

@gewenyu99

Copy link
Copy Markdown
Collaborator

Problem

Two things found by actually running the flow and reading the skill the ask comes from, rather than inferring.

1. The promoted-tools list was wrong in both directions. I wrote it by hand from #1022's description instead of computing it. Against the real catalogue — the options array in context-mill's self-driving/references/5-connected-tools.md — it was missing nine tools that are both offered and detectable, and it included one the ask never offers.

2. The regression test guarding #1028's fix isn't on this branch. #1028 was merged at its first commit; the test commit pushed shortly after was orphaned. So the frameworkContext fix is live with nothing holding it in place.

Why

The list decides what gets promoted to the top of the connected-tools ask. Missing entries silently never surface, so a repo using Shortcut or Snyk gets no benefit from the scan at all. The wrong entry is worse than useless: promoting a tool the ask doesn't list points the agent at a source it can't create.

And a fix with no test is one refactor away from regressing — this one is invisible when it breaks, because the symptom is a paragraph quietly appearing in a different program's prompt.

Changes

  • Recomputed the promoted set as the intersection of what step 5 offers and what SOURCE_DETECTORS can detect. Adds Shortcut, Honeybadger, Raygun, Kustomer, Plain, Canny, Productboard, Snyk, GoogleSearchConsole; drops Intercom. The comment now records which half came from where, and that the guard test only covers the detector half — the skill's catalogue lives in another repo and nothing here can see it change.
  • Restored the leak regression test verbatim.

Test plan

pnpm build && pnpm test && pnpm fix — 1671 tests pass, 0 lint errors. The guard test confirms all 21 kinds exist in the source registry. Re-verified the restored leak test fails when the shared-key write is reintroduced, so it is actually load-bearing.

Notes for review

  • The ask is still unprioritised in practice. 5-connected-tools.md contains no reference to the detected block — the ordering is hardcoded in the skill, so the wizard-side change stays inert until the companion context-mill PR lands. Worth confirming that's tracked; "safe to land in either order" doesn't hold.
  • The skill already has the hook for it: step 5 says to order the tools "seeding with any step-2 hints so a tool you saw evidence of comes first among them". Pointing that at the wizard's deterministic block instead of step-2's light scan looks like a small change.
  • Fifteen of the ask's options have no detector (Freshservice, Dixa, pganalyze, SonarQube, Semgrep, Rapid7 InsightVM, Featurebase, Frill, Aha, UserVoice, AskNicely, Retently, Appfigures, AppFollow, Judge.me). They stay offered, just never promoted — the safe direction, but if any deserve detectors that's a registry addition.

Created with PostHog Code

…e the leak test

Two follow-ups to #1028, found by running the flow and reading the skill
the ask actually comes from.

The promoted-tools list was hand-written from a PR description rather than
computed, so it was wrong both ways. Recomputed as the intersection of the
options step 5 offers and the kinds this repo can detect: adds Shortcut,
Honeybadger, Raygun, Kustomer, Plain, Canny, Productboard, Snyk and
GoogleSearchConsole, all offered and all detectable, so all previously
dropped on the floor; removes Intercom, which the ask never lists, so
promoting it pointed the agent at a source it cannot create.

The regression test guarding the frameworkContext fix is also missing from
this branch — #1028 was merged at its first commit, so the test pushed
afterwards was orphaned. Restored verbatim, and re-verified it fails when
the shared-key write is reintroduced.

Generated-By: PostHog Code
Task-Id: df870021-4bdf-465b-ba4f-d486c37b97d3
@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.

@gewenyu99
gewenyu99 marked this pull request as ready for review July 29, 2026 22:10
@gewenyu99
gewenyu99 requested review from a team as code owners July 29, 2026 22:10
@gewenyu99
gewenyu99 merged commit 85701c4 into tom/self-driving-detected-sources Jul 29, 2026
14 checks passed
@gewenyu99
gewenyu99 deleted the posthog-code/self-driving-tool-kinds-reconcile branch July 29, 2026 22:10
gewenyu99 added a commit that referenced this pull request Jul 29, 2026
Seven multi-line comment blocks from #1028 and #1031 collapsed to a single
line each. Net -71 lines, no behaviour change.

The rationale that was in them belongs in the PR descriptions, which already
carry it: why the key is self-driving's own rather than the warehouse
program's, how the promoted list was computed, and why the count tag fires at
zero and at -1.

Generated-By: PostHog Code
Task-Id: df870021-4bdf-465b-ba4f-d486c37b97d3
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.

1 participant