Skip to content

Use MapToolConfig alias as return type for handlerBuilder#19583

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/update-handlerbuilder-return-type
Closed

Use MapToolConfig alias as return type for handlerBuilder#19583
Copilot wants to merge 3 commits intomainfrom
copilot/update-handlerbuilder-return-type

Conversation

Copy link
Contributor

Copilot AI commented Mar 4, 2026

handlerBuilder was returning the raw map[string]any despite MapToolConfig existing as a named alias for exactly this purpose in mcp_config_types.go.

Changes

  • handlerBuilder typedef — return type changed from map[string]any to MapToolConfig
  • Build() on handlerConfigBuilder — return type updated to MapToolConfig; internal field stays map[string]any with an explicit conversion at the return site
  • All function literals in handlerRegistry — declared return types updated to match the new typedef
  • Empty map allocationsmake(map[string]any)make(MapToolConfig) at the two sites that return empty configs to signal handler enablement
// Before
type handlerBuilder func(*SafeOutputsConfig) map[string]any
func (b *handlerConfigBuilder) Build() map[string]any { return b.config }

// After
type handlerBuilder func(*SafeOutputsConfig) MapToolConfig
func (b *handlerConfigBuilder) Build() MapToolConfig { return MapToolConfig(b.config) }

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha .js' --ignore-path .prettierigno-errorsas --local x_amd64/vet credential.userngit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha get --local x_amd64/vet credential.userngit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha get -authored-by: pelikhan <4175913+-ifaceassert tnet/tools/bash user.name (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha json' --ignore-path ../../../.pr**/*.json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha ions-build/main.go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v8 --jq .object.sha '**/*.ts' '**/*.json' --ignore-p-errorsas (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v8
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha .js' --ignore-path .prettierigno-errorsas --local x_amd64/vet credential.userngit (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha get --local x_amd64/vet credential.userninfocmp (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v8 --jq .object.sha tted" -authored-by: pelikhan <4175913+-ifaceassert 64/bin/bash user.name (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v4 --jq .object.sha .js' --ignore-path .prettierigno-errorsas --local x_amd64/vet credential.userngit (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v4
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v4 --jq .object.sha .js' --ignore-path .prettierigno-errorsas --local x_amd64/vet credential.userngh (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha json' --ignore-path ../../../.pr**/*.json (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v7 --jq .object.sha on' --ignore-path ../../../.pret.prettierignore (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Update handlerBuilder return type to MapToolConfig for consistency</issue_title>
<issue_description>## Objective

Improve internal consistency by updating the handlerBuilder function type to return MapToolConfig instead of the raw map[string]any.

Context

Discussion #19575 identified that handlerBuilder in pkg/workflow/compiler_safe_outputs_config.go:132 returns map[string]any while the existing MapToolConfig alias (defined in pkg/workflow/mcp_config_types.go:52) exists specifically for this purpose. Using the alias improves internal consistency and signals intent more clearly.

Files to Modify

  • pkg/workflow/compiler_safe_outputs_config.go — update handlerBuilder typedef at line ~132
  • Any callers of functions using handlerBuilder that may need updating

Steps

  1. Locate the handlerBuilder type definition in pkg/workflow/compiler_safe_outputs_config.go
  2. Change the return type from map[string]any to MapToolConfig
  3. Check all callers and update assignment/usage sites if needed
  4. Run go build ./... to verify

Acceptance Criteria

  • handlerBuilder typedef uses MapToolConfig as return type
  • All callers compile without changes (or are updated)
  • go build ./... passes

Generated by Plan Command for issue #discussion #19575 ·

  • expires on Mar 6, 2026, 11:40 AM UTC

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 2 commits March 4, 2026 11:49
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update handlerBuilder return type to MapToolConfig for consistency Use MapToolConfig alias as return type for handlerBuilder Mar 4, 2026
@pelikhan pelikhan closed this Mar 4, 2026
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.

[plan] Update handlerBuilder return type to MapToolConfig for consistency

2 participants