Skip to content

fix(squad): start coding-agent sessions for squad:copilot issues; rename go/no-go workflows - #219

Merged
EMaher merged 7 commits into
mainfrom
emaher-literate-funicular
Jul 2, 2026
Merged

fix(squad): start coding-agent sessions for squad:copilot issues; rename go/no-go workflows#219
EMaher merged 7 commits into
mainfrom
emaher-literate-funicular

Conversation

@EMaher

@EMaher EMaher commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Two related changes to the squad issue automation:

  1. Fix the squad:copilot → Copilot coding-agent handoff (the reason issues like [Doc Drift] README.md apiops init flags table missing --artifact-dir option #194 sit idle after routing).
  2. Rename the issue go/no-go decision workflows so they group together and are easier to find.

Problem

An issue can be labeled squad:copilot and still never get worked on. That's because the label alone does not start a Copilot coding-agent session — the issue must be assigned to copilot-swe-agent[bot] via the agent-assignment API. That assignment lives in squad-heartbeat.yml (Ralph), but it was gated off two ways:

  • .squad/team.md had no 🤖 Coding Agent entry and no <!-- copilot-auto-assign: true --> marker, so the assign step returned early.
  • The step only picked issues with zero assignees, but issue-go-yes always assigns the go:yes maintainer as owner — so every routed issue was filtered out.

Changes

Part A — repair the handoff

  • .squad/team.md: add a ## Coding Agent section with the 🤖 Coding Agent entry and the <!-- copilot-auto-assign: true --> marker. Placed outside ## Members so it isn't treated as a routable squad member. This also makes issue-labels-sync.yml ensure the squad:copilot label exists.
  • squad-heartbeat.yml (active + .squad/templates/workflows/ copy): assign copilot-swe-agent[bot] to any open squad:copilot issue that doesn't already have the agent, added alongside the human owner (the POST /assignees endpoint appends, it doesn't replace).

Part B — rename go/no-go workflows

Before After Display name
issue-nogo.yml issue-go-no.yml Issue Go: No
issue-assign.md / .lock.yml issue-go-yes.md / .lock.yml Issue Go: Yes
issue-clarify.md / .lock.yml issue-go-clarify.md / .lock.yml Issue Go: Clarify

Display names set via gh-aw frontmatter name: (verified honored), preserving the descriptive agent H1 titles. The agentic .lock.yml files were regenerated with gh aw compile (v0.81.6); unrelated lock files were left untouched.

⚠️ Required manual step

The assign step uses secrets.COPILOT_ASSIGN_TOKEN || secrets.GITHUB_TOKEN. Assigning the coding agent generally requires a PAT — a maintainer must add a COPILOT_ASSIGN_TOKEN repo secret (a token that can assign the Copilot coding agent). Until then the step is a safe no-op.

Validation

  • All four workflow YAML files parse.
  • Both agentic workflows recompile with gh aw compile: 0 errors / 0 warnings.
  • New .lock.yml files carry the correct name/workflow_id; old ones removed; no dangling references to the old names remain.
  • Line endings for the generated lock files stored as LF (index), matching repo convention.

Related Issue(s)

