Skip to content

fix: allow empty input for parameterless skills/reasoners#198

Merged
AbirAbbas merged 4 commits intomainfrom
fix/issue-196-empty-input
Mar 2, 2026
Merged

fix: allow empty input for parameterless skills/reasoners#198
AbirAbbas merged 4 commits intomainfrom
fix/issue-196-empty-input

Conversation

@santoshkumarradha
Copy link
Member

Summary

Fixes #196call() fails with 400, input is required when skill/reasoner has no required params.

Changes

  • control-plane/internal/handlers/execute.go: Remove binding:"required" from ExecuteRequest.Input field. Replace the explicit len(req.Input) == 0 rejection with a nil-guard that defaults to empty map.
  • control-plane/internal/handlers/reasoners.go: Remove binding:"required" from ExecuteReasonerRequest.Input field. Add nil-input guards in both ExecuteReasonerHandler and ExecuteSkillHandler.
  • control-plane/internal/handlers/empty_input_test.go (new): 7 tests covering:
    • Handler-level: ExecuteHandler accepts {"input":{}} and {} (end-to-end)
    • Binding-level: Both ExecuteRequest and ExecuteReasonerRequest structs accept empty/nil input
    • Negative: Invalid JSON still rejected

Root Cause

Gin's binding:"required" on map[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:

  1. Gin binding validation (binding:"required")
  2. Explicit len(req.Input) == 0 check in prepareExecution

Testing

All 107 handler tests pass (0 failures). New tests verified via TDD (red → green cycle).

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
@santoshkumarradha santoshkumarradha requested review from a team and AbirAbbas as code owners March 2, 2026 15:46
santoshkumarradha and others added 3 commits March 2, 2026 21:25
…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 AbirAbbas added this pull request to the merge queue Mar 2, 2026
Merged via the queue into main with commit cbdc23a Mar 2, 2026
18 of 20 checks passed
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.

fix: call() fails with '400, input is required' when skill/reasoner has no required params

2 participants