fix: allow empty input for parameterless skills/reasoners#198
Merged
fix: allow empty input for parameterless skills/reasoners#198
Conversation
Remove binding:"required" constraint on Input field in ExecuteRequest and
ExecuteReasonerRequest structs. Gin interprets required on maps as
"must be present AND non-empty", which rejects the valid {"input":{}}
payload that SDKs send for parameterless calls.
Also remove the explicit len(req.Input)==0 check in prepareExecution and
add nil-input guards in the reasoner and skill handlers to match the
existing pattern in execute.go.
Closes #196
…nput # Conflicts: # control-plane/internal/handlers/execute.go
Main added an internalToken parameter to ExecuteHandler in PR #197. Update the two test call sites to pass empty string for the new param. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
AbirAbbas
approved these changes
Mar 2, 2026
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
Fixes #196 —
call()fails with400, input is requiredwhen skill/reasoner has no required params.Changes
control-plane/internal/handlers/execute.go: Removebinding:"required"fromExecuteRequest.Inputfield. Replace the explicitlen(req.Input) == 0rejection with a nil-guard that defaults to empty map.control-plane/internal/handlers/reasoners.go: Removebinding:"required"fromExecuteReasonerRequest.Inputfield. Add nil-input guards in bothExecuteReasonerHandlerandExecuteSkillHandler.control-plane/internal/handlers/empty_input_test.go(new): 7 tests covering:ExecuteHandleraccepts{"input":{}}and{}(end-to-end)ExecuteRequestandExecuteReasonerRequeststructs accept empty/nil inputRoot Cause
Gin's
binding:"required"onmap[string]interface{}rejects empty maps ({}) as "not present". Both SDKs correctly send{"input":{}}for parameterless calls, but the control plane rejected it at two levels:binding:"required")len(req.Input) == 0check inprepareExecutionTesting
All 107 handler tests pass (0 failures). New tests verified via TDD (red → green cycle).