Skip to content

update_issue safe output fails on workflow_dispatch from centralized slash-command routing (issue context missing) #39504

@consulthys

Description

@consulthys

Summary

When a workflow uses centralized slash_command routing (strategy: centralized), the child workflow runs as workflow_dispatch. The add_comment safe-output handler resolves the target issue from caller/aw_context, but **update_issue with target: triggering fails because github.event.issue is absent.

This causes partial delivery: comments post successfully, body updates do not. The workflow run is marked failed even when the agent completed.

We hit the same class of problem earlier with skip-bots checking GITHUB_ACTOR on the dispatched run (github-actions[bot]) instead of the originating human. Membership checks already use aw_context on workflow_dispatch; update_issue (and possibly add_labels / remove_labels) need the same treatment.

Environment

  • gh-aw compiler: v0.79.8
  • Host: GitHub.com, organization-owned private repository
  • Workflow pattern:
    slash_command:
      name: refresh-proposal
      events: [issue_comment]
      strategy: centralized
    safe-outputs:
      update-issue:
        body: true
        max: 1
      add-comment:
        max: 4
  • Trigger: Human issue_comment with slash command /refresh-proposal on an issue
  • Child run event: workflow_dispatch (dispatched by Agentic Commands router)
  • Example failed run ID: 27599222275 (unique within the repository; not globally identifiable without repo access)

Note on run IDs: GitHub Actions run IDs are unique per repository, not across all of GitHub. We are not sharing the repository name or a run URL.

Steps to reproduce

  1. Configure a workflow with centralized slash_command on issue_comment and update-issue + add-comment safe outputs.
  2. Comment the slash command on an issue (e.g. /refresh-proposal).
  3. Agentic Commands router dispatches the target workflow via workflow_dispatch.
  4. Agent completes and emits safe outputs: update_issue then add_comment(s).

Actual behavior

Safe output Result
update_issue (message 1/3) Failed
add_comment (messages 2–3) Succeeded

safe_outputs log:

Processing message 1/3: update_issue
##[warning]Target is "triggering" but not running in issue context, skipping update_issue
##[error]✗ Message 1 (update_issue) failed: Target is "triggering" but not running in issue context, skipping update_issue

Processing message 2/3: add_comment
Resolved target issue #3 (target config: triggering)
✓ Message 2 (add_comment) completed successfully

Processing message 3/3: add_comment
✓ Message 3 (add_comment) completed successfully

Successful: 2
Failed: 1
  • Child run event: workflow_dispatch (not issue_comment)
  • add_comment resolves the triggering issue from caller context (GH_AW_COMMENT_ID / aw_context)
  • Issue body is not updated
  • Overall workflow conclusion: failure (“failed to deliver outputs”)

Expected behavior

On workflow_dispatch dispatched by centralized slash-command routing, update_issue with target: triggering should resolve the same issue that add_comment already resolves from aw_context (issue number, comment id, or equivalent caller payload).

Same pattern as team membership validation, which already logs:

Validating centralized workflow_dispatch against originating actor '<user>'
✓ command_name 'refresh-proposal' resolved from workflow_dispatch aw_context

Impact

For issue-only workflows that must rewrite the issue body (e.g. freeze a submission template into a canonical section), centralized routing blocks a core safe output. Workarounds are awkward:

  • Dropping centralized routing is blocked when the same workflow also needs issues: opened (compiler error: cannot combine slash_command + issues without centralized strategy).
  • Instructing the agent to use gh issue edit via bash bypasses safe outputs and is undesirable.

Suggested fix

In the update_issue handler (and likely add_labels / remove_labels with target: triggering), when github.event_name === 'workflow_dispatch' and caller/aw_context includes issue context:

  1. Resolve issue number/repo from the same source add_comment uses today.
  2. Apply the body/label update to that issue.
  3. Do not require github.event.issue on the dispatched event.

Related

  • Centralized routing + skip-bots false negative on github-actions[bot] actor (repo-side workaround: removed skip-bots).
  • Agentic workflows no longer need a PAT (org-billed GITHUB_TOKEN; unrelated but same test setup).

Workaround today

None clean within safe outputs + centralized routing. Manual issue body edit or wait for this fix.

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions