fix: replace obsolete --message flag with -p in watch and loop#988
fix: replace obsolete --message flag with -p in watch and loop#988tamirdresher merged 1 commit intodevfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates Squad’s “watch” capabilities and “loop” command to stop passing the obsolete --message flag to Copilot, switching to -p, and changes the default runner from gh copilot … to invoking copilot directly (to avoid Windows console window spawning via gh.cmd).
Changes:
- Replace
--messagewith-pacross allbuildAgentCommand/buildLoopAgentCommandcall sites. - Change default agent runner from
cmd: 'gh', args: ['copilot', …]tocmd: 'copilot', args: ['-p', …]. - Fix a token-path variable typo in the Teams comms adapter and update one watch-execute test file expectations.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/squad-cli/src/cli/commands/watch/capabilities/execute.ts | Updates default Copilot invocation to copilot -p … and updates verbose logging default text |
| packages/squad-cli/src/cli/commands/watch/capabilities/decision-hygiene.ts | Replaces --message with -p and switches default cmd to copilot |
| packages/squad-cli/src/cli/commands/watch/capabilities/monitor-email.ts | Replaces --message with -p and switches default cmd to copilot |
| packages/squad-cli/src/cli/commands/watch/capabilities/monitor-teams.ts | Replaces --message with -p and switches default cmd to copilot |
| packages/squad-cli/src/cli/commands/watch/capabilities/retro.ts | Replaces --message with -p and switches default cmd to copilot |
| packages/squad-cli/src/cli/commands/watch/capabilities/wave-dispatch.ts | Replaces --message with -p and switches default cmd to copilot |
| packages/squad-cli/src/cli/commands/watch/index.ts | Updates shared watch helper buildAgentCommand to use copilot -p … by default |
| packages/squad-cli/src/cli/commands/loop.ts | Updates loop agent command builder to use copilot -p … by default |
| packages/squad-sdk/src/platform/comms-teams.ts | Fixes token path variable used in Windows icacls invocation |
| test/cli/watch-execute.test.ts | Updates expectations to match cmd: 'copilot' and -p |
5e53a54 to
b7a38ac
Compare
The Copilot CLI uses -p for non-interactive prompts, not --message. Switches default invocation from gh copilot to copilot directly (the standalone binary available on all platforms). Changes: - 8 source files: --message to -p, cmd changed to copilot - loop.ts: aligned preflight to check copilot --version - comms-teams.ts: fix pre-existing TOKEN_PATH typo from #906 - 2 test files updated (watch-execute + watch-capabilities) - Changeset added for squad-cli + squad-sdk patch bumps Fixes #980 Closes #874 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
b7a38ac to
723f6e2
Compare
|
Hey @tamirdresher — nice fix. Here's a review: PR #988 Review1. Is this a fix for the issue?Yes. The PR correctly updates 2. Is this a fix for the class of issue?Not yet. The underlying pattern — the same command-building logic living in 8 separate places — is still there. This PR applies the right value everywhere, which is the right first step. A follow-up that extracts a shared 3. Does this fix leave technical or structural debt?Some, which is normal for a targeted bug fix:
None of these are blockers for merging — the PR does what it sets out to do. They're just opportunities for the next pass. |
) The Copilot CLI uses -p for non-interactive prompts, not --message. Switches default invocation from gh copilot to copilot directly (the standalone binary available on all platforms). Changes: - 8 source files: --message to -p, cmd changed to copilot - loop.ts: aligned preflight to check copilot --version - comms-teams.ts: fix pre-existing TOKEN_PATH typo from #906 - 2 test files updated (watch-execute + watch-capabilities) - Changeset added for squad-cli + squad-sdk patch bumps Fixes #980 Closes #874 Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Replace obsolete
--messageflag with-pacross all watch capabilities and loop command. Also switch default invocation fromgh copilottocopilotdirectly to avoid Windows console window issues.Root cause
The Copilot CLI uses
-pfor non-interactive prompts.--messagewas never a valid flag and causes immediate failure:error: unknown option '--message'.Additionally,
ghon Windows is a.cmdbatch file that spawns a visible console window even withwindowsHide: true. Usingcopilotdirectly avoids this.Changes
8 source files fixed (same pattern in each
buildAgentCommand/buildLoopAgentCommand):packages/squad-cli/src/cli/commands/watch/capabilities/execute.tspackages/squad-cli/src/cli/commands/watch/capabilities/decision-hygiene.tspackages/squad-cli/src/cli/commands/watch/capabilities/monitor-email.tspackages/squad-cli/src/cli/commands/watch/capabilities/monitor-teams.tspackages/squad-cli/src/cli/commands/watch/capabilities/retro.tspackages/squad-cli/src/cli/commands/watch/capabilities/wave-dispatch.tspackages/squad-cli/src/cli/commands/watch/index.tspackages/squad-cli/src/cli/commands/loop.ts1 pre-existing fix (unblocks build):
packages/squad-sdk/src/platform/comms-teams.ts—TOKEN_PATHtypo from fix(sdk): Teams adapter token security + migration guide #9061 test file updated:
test/cli/watch-execute.test.ts— assertions updated to expectcopilotand-pAll 16 watch-execute tests pass.
Fixes #980
Closes #874