Skip to content

[DO NOT MERGE] fix(loop): replace obsolete --message flag with -p in gh copilot invocations (wait)#894

Closed
diberry wants to merge 1 commit intodevfrom
squad/874-fix-copilot-message-flag
Closed

[DO NOT MERGE] fix(loop): replace obsolete --message flag with -p in gh copilot invocations (wait)#894
diberry wants to merge 1 commit intodevfrom
squad/874-fix-copilot-message-flag

Conversation

@diberry
Copy link
Copy Markdown
Collaborator

@diberry diberry commented Apr 7, 2026

Summary

Replaces the obsolete --message\ flag with -p\ in all \gh copilot\ invocations. The current GitHub CLI Copilot extension uses -p\ (for prompt), not --message, causing loop/watch/capabilities to fail immediately.

Changes

  • New: \packages/squad-cli/src/cli/commands/copilot-args.ts\ — centralized \�uildCopilotArgs(prompt, options)\ helper. Single source of truth for the Copilot CLI prompt flag.
  • Updated: 8 files that each had their own copy of the command builder:
    • \loop.ts\ — \�uildLoopAgentCommand\ now delegates to \�uildCopilotArgs\
    • \watch/index.ts\ — \�uildAgentCommand\ now delegates to \�uildCopilotArgs\
    • 6 watch capabilities (execute, decision-hygiene, monitor-email, monitor-teams, retro, wave-dispatch) — replaced inline \�uildAgentCommand\ with import
  • Tests: New \ est/cli/copilot-args.test.ts\ with 12 test cases. Updated \watch-execute.test.ts\ to expect -p.

Why centralize?

When the CLI surface changes again (it's happened before), we fix one file instead of eight. The helper also handles edge cases (whitespace-only agentCmd/copilotFlags) that the duplicated code didn't.

Working as GNC (Node.js Runtime)

Closes #874

Copilot AI review requested due to automatic review settings April 7, 2026 03:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🟡 Impact Analysis — PR #894

Risk tier: 🟡 MEDIUM

📊 Summary

Metric Count
Files changed 13
Files added 3
Files modified 10
Files deleted 0
Modules touched 3
Critical files 1

🎯 Risk Factors

  • 13 files changed (6-20 → MEDIUM)
  • 3 modules touched (2-4 → MEDIUM)
  • Critical files touched: packages/squad-cli/src/cli/commands/watch/index.ts

📦 Modules Affected

root (1 file)
  • .changeset/fix-copilot-message-flag.md
squad-cli (9 files)
  • packages/squad-cli/src/cli/commands/copilot-args.ts
  • packages/squad-cli/src/cli/commands/loop.ts
  • packages/squad-cli/src/cli/commands/watch/capabilities/decision-hygiene.ts
  • packages/squad-cli/src/cli/commands/watch/capabilities/execute.ts
  • packages/squad-cli/src/cli/commands/watch/capabilities/monitor-email.ts
  • packages/squad-cli/src/cli/commands/watch/capabilities/monitor-teams.ts
  • packages/squad-cli/src/cli/commands/watch/capabilities/retro.ts
  • packages/squad-cli/src/cli/commands/watch/capabilities/wave-dispatch.ts
  • packages/squad-cli/src/cli/commands/watch/index.ts
tests (3 files)
  • test/cli/copilot-args.test.ts
  • test/cli/watch-capabilities.test.ts
  • test/cli/watch-execute.test.ts

⚠️ Critical Files

  • packages/squad-cli/src/cli/commands/watch/index.ts

This report is generated automatically for every PR. See #733 for details.

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

Updates Squad CLI’s Copilot spawning to match the current GitHub CLI Copilot extension by replacing the obsolete --message flag with -p, and centralizes command/arg construction to avoid future drift across loop/watch/capabilities.

Changes:

  • Added buildCopilotArgs() helper to generate { cmd, args } for execFile and enforce -p consistently.
  • Replaced per-file inline Copilot arg builders in loop, watch, and multiple watch capabilities with the centralized helper.
  • Added unit tests for the helper and updated watch execute tests to expect -p; included a changeset for @bradygaster/squad-cli.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/squad-cli/src/cli/commands/copilot-args.ts New centralized helper for gh copilot spawn args (uses -p).
packages/squad-cli/src/cli/commands/loop.ts Loop now delegates agent command construction to buildCopilotArgs().
packages/squad-cli/src/cli/commands/watch/index.ts Watch command builder now delegates to buildCopilotArgs().
packages/squad-cli/src/cli/commands/watch/capabilities/execute.ts Execute capability now uses centralized Copilot arg builder.
packages/squad-cli/src/cli/commands/watch/capabilities/decision-hygiene.ts Delegates Copilot spawn args to centralized helper.
packages/squad-cli/src/cli/commands/watch/capabilities/monitor-email.ts Delegates Copilot spawn args to centralized helper.
packages/squad-cli/src/cli/commands/watch/capabilities/monitor-teams.ts Delegates Copilot spawn args to centralized helper.
packages/squad-cli/src/cli/commands/watch/capabilities/retro.ts Delegates Copilot spawn args to centralized helper.
packages/squad-cli/src/cli/commands/watch/capabilities/wave-dispatch.ts Delegates Copilot spawn args to centralized helper.
test/cli/copilot-args.test.ts New unit tests validating buildCopilotArgs() behavior and edge cases.
test/cli/watch-execute.test.ts Updated expectations to require -p instead of --message.
.changeset/fix-copilot-message-flag.md Patch changeset documenting the CLI behavior change.

Comment thread packages/squad-cli/src/cli/commands/loop.ts
Comment thread packages/squad-cli/src/cli/commands/copilot-args.ts
Comment thread test/cli/watch-execute.test.ts
@diberry diberry force-pushed the squad/874-fix-copilot-message-flag branch from 53cfce8 to 82d7bf0 Compare April 8, 2026 14:22
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Apr 8, 2026

Is this introducing issues that 916 is meant to fix?

@diberry diberry force-pushed the squad/874-fix-copilot-message-flag branch 2 times, most recently from 12f331e to 19cd9ff Compare April 8, 2026 16:53
@diberry
Copy link
Copy Markdown
Collaborator Author

diberry commented Apr 8, 2026

🔍 Squad Review — Kaylee (Engineering)

# Check Status Notes
1 Changelog entry .changeset/fix-copilot-message-flag.md (CLI patch)
2 Squashed to 1 commit 1 commit
3 CI green est job failed — investigate and fix before merge
4 Copilot comments resolved 3/3 threads resolved with fixes
5 No .squad/ files Clean
6 No unrelated files 13 files — all scoped to copilot args centralization
7 Tests for changes est/cli/copilot-args.test.ts (12 tests), watch-execute.test.ts + watch-capabilities.test.ts updated
8 Not a duplicate/reversal Unique scope (closes #874)

Verdict: ❌ 1 blocker to fix — CI est job is failing. Mergeable state is �locked.


Review by Squad AI team (Kaylee — Engineering) · requested by Dina Berry

Copy link
Copy Markdown
Collaborator Author

@diberry diberry left a comment

Choose a reason for hiding this comment

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

required: Branch is behind dev — needs rebase before merge.

suggestion: No minimum gh copilot version documented. Users on older versions will hit a cryptic failure with -p. A note in CHANGELOG or README would protect them.

suggestion: loop.test.ts has zero assertions that buildLoopAgentCommand produces -p. The centralized copilot-args.test.ts covers the helper well, but an integration-level check in loop.test.ts would be good.

nit: buildLoopAgentCommand is now a 1-line wrapper — call site could import buildCopilotArgs directly.

@diberry diberry force-pushed the squad/874-fix-copilot-message-flag branch from 19cd9ff to 18a4e42 Compare April 10, 2026 04:03
@diberry diberry changed the title fix(loop): replace obsolete --message flag with -p in gh copilot invocations fix(loop): replace obsolete --message flag with -p in gh copilot invocations (wait) Apr 10, 2026
@diberry diberry changed the title fix(loop): replace obsolete --message flag with -p in gh copilot invocations (wait) [DO NOT MERGE] fix(loop): replace obsolete --message flag with -p in gh copilot invocations (wait) Apr 10, 2026
@diberry diberry closed this Apr 12, 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.

loop uses obsolete gh copilot --message flag

2 participants