Prevent inputs param from being stripped from actions_run_trigger tool schema#2417
Open
Prevent inputs param from being stripped from actions_run_trigger tool schema#2417
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes actions_run_trigger schema/argument handling so workflow dispatch inputs are preserved for model/tooling consumers and malformed inputs are surfaced as errors instead of being silently ignored (addresses #1877).
Changes:
- Add an explicit empty
propertiesmap to theinputsJSON schema to prevent it from being stripped during schema processing. - Parse
inputsviaOptionalParam[map[string]any]to return a proper error on type mismatch. - Update the tool schema snapshot to reflect the serialized
properties: {}addition.
Show a summary per file
| File | Description |
|---|---|
| pkg/github/actions.go | Ensures inputs remains in the tool schema and adds strict type-checking/error handling when inputs is provided. |
| pkg/github/toolsnaps/actions_run_trigger.snap | Updates the recorded schema snapshot to include inputs.properties: {}. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
propertiesfield to theinputsparam schema inactions_run_triggerso it is not dropped from the tool schema due to OAI strict mode schema requirements. Also replaces a silent type assertion withOptionalParamfor proper error handling on malformed inputs.Why
Fixes #1877
The
inputsparameter was defined astype: "object"with nopropertiesfield, and OAI strict mode requires object types to include apropertiesfield. Without it, the parameter is not visible to GPT models.What changed
Properties: map[string]*jsonschema.Schema{}to theinputsparam schemainputswithOptionalParam[map[string]any], which returns an error on type mismatch instead of silently dropping the valueMCP impact
inputsparam now serialises with an emptypropertiesfieldPrompts tested (tool changes only)
All testing was done against a mock workflow with optional params - verified across multiple models.
Security / limits
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testDocs