Skip to content

feat(watch): allow custom agent commands to place the prompt explicitly #1707

Closed

Description

@mavaali

Problem

squad watch --execute --agent-cmd is documented as a custom agent runner
override, but both watch command builders always append the Copilot-specific
-p <prompt> arguments.

That means a custom runner must imitate Copilot CLI's prompt contract. Runners
that use another prompt flag cannot be invoked directly. One motivating example
is Boundary, which accepts the task through --task; other task-oriented agent
CLIs have the same integration problem.

This also leaves a gap between:

Proposed behavior

Allow one standalone {prompt} argv token inside a custom agentCmd:

boundary run ... --task {prompt}

When present, Squad replaces that token with the complete generated prompt as
one argv element. When absent, Squad preserves the current behavior and appends
-p <prompt>.

This is a generic command-contract fix. It does not make alternate engines
feature-equivalent to the default Copilot path.

Acceptance criteria

  • agentCmd with no {prompt} behaves exactly as it does today.
  • One standalone {prompt} token is replaced with the complete prompt as
    one argv element.
  • Embedded forms such as --task={prompt} are not treated as placeholders.
  • More than one {prompt} token fails before spawning with a clear error.
  • Both buildAgentCommand and buildCopilotCommand use the same helper.
  • Existing Windows argument escaping remains in the spawn path.
  • Unit tests cover legacy, placeholder, duplicate-placeholder, and full
    multi-word prompt cases.
  • Watch documentation includes one generic external-runner example and
    states that policy enforcement belongs to the runner.

Non-goals

  • Adding Boundary as a Squad dependency.
  • Implementing a second budget or sandbox policy engine in Squad.
  • Claiming daily/weekly/monthly enforcement from a direct boundary run;
    Boundary currently exposes those windows through schedule/pipeline config.
  • Preserving the default Copilot MCP injection for an alternate agent engine.
  • Treating an estimated-dollar cap as exact GitHub Copilot billing.
  • Replacing Squad's existing model category policy or cost reporting.

References

Activity

  1. bradygaster commented on Aug 14, 2026

    @bradygaster
    Collaborator

    If the goal here is to support a non-Copilot SDK/LLM, we're not going to be adding support for that atm. There is no plan to extend Squad beyond Copilot at this time.

  2. added a commit that references this issue on Aug 24, 2026
    1742d57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions