Skip to content

squad files: include mode/ agent sources, pinned to the OpenCode loader (#52) - #83

Merged
AlexMKX merged 1 commit into
masterfrom
fix/mode-roots-52
Nov 19, 2026
Merged

AlexMKX merged 1 commit into
masterfrom
fix/mode-roots-52

Conversation

@AlexMKX

@AlexMKX AlexMKX commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Closes #52.

What remained after #80. Squad scanned agent/ and agents/, but the pinned OpenCode 2.1.3 config-agent loader has one more source. Its legacySources are:

  • {agent,agents}/**/*.md: subagents, recursive;
  • {mode,modes}/*.md: primary agents, top level only.

A mode/review.md link onto agent/grunt-a-b.md was therefore a second, primary agent name for the same file. Squad saw no conflict, so the startup refresh and the apply both rewrote the file.

Change (src/squad-apply.js)

Keeping it in step with OpenCode. the agent sources match the installed OpenCode loader reads legacySources from the installed @opencode/core and compares it with AGENT_SOURCES. An OpenCode bump that adds or changes a source now fails that test instead of reopening this issue. Mutation: dropping modes from AGENT_SOURCES fails it.

Tests (tests/regress-squad-files.test.js). Both fail on master:

  • a primary-agent alias in mode/ shares the file; one in mode/sub/ is never loaded: the issue's layout plus the depth boundary. Dump, startup and apply all leave the file intact and name both paths.
  • the loader parity test above.

Out of reach, as before. Other config dirs that OpenCode merges (a project's .opencode/) are not known to Squad, which writes only the global agent dir.

🤖 Generated with Claude Code

…he installed OpenCode (#52)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Roster mutations can address the same file through different agent paths

1 participant