Skip to content

Add ignore-if-error field to assign-to-agent safe output#11282

Merged
pelikhan merged 3 commits intomainfrom
copilot/add-ignore-if-missing-field
Jan 22, 2026
Merged

Add ignore-if-error field to assign-to-agent safe output#11282
pelikhan merged 3 commits intomainfrom
copilot/add-ignore-if-missing-field

Conversation

Copy link
Contributor

Copilot AI commented Jan 22, 2026

Workflows currently fail when assign-to-agent cannot authenticate due to missing or invalid GH_AW_AGENT_TOKEN. This adds an optional ignore-if-error boolean field to allow workflows to continue when agent assignment is non-critical.

Changes

Schema & Configuration

  • Added ignore-if-error boolean field to AssignToAgentConfig (default: false)
  • Updated JSON schema with field definition and description

JavaScript Handler

  • Detects authentication errors (Bad credentials, Resource not accessible, Insufficient permissions)
  • When ignore-if-error: true and auth error occurs: logs warning, marks assignment as skipped, continues workflow
  • Modified findAgent helper to re-throw auth errors (previously swallowed) for upstream handling
  • Step summary differentiates skipped assignments with ⏭️ icon

Environment Variables

  • Passes ignore-if-error config as GH_AW_AGENT_IGNORE_IF_ERROR env var to handler

Usage

safe-outputs:
  assign-to-agent:
    name: copilot
    ignore-if-error: true  # Workflow continues if assignment fails

Behavior:

  • ignore-if-error: false (default): Fails workflow if agent assignment fails
  • ignore-if-error: true: Logs warning, skips assignment, continues workflow

Testing

Added test coverage for:

  • Auth errors with flag enabled (skips gracefully)
  • Auth errors with flag disabled (fails as expected)
  • Permission errors (Resource not accessible)
  • Non-auth errors (still fail even with flag enabled)
Original prompt

Add "ignore-if-missing" Boolean field to "assign-to-agent" safe if the agent token is NOT available when trying to assign the issue


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@pelikhan
Copy link
Contributor

@copilot

  • rename field to "ignore-if-error"

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ignore-if-missing Boolean field to assign-to-agent Add ignore-if-missing field to assign-to-agent safe output Jan 22, 2026
Copilot AI requested a review from pelikhan January 22, 2026 13:43
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 22, 2026

@copilot

  • rename field to "ignore-if-error"

Renamed from ignore-if-missing to ignore-if-error in commit 4f510e1. The field now reflects that it handles any assignment error, not just missing tokens.

Copilot AI changed the title Add ignore-if-missing field to assign-to-agent safe output Add ignore-if-error field to assign-to-agent safe output Jan 22, 2026
@pelikhan pelikhan marked this pull request as ready for review January 22, 2026 13:56
@pelikhan
Copy link
Contributor

@mnkiefer for campaigns

@pelikhan pelikhan merged commit e42f3f5 into main Jan 22, 2026
117 checks passed
@pelikhan pelikhan deleted the copilot/add-ignore-if-missing-field branch January 22, 2026 14:33
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.

2 participants