fix(test): update consult tests to match current consult-mode behavior#645
fix(test): update consult tests to match current consult-mode behavior#645diberry wants to merge 1 commit intobradygaster:devfrom
Conversation
…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>
There was a problem hiding this comment.
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
setupConsultModetests with checks that work for both full-template and fallback agent generation. - CLI: Fix
init --globaltest expectation to validatepersonal-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/. |
test/sdk/consult.test.ts
Outdated
| 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/'); |
There was a problem hiding this comment.
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).
| expect(content).toContain('.squad/'); | |
| expect(content).toContain('.squad/decisions.md'); |
|
@copilot apply changes based on the comments in this thread |
4ea133d to
3560404
Compare
- 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>
3560404 to
be02218
Compare
|
Closing -- will re-open via fork-first pipeline when fully polished. |
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
Verification
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