Skip to content

fix(test): update consult tests to match current consult-mode behavior#645

Closed
diberry wants to merge 1 commit intobradygaster:devfrom
diberry:squad/fix-consult-tests
Closed

fix(test): update consult tests to match current consult-mode behavior#645
diberry wants to merge 1 commit intobradygaster:devfrom
diberry:squad/fix-consult-tests

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Mar 26, 2026

Problem

consult.test.ts failures are pre-existing on dev and blocking upstream PRs #640 and #641.

Root cause

SDK test (test/sdk/consult.test.ts): The setupConsultMode test asserted template-specific content (Coordinator Identity, Team Mode) that is only present when the full squad.agent.md.template is found. When the template lookup falls back to the minimal agent file, those strings are absent.

CLI test (test/cli/consult.test.ts): The beforeEach checked for .squad/ after init --global, but the global init bootstraps personal-squad/ as the personal squad directory.

Fix

  • SDK test: Replaced Coordinator Identity and Team Mode assertions with portable checks: consult-mode preamble, .squad/ context references, and valid frontmatter. These pass regardless of template availability.
  • CLI test: Updated directory check from join(globalConfig, 'squad', '.squad') to join(globalConfig, 'squad', 'personal-squad').

Verification

  • Both test files pass locally (66/66 tests)
  • Zero changes to implementation code — test-only fix

Unblocks: #640, #641

@bradygaster — test-only fix that unblocks the CI failures on PRs #640 and #641. The consult test assertions were fragile (template-specific) and the CLI test used the wrong personal squad path. No implementation changes.

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

larsontim12 pushed a commit to larsontim12/squad that referenced this pull request Mar 27, 2026
…er#650)

* feat: REPL UX polish — figlet banner, proper-case names, keyword emoji, 80-col wrap, activity hints

- Add figlet ASCII art SQUAD banner in header (App.tsx)
- Fix agent name casing: SessionRegistry uses case-insensitive keys, preserves display names (sessions.ts)
- Add keyword-based role emoji fallback matching in getRoleEmoji (lifecycle.ts)
- Add extractAgentHint() to parse coordinator text for specific task descriptions (index.ts)
- Cap content width at 80 columns across App.tsx, MessageStream.tsx, AgentPanel.tsx
- Remove [system] prefix from system messages in MessageStream
- Add slash command passthrough while processing (InputPrompt.tsx)
- Pin header to top via Ink Static block, simplified header content
- Register agents with proper case names, use display names in activity hints
- Update tests: 192 passing

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

* feat: wire REPL telemetry — EventBus bridge, StreamingPipeline, agent metrics, model display

Wire all defined OTel instrumentation into the REPL code path:

- Pass EventBus to initSquadTelemetry() so EventBus→OTel bridge activates (bradygaster#645)
- Instantiate StreamingPipeline and feed message_delta/usage events for token
  and response latency metrics (TTFT, duration, tokens/sec) (bradygaster#646)
- Call recordAgentSpawn/Duration/Error/Destroy from dispatch handlers (bradygaster#647)
- Add model field to AgentSession, display model name in AgentPanel (bradygaster#648)
- Enable shell metrics when OTel endpoint is configured (no longer requires
  SQUAD_TELEMETRY=1) (bradygaster#649)
- Export RuntimeEventBus from SDK barrel for REPL consumption
- Listen for usage events to capture model name and feed to StreamingPipeline
- Update tests: replace stale [WORK]/[STREAM] assertions, update banner/header
  checks for figlet art, update source-code parsing tests for simplified header

Closes bradygaster#644, bradygaster#645, bradygaster#646, bradygaster#647, bradygaster#648, bradygaster#649

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster requested a review from Copilot March 27, 2026 21:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates consult-mode tests to match the SDK/CLI’s current behavior, removing fragile assertions that depended on the presence of the full squad.agent.md.template and correcting the expected global personal squad directory path.

Changes:

  • SDK: Replace template-specific assertions in setupConsultMode tests with checks that work for both full-template and fallback agent generation.
  • CLI: Fix init --global test expectation to validate personal-squad/ creation instead of .squad/.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/sdk/consult.test.ts Makes consult-mode agent file assertions portable across template vs fallback behavior.
test/cli/consult.test.ts Updates the expected global personal squad path to personal-squad/.

expect(content).toContain('Coordinator Identity');
expect(content).toContain('Team Mode');
// Should reference local .squad/ context (present in both template and fallback)
expect(content).toContain('.squad/');
Copy link

Copilot AI Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .squad/ assertion doesn’t actually validate “squad context references” because CONSULT_MODE_PREAMBLE already contains .squad/, so this will pass even if the rest of the agent template stops referencing the local squad copy. Consider asserting for a more specific path (e.g., .squad/decisions.md / .squad/team.md) or checking that the consult preamble is injected after the frontmatter delimiter(s).

Suggested change
expect(content).toContain('.squad/');
expect(content).toContain('.squad/decisions.md');

Copilot uses AI. Check for mistakes.
@bradygaster
Copy link
Copy Markdown
Owner

@copilot apply changes based on the comments in this thread

@diberry diberry marked this pull request as draft March 28, 2026 14:13
@diberry diberry force-pushed the squad/fix-consult-tests branch from 4ea133d to 3560404 Compare March 28, 2026 14:19
- SDK test: Replace template-specific assertions (Coordinator Identity,
  Team Mode) with portable checks (preamble, .squad/ references,
  frontmatter). The agent file content varies depending on whether the
  full template is available, so tests should verify consult-mode
  behavior, not template availability.

- CLI test: Update personal squad directory check from .squad/ to
  personal-squad/ to match the init --global output structure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@diberry diberry force-pushed the squad/fix-consult-tests branch from 3560404 to be02218 Compare March 28, 2026 14:26
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Mar 28, 2026

Closing -- will re-open via fork-first pipeline when fully polished.

@diberry diberry closed this Mar 28, 2026
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.

3 participants