Skip to content

fix: platform-neutral routing enforcement for VS Code (#613)#617

Merged
bradygaster merged 13 commits intodevfrom
squad/613-vscode-routing-enforcement
Mar 26, 2026
Merged

fix: platform-neutral routing enforcement for VS Code (#613)#617
bradygaster merged 13 commits intodevfrom
squad/613-vscode-routing-enforcement

Conversation

@bradygaster
Copy link
Copy Markdown
Owner

Summary

Fixes #613 — VS Code Autopilot was bypassing Squad routing because the CRITICAL RULE said 'must use the \ ask\ tool' but VS Code's dispatch tool is
unSubagent. The coordinator fell through to inline work instead of dispatching.

Changes

Fix 1: Platform-Neutral Enforcement Language (P0)

  • Rewrote CRITICAL RULE from CLI-specific to dispatcher-identity framing
  • Added explicit dispatch mechanism table: CLI → \ ask, VS Code →
    unSubagent, fallback → inline (last resort)
  • Updated all 7 enforcement-context references throughout \squad.agent.md\
  • Anti-patterns, Constraints, and Spawn sections now mention both dispatch mechanisms

Fix 2: Top-and-Bottom Reinforcement (P0)

  • Added \⚠️ Routing Enforcement Reminder\ as the final section in \squad.agent.md\
  • Exploits LLM prompt-boundary attention bias (start + end weighting)
  • Reinforces: coordinator routes, does not build

Root Cause

The enforcement language created a logical gap:

  1. Coordinator reads 'you MUST use \ ask'
  2. \ ask\ tool isn't available in VS Code (it's
    unSubagent)
  3. Falls through to fallback mode → works inline
  4. Routing silently bypassed

The new platform-neutral language closes this gap entirely.

Verification

  • ✅ All 5 copies of \squad.agent.md\ synced via \sync-templates.mjs\
  • ✅ Build clean (tsc, template sync, skill sync)
  • ✅ FIDO reviewed and approved — all enforcement references consistent
  • ✅ Zero remaining CLI-only enforcement language in enforcement contexts

Files Changed

\
6 files changed, 158 insertions(+), 30 deletions(-)
\
Prompt-only change — zero runtime code impact.

P1 Follow-ups (not blocking)

  • Template renaming (.agent.md.template) to prevent CLI 1.0.11 discovery duplication
  • Prompt slimming (~950 → ~600 lines)
  • VS Code dispatch block relocation (closer to CRITICAL RULE)

Working as Procedures (Prompt Engineer)

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Copilot AI added 7 commits March 23, 2026 17:23
Merged 12 decision inbox entries into decisions.md. Logged mega-session
covering release recovery, docs fix, 10 PR merges, discussion triage,
and release hardening. Updated agent histories with session learnings.

Deleted inbox files after merge:
- booster-ci-audit.md, booster-ci-cleanup.md
- copilot-directive-2026-03-23T09-56.md, copilot-directive-2026-03-23T10-08.md
- copilot-directive-no-npx.md
- eecom-version-cmd.md
- pao-discussion-triage-2026-03-23.md, pao-npx-purge.md, pao-readme-slim.md
- pao-v090-blog.md
- surgeon-v090-changelog.md, surgeon-v091-retrospective.md

Updated files:
- .squad/decisions.md (12 decision entries merged)
- .squad/identity/now.md (current state updated)
- .squad/log/2026-03-23T22-00-00Z-mega-session-wrapup.md (new)
- .squad/agents/flight/history.md (issue filing patterns, governance directives)
- .squad/agents/eecom/history.md (CLI version subcommand pattern)
- .squad/agents/booster/history.md (CI audit and preflight patterns)
- .squad/agents/surgeon/history.md (release governance rules, retrospective)
- .squad/agents/pao/history.md (discussion triage patterns, Teams MCP urgency)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- v0.9.1 (Current Release): Bug fixes and hardening
  - Shell agent name extraction with multi-pattern fallback
  - Init scaffolding for typed casting files
  - Personal squad global mode support
  - Release CI/docs hardening
  - Doctor command improvements

- v0.9.0 (Major Feature): 6 major features + stability fixes
  - Personal Squad Governance Layer (isolated developer workspaces)
  - Worktree Spawning & Distributed Work (parallel agent orchestration)
  - Machine Capability Discovery (auto-detect tools/models/hardware)
  - Cooperative Rate Limiting (predictive circuit breaker + economy mode)
  - Telemetry & Infrastructure (auto-wire, KEDA, session recovery)
  - Docs, Stability & Distribution (Astro enhancements, npm-only)

- v0.8.2: Renamed from 'Current Release' to historic entry

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Flight triaged 14 untriaged GitHub issues, created prioritized work plan
- FIDO reviewed 10 open PRs, identified 3 duplicate/overlap pairs
- Merged 2 decisions from inbox to decisions.md
- Updated Flight and FIDO agent history with team updates
- Orchestration logs: 2026-03-25T15-23-flight.md, 2026-03-25T15-23-fido.md
- Session log: 2026-03-25T15-23-triage-session.md

Work session priority established:
- #610 → PAO (broken link, 5 min fix, unblocks #611)
- #590 → EECOM (getPersonalSquadRoot bug, P0)
- #592, #611 → Flight review
- #588 → Procedures (model list update)

PR deduplication: 10 PRs consolidate to 7
- Merge: #607, #603, #606
- Close as duplicates: #605, #604, #602

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Round 1 outcomes:
- PAO: #610 docs link already resolved
- EECOM: #590 personal squad path fix (getPersonalSquadRoot)
- Procedures: #588 model catalog updated to current platform
- Flight: #612 community issue filed on routing regression
- CAPCOM: CLI platform research — identified 8 releases (1.0.4→1.0.11) with 3 high-impact changes
- GNC: Squad codebase research — routing regression caused by v0.9.0 prompt saturation + missing name param

Round 2: Code review & quality gate
- FIDO: Found same bug in shell/index.ts, enforced revision
- CONTROL: Full sweep of #590 fix, awaiting FIDO re-review

Merged decisions:
1. Personal squad path canonicalization (personal-squad/)
2. Model catalog refresh (claude-sonnet-4.6, gpt-5.3-codex defaults)
3. CLI platform analysis (monorepo discovery, idle hiding, hook injection)
4. Squad regression analysis (prompt saturation, workstream replacement, missing name param)

Logs created:
- 6 orchestration logs (one per agent)
- 1 session synthesis log with research synthesis
- 4 agent history updates (team update annotations)

All inbox decision files merged and deleted.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Merged procedures-vscode-routing-fix.md from inbox to decisions.md
- Cleared decision inbox after merge
- Logged session finalization work

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster
Copy link
Copy Markdown
Owner Author

🔍 Squad Team Review

Reviewed by: FIDO (Quality Owner) — Pass 3 of consensus ceremony
Merge Order Position: #5 of 6 (Phase 1)
Team Consensus: 5/5 AGREE

Review Summary

This PR fixes platform-neutral routing enforcement language in squad.agent.md. The fix rewrites the CRITICAL RULE from CLI-specific ("MUST use the ask tool") to dispatcher-identity framing ("You are a DISPATCHER, not a DOER") with an explicit dispatch mechanism table (CLI → ask, VS Code →
unSubagent, fallback → inline). All 7 enforcement-context references are updated consistently across anti-patterns, constraints, spawn template, and a new top-and-bottom reinforcement section. Zero runtime code impact — prompt-only change addressing issue #613 (VS Code Autopilot bypassing Squad routing).

Dependencies

Must merge AFTER #624 (which updates the sync script to read .agent.md.template files). No conflict with #619 — they modify different sections.

Merge Plan

This PR is part of the team-agreed merge sequence:

  1. fix: getPersonalSquadRoot() returns correct personal-squad path (#590) #620 — getPersonalSquadRoot() fix
  2. fix: add count-based fallback to archiveDecisions() (#626) #627 — archiveDecisions() fallback
  3. fix: rename template copies to prevent CLI instruction merging (#613) #624 — rename templates (infra)
  4. docs: TypeDoc API reference — build pipeline, tests, navigation #611 — TypeDoc pipeline
  5. fix: platform-neutral routing enforcement for VS Code (#613) #617 — routing enforcement ← YOU ARE HERE
  6. chore: update model catalog in squad.agent.md (#588) #619 — model catalog
  7. POST:
    ode scripts/sync-templates.mjs + delete orphan old-name files

Verdict: APPROVED for merge in sequence

Copilot AI added 6 commits March 25, 2026 23:32
- Rewrite CRITICAL RULE to be platform-neutral (task + runSubagent)
- Update all enforcement references to mention both dispatch mechanisms
- Add routing reinforcement reminder at prompt boundary
- Addresses VS Code Autopilot routing bypass reported in #613

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster force-pushed the squad/613-vscode-routing-enforcement branch from 481a977 to 9cdc89e Compare March 26, 2026 06:34
@bradygaster bradygaster merged commit a696b02 into dev Mar 26, 2026
3 checks passed
@bradygaster bradygaster deleted the squad/613-vscode-routing-enforcement branch March 26, 2026 06:34
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.

bug: VSCode Autopilot breaks Squad agent execution

2 participants