Skip to content

fix(runtime): defer invoke required flag validation - #1876

Merged
tejaskash merged 1 commit into
refactorfrom
fix/runtime-invoke-optional-flags
Jul 30, 2026
Merged

fix(runtime): defer invoke required flag validation#1876
tejaskash merged 1 commit into
refactorfrom
fix/runtime-invoke-optional-flags

Conversation

@aidandaly24

Copy link
Copy Markdown
Contributor

Summary

  • declare Runtime invoke --id and --payload as optional at the Commander boundary
  • validate omitted required values inside the handler while preserving usage exit codes
  • verify bare runtime invoke reaches the existing TUI middleware and empty payloads remain valid

Testing

  • bun test src/handlers/runtime/invoke (54 pass)
  • bun test (538 pass)
  • bun run typecheck
  • bun run lint:check
  • bun run format:check
  • bun run build

@github-actions github-actions Bot added agentcore-harness-reviewing AgentCore Harness review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Jul 30, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.86%. Comparing base (8e2cecf) to head (2209c5c).

Additional details and impacted files
@@            Coverage Diff            @@
##           refactor    #1876   +/-   ##
=========================================
  Coverage     95.85%   95.86%           
=========================================
  Files           198      198           
  Lines          9341     9352   +11     
=========================================
+ Hits           8954     8965   +11     
  Misses          387      387           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tejaskash tejaskash left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

handle: async (ctx, flags) => {
if (flags.id === undefined) {
throw new InputValidationError("required option '--id <id>' not specified", {
exitCode: ExitCode.USAGE,

@Hweinstock Hweinstock Jul 30, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't realize that 2 was the standard for validation exceptions. Should we make this the default on the input validation error class? (could be a follow-up)

@tejaskash
tejaskash merged commit 69aa0c1 into refactor Jul 30, 2026
9 of 10 checks passed
@tejaskash
tejaskash deleted the fix/runtime-invoke-optional-flags branch July 30, 2026 18:40
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.

4 participants