fix: always send variables field in function run/schedule requests#17
Merged
giordano-lucas merged 1 commit intomainfrom Mar 16, 2026
Merged
fix: always send variables field in function run/schedule requests#17giordano-lucas merged 1 commit intomainfrom
giordano-lucas merged 1 commit intomainfrom
Conversation
The API now requires the `variables` field in the request body. Previously it was only included when the user explicitly provided variables via flags. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
variablesfield (as{}when empty) in thefunctions runrequest body — the API now requires itVariablesto an empty map onfunctions schedulerequest body so it's serialized instead of omittedFixes 3 integration test failures:
TestFunctionIDResolution,TestFunctionRun,TestFunctionsScheduleAndUnscheduleTest plan
notte functions runworks without--var/--varsflagsnotte functions run --var key=valuestill worksnotte functions scheduleworks🤖 Generated with Claude Code
Greptile Summary
This PR fixes two API serialization issues where required fields were being omitted from request bodies, causing integration test failures.
runFunctionRun: Removes thelen(variables) > 0guard so"variables"is always serialized (as{}when no variables are provided), matching the API's requirement.runFunctionSchedule: InitializesVariablesto&emptyVars(a pointer to an emptymap[string]interface{}) so the field is serialized as"variables": {}instead of being omitted due to theomitemptyJSON tag on the*map[string]interface{}pointer.Confidence Score: 5/5
variablesinrunFunctionRunwas already initialized to an empty map, so always including it is a safe no-op when no variables are provided. InrunFunctionSchedule, assigning a non-nil pointer toVariablescorrectly forces JSON serialization despite theomitemptytag. No logic is altered beyond ensuring the fields are present in the serialized body.Important Files Changed
variablesfield in function run request body and initializesVariablesto an empty map pointer for schedule requests so it is serialized rather than omitted.Last reviewed commit: 2641b15