Skip to content

Set default max to 1 for assign-to-agent safe-output#14867

Merged
pelikhan merged 2 commits intomainfrom
copilot/update-default-values-config
Feb 11, 2026
Merged

Set default max to 1 for assign-to-agent safe-output#14867
pelikhan merged 2 commits intomainfrom
copilot/update-default-values-config

Conversation

Copy link
Contributor

Copilot AI commented Feb 11, 2026

The assign-to-agent safe-output was missing a default max value, allowing unlimited operations when not explicitly configured. The dispatch-workflow safe-output already had the correct default.

Changes

  • Parser: Set default max: 1 in parseAssignToAgentConfig when value is 0
  • Config generation: Modified generateAssignToAgentConfig to accept and apply defaultMax parameter, consistent with other safe-output helpers
  • Tests: Added coverage for default and explicit max behavior for both output types

Behavior

Before:

safe-outputs:
  assign-to-agent:
    name: copilot
# max was 0 (unlimited) by default

After:

safe-outputs:
  assign-to-agent:
    name: copilot
# max defaults to 1

Explicit max values continue to override the default as expected.

Original prompt

The default value for safe-output.assigned-to-agent.max should be 1.
The default value for safe-outputs.dispatch-workflow.max should be 1.


💡 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.

…utputs

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update default values for safe-output configuration Set default max to 1 for assign-to-agent safe-output Feb 11, 2026
Copilot AI requested a review from pelikhan February 11, 2026 02:04
@pelikhan pelikhan marked this pull request as ready for review February 11, 2026 03:17
Copilot AI review requested due to automatic review settings February 11, 2026 03:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds a default max value of 1 to the assign-to-agent safe-output, ensuring consistent behavior with dispatch-workflow and preventing unlimited operations when max is not explicitly configured. The fix is implemented at both the parser level (when reading YAML configuration) and the config generation level (when generating runtime configuration).

Changes:

  • Added default max=1 logic in the parser (parseAssignToAgentConfig) when parsing workflows
  • Modified config generation helper to accept and apply a defaultMax parameter, consistent with other safe-output helpers
  • Added comprehensive test coverage for both default and explicit max behavior for both assign-to-agent and dispatch-workflow

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
pkg/workflow/assign_to_agent.go Sets default max=1 in parser when config.Max is 0
pkg/workflow/safe_outputs_config_generation_helpers.go Added defaultMax parameter to generateAssignToAgentConfig and applies default when max=0
pkg/workflow/safe_outputs_config_generation.go Passes default max value of 1 when calling generateAssignToAgentConfig
pkg/workflow/safe_outputs_default_max_test.go New test file with comprehensive coverage for default and explicit max behavior for both safe-output types

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -32,7 +32,12 @@ func (c *Compiler) parseAssignToAgentConfig(outputMap map[string]any) *AssignToA
return &AssignToAgentConfig{}
Copy link

Copilot AI Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error handling path returns an empty AssignToAgentConfig without setting Max to the default value of 1. While the config generation layer will apply the default later, it would be more consistent with other parsers like assign-to-user (line 31-33 in assign_to_user.go) to set the default in the error case as well. Consider: return &AssignToAgentConfig{BaseSafeOutputConfig: BaseSafeOutputConfig{Max: 1}}

See below for a potential fix:

		// Handle null case: create config with default max
		return &AssignToAgentConfig{
			BaseSafeOutputConfig: BaseSafeOutputConfig{
				Max: 1,
			},
		}

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan merged commit a60f95b into main Feb 11, 2026
164 of 165 checks passed
@pelikhan pelikhan deleted the copilot/update-default-values-config branch February 11, 2026 03:51
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