Notes

  • Changes are confined to .github/ and .squad/ (no src//tests/ changes).
  • The installed template .squad/templates/workflows/squad-heartbeat.yml already diverged from the active workflow (action versions, schedule); this PR only syncs the specific assign-step logic. The upstream squad-cli template should get the same fix to survive squad upgrade.

EMaher and others added 5 commits July 2, 2026 10:19
…ame go/no-go workflows

The `squad:copilot` label alone never starts a Copilot coding-agent session — an
issue must be assigned to `copilot-swe-agent[bot]` via the agent-assignment API.
That assignment lives in squad-heartbeat.yml (Ralph), but it was gated off:

- .squad/team.md had no `🤖 Coding Agent` entry and no
  `<!-- copilot-auto-assign: true -->` marker, so the step returned early.
- The step only assigned issues with zero assignees, but issue-go-yes always
  assigns the go:yes maintainer, so every routed issue was skipped.

Fixes:
- team.md: add a Coding Agent section with the auto-assign marker (also makes
  issue-labels-sync ensure the `squad:copilot` label exists).
- squad-heartbeat.yml (active + installed template): assign the bot to any open
  `squad:copilot` issue that does not already have the agent, as an additional
  assignee alongside the human owner.

Also rename the issue go/no-go decision workflows for discoverability:
- issue-nogo.yml   -> issue-go-no.yml      ("Issue Go: No")
- issue-assign.md  -> issue-go-yes.md      ("Issue Go: Yes")
- issue-clarify.md -> issue-go-clarify.md  ("Issue Go: Clarify")
Display names set via gh-aw frontmatter `name:`; agentic .lock.yml recompiled.

NOTE: requires a COPILOT_ASSIGN_TOKEN repo secret (a PAT that can assign the
coding agent) for the assignment step to succeed.

Refs #194

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add a "Setting up COPILOT_ASSIGN_TOKEN" note to the Coding Agent section
with links to fine-grained PAT creation, repository-secret setup, and the
GitHub docs describing the exact token/permissions required to assign the
Copilot coding agent. Docs-only; no workflow/code changes.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add a deterministic post-check step to the "Issue Go: Yes" workflow that
checks whether the approved (go:yes, squad:copilot) issue is actually
assigned to the Copilot coding agent. When the COPILOT_ASSIGN_TOKEN secret
is not configured (so squad-heartbeat cannot auto-assign), it posts a
comment tagging the human assignee(s) explaining they must assign the issue
to Copilot to start the work. When the token IS configured, the step is a
no-op to avoid noise, since Ralph will auto-assign shortly.

Runs in the injection-safe post-check job (not the agentic prompt), so the
logic is deterministic. Grants that job issues:write to post the comment.

Security note: issue-go-yes.lock.yml now references the COPILOT_ASSIGN_TOKEN
secret only inside an expression (secrets.COPILOT_ASSIGN_TOKEN != '') to
detect presence; the secret value is never read, logged, or sent anywhere.

Refs #194

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move the "assign this issue to Copilot" nudge out of the deterministic
post-check job (which required issues:write) into the agent's single
assignment comment, posted through the existing add-comment safe output.
The post-check job is back to issues:read.

Because the agent cannot read secrets, the gating is computed
deterministically in the trusted "Prepare assignment context" shell step:
NUDGE_NEEDED is true only when COPILOT_ASSIGN_TOKEN is absent (evaluated as
the boolean `secrets.COPILOT_ASSIGN_TOKEN != ''`, never the value) AND the
coding agent is not already an assignee. That result is injected into the
trusted system-policy.md so the agent includes or omits the
"### 🤖 Action needed" section accordingly.

Security note: the raw COPILOT_ASSIGN_TOKEN value is materialized in exactly
one place in the compiled lock — gh-aw's "Redact secrets in logs" step — so
its value is scrubbed from agent logs and is never placed in the agent
inference step or the prepare step (which only see the boolean).

Refs #194

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The Copilot-assignment nudge must not expose workflow internals in the
public issue thread. Remove the ".squad/team.md / COPILOT_ASSIGN_TOKEN
setup" reference from the nudge the agent posts, and add explicit guards
(system policy + comment-format template) instructing the agent to never
mention COPILOT_ASSIGN_TOKEN, repository secrets, or workflow internals in
the comment. The nudge now simply asks the assignee to assign the issue to
Copilot from the Assignees menu.

Refs #194

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@EMaher EMaher self-assigned this Jul 2, 2026
@EMaher
EMaher requested a review from Copilot July 2, 2026 18:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 the squad issue automation to (1) reliably start Copilot coding-agent sessions for squad:copilot issues by assigning copilot-swe-agent[bot], and (2) rename the go/no-go workflows so they group consistently in GitHub Actions.

Changes:

  • Update squad-heartbeat to assign the coding agent based on “agent not present” rather than “no assignees”.
  • Add a ## Coding Agent section + <!-- copilot-auto-assign: true --> marker to .squad/team.md so auto-assign is enabled and label sync can ensure squad:copilot exists.
  • Rename go/no-go workflows (and regenerate the corresponding gh-aw lock files) with consistent “Issue Go: *” display names.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
.squad/templates/workflows/squad-heartbeat.yml Template workflow: update Copilot auto-assign filtering logic (agent-presence based).
.squad/team.md Add Coding Agent section + auto-assign marker and COPILOT_ASSIGN_TOKEN setup guidance.
.github/workflows/squad-heartbeat.yml Active workflow: update Copilot auto-assign filtering logic (agent-presence based).
.github/workflows/issue-go-yes.md Rename display name and add deterministic “handoff nudge” context when auto-assign isn’t configured.
.github/workflows/issue-go-yes.lock.yml Regenerated compiled lock workflow reflecting rename + new context logic + secret redaction entries.
.github/workflows/issue-go-no.yml Rename workflow display name to “Issue Go: No”.
.github/workflows/issue-go-clarify.md Rename display name to “Issue Go: Clarify”.
.github/workflows/issue-go-clarify.lock.yml Regenerated compiled lock workflow reflecting rename changes.

Comment thread .github/workflows/squad-heartbeat.yml Outdated
Comment thread .squad/templates/workflows/squad-heartbeat.yml Outdated
EMaher and others added 2 commits July 2, 2026 11:10
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@EMaher
EMaher requested a review from petehauge July 2, 2026 18:11
@EMaher
EMaher merged commit 45c3345 into main Jul 2, 2026
6 checks passed
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