Skip to content

fix(ambient): ensure skill tool invocations happen before text output#158

Merged
dean0x merged 1 commit intomainfrom
fix/ambient-skill-loading
Mar 22, 2026
Merged

fix(ambient): ensure skill tool invocations happen before text output#158
dean0x merged 1 commit intomainfrom
fix/ambient-skill-loading

Conversation

@dean0x
Copy link
Owner

@dean0x dean0x commented Mar 22, 2026

Summary

  • Ambient mode skills were not loading despite correct GUIDED/ORCHESTRATED classification
  • Root cause: model prints "Loading: X, Y" text then skips actual Skill() tool calls — generating prose overrides the tool-call requirement
  • Fix: reverse instruction order in ambient-router SKILL.md and hook preamble so Skill tool invocations must happen before any text output

Changes

  • shared/skills/ambient-router/SKILL.md — IMPORTANT block and Step 4 now require tool calls first, classification text after
  • scripts/hooks/ambient-prompt — preamble reinforces "FIRST tool calls MUST be Skill tool invocations"
  • tests/integration/helpers.ts — sync preamble string
  • tests/ambient.test.ts — sync drift detection expected value
  • CHANGELOG.md — add fix to [Unreleased]

Test plan

  • Build passes (npm run build)
  • All 362 tests pass (npm test)
  • Preamble drift detection test passes (verifies hook ↔ helpers sync)

Skills were not loading despite correct classification because the model
would print "Loading: X, Y" then skip the actual Skill tool calls. Fix
by reversing the instruction order: invoke Skill tools first, then state
classification text. This prevents the model from generating prose that
overrides the tool-call requirement.
@dean0x dean0x merged commit 7091f0e into main Mar 22, 2026
3 of 4 checks passed
@dean0x dean0x deleted the fix/ambient-skill-loading branch March 22, 2026 12:18
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