Skip to content

fix(prompt): keep skill routing in skill policy - #1179

Merged
dcramer merged 1 commit into
mainfrom
fix/available-skills-plugin-wording
Aug 1, 2026
Merged

dcramer merged 1 commit into
mainfrom
fix/available-skills-plugin-wording

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Observed misfire: for a scheduled-task request, Junior called loadSkill("scheduler") even though scheduler is a plugin/catalog source, not a skill. It recovered via searchTools(source: "scheduler"), but the first hop was wrong.

Root cause: skill routing was duplicated and overfitted:

  1. <available-skills> intro said a request naming a plugin/provider/account matching a skill name is a skill match.
  2. That exact-name bias is not useful — explicit $skill//skill is already handled pre-model; auto-select should be semantic.
  3. <skill-policy> already owned load rules, so the data block was the wrong place for routing prose.

Fix: one file, two small edits in packages/junior/src/chat/prompt.ts:

  • make <available-skills> data-only (drop the intro sentence)
  • consolidate routing into <skill-policy>:
    • scan listed skills before acting
    • match on description (semantic)
    • only loadSkill with an exact listed <name>
    • if none fits, do not load a skill
- const available = [
-   "<available-skills>",
-   "Scan before answering. ... A request that names a skill, plugin, provider, or account matching a skill name is a skill match. ...",
- ];
+ const available = ["<available-skills>"];

- "- Otherwise, only load skills listed in `<available-skills>`. Never guess or invent a skill name.",
+ "- Otherwise, scan `<available-skills>` before acting. Load the most specific skill whose description matches the request; do not answer from memory when one fits. Only call `loadSkill` with an exact listed `<name>`; if none fits, do not load a skill.",

Evidence

  • Conversation: slack:C08J1NSPU6S:1785604967.856429
  • First tool call: loadSkill({ skill_name: "scheduler" }) → Unknown skill: scheduler
  • Recovery: searchTools / scheduler_slackScheduleCreateTask

Verification

  • pnpm --filter @sentry/junior typecheck — pass
  • prettier --check packages/junior/src/chat/prompt.ts — pass
  • unit prompt.test.ts not run here: local vitest blocked by missing Postgres at 127.0.0.1:54322

Risk

Low. Residual: models can still invent skill names from task nouns; skill-policy now forbids that more clearly, and searchTools remains the path for plugin/catalog work.

Requested by David Cramer.

--

View Junior Session Sentry

The available-skills data block duplicated skill routing policy and
said plugin names were skill matches. That caused loadSkill("scheduler")
even though scheduler is only a catalog source.

Keep available-skills as data and consolidate semantic matching plus
exact listed-name validation in the higher-authority skill policy.

Co-Authored-By: David Cramer <[email protected]>
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Aug 1, 2026 5:33pm

Request Review

@dcramer
dcramer marked this pull request as ready for review August 1, 2026 17:33
@github-actions github-actions Bot added the risk: low PR risk score: low label Aug 1, 2026
@dcramer
dcramer merged commit 53d0929 into main Aug 1, 2026
32 checks passed
@dcramer
dcramer deleted the fix/available-skills-plugin-wording branch August 1, 2026 18:37

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 48e7a7c5 Deployed Aug 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant