Skip to content

feat: add --runtime to notte functions run - #98

Merged
giordano-lucas merged 1 commit into
mainfrom
feat/functions-run-runtime
Sep 9, 2026
Merged

feat: add --runtime to notte functions run#98
giordano-lucas merged 1 commit into
mainfrom
feat/functions-run-runtime

Conversation

@giordano-lucas

Copy link
Copy Markdown
Member

What

Adds --runtime standard|extended to notte functions run.

Why

The regenerated spec in #97 grew a runtime field on RunFunctionRequest:

// Runtime standard uses Lambda; extended uses the configured AgentCore runtime.
Runtime *RunFunctionRequestRuntime `json:"runtime,omitempty"`

But functions run bypasses the generated client and hand-builds its request body (internal/cmd/functions.go, the manual POST /functions/{function_id}/runs/start entry in endpoint-coverage.txt), so the field was unreachable from the CLI — regenerating alone never surfaces it. functions run also has no *_flags.gen.go, so the flag generator won't pick it up on a future regen either.

How

  • Sent only when the user passes it, matching --no-stream: the server picks the runtime otherwise, and transmitting its current choice would pin today's behaviour into the client.
  • An unknown value is rejected locally (invalid --runtime "lambda": expected standard or extended) rather than becoming a 422. The two values reference the generated api.Standard / api.Extended constants, but the set is hand-written — if the spec grows a third runtime, the switch needs an edit. Flagged in a comment at the site.
  • Shell completion suggests both values.

Testing

  • TestFunctionRun_SendsRuntimeOnlyWhenSet — omit / standard / extended
  • TestFunctionRun_RejectsUnknownRuntime — asserts no request is sent on a bad value
  • go test ./..., make check-endpoints, make check-skills, make lint all clean on top of main.

Note for reviewers

Unrelated but adjacent: the hand-built body sends "function_id", while the spec's RunFunctionRequest declares workflow_id. Either the API accepts both or the field is ignored and the path ID is what counts. Deliberately not touched here — worth confirming before more fields go into that map.

🤖 Generated with Claude Code

The regenerated spec grew a `runtime` field on RunFunctionRequest
(standard uses Lambda, extended the configured AgentCore runtime), but
`functions run` bypasses the generated client and hand-builds its body,
so the field was unreachable from the CLI.

Send it only when asked, like --no-stream: the server picks the runtime
otherwise, and transmitting its current choice would pin it. Reject an
unknown value locally so a typo costs a message rather than a 422.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 9, 2026

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

The implementation appears safe to merge, with a non-blocking test gap around the user-facing Cobra flag wiring.

Summary

  • Preserves server-selected runtime behavior when the flag is omitted.
  • Rejects unsupported values before issuing an API request.
  • Adds request-body tests for omitted, valid, and invalid runtime values.
  • The tests do not exercise the actual Cobra flag-parsing path.

@giordano-lucas
giordano-lucas merged commit daf81c1 into main Sep 9, 2026
3 of 4 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.

1 participant