Skip to content

feat(runtime): add interactive invoke console - #1871

Open
aidandaly24 wants to merge 24 commits into
refactorfrom
feat/runtime-invoke-tui
Open

feat(runtime): add interactive invoke console#1871
aidandaly24 wants to merge 24 commits into
refactorfrom
feat/runtime-invoke-tui

Conversation

@aidandaly24

Copy link
Copy Markdown
Contributor

Description

Adds a persistent interactive console for agentcore runtime invoke on top of the headless Runtime invocation support merged in #1820.

Running agentcore runtime invoke without a payload now opens the Runtime and endpoint pickers. --id skips the Runtime picker, while --id with --qualifier opens the console directly. Supplying --payload preserves the existing headless command behavior.

The console supports repeated requests, multiline payload editing, drafting the next payload while a response streams, interrupting active requests, sticky response scrolling, and raw or pretty completed JSON. Request Options expose payload and response files, content negotiation, Runtime and MCP sessions, application headers, CUSTOM_JWT credentials, MCP metadata, and tracing fields from the headless invocation contract.

Users can switch Runtime targets and endpoints without leaving the console. Endpoint changes retain Runtime-scoped credentials while clearing sessions; Runtime changes also clear credentials that should not cross Runtime boundaries.

Streaming response metadata and byte counts are shown after an exchange settles so the transcript does not jump while chunks arrive. Returned session IDs are adopted only after successful completion, and interrupted or failed streams preserve safe partial output without adopting their sessions.

This PR also documents the interactive workflow and adds focused routing, editor, options, target-switching, streaming, file-output, error, interruption, and session tests.

Related Issue

#1820

Documentation PR

N/A. README usage and shortcut documentation is included in this PR.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other (please describe):

Testing

Verified on current PR head e6cc83ac:

  • bun test (526 passed, 0 failed)
  • bun run typecheck
  • bun run lint:check
  • bun run format:check
  • bun run build
  • AWS_PROFILE=deploy bun run src/index.ts renders the root TUI
  • Live IAM console invocation streamed a 16,135-byte response while the payload editor and footer remained stable; final Runtime session metadata appeared after completion
  • Enter sends, Shift+Enter inserts a newline, and sending remains disabled until the current stream settles

Checklist

  • I have read the CONTRIBUTING document
  • I have added necessary tests that prove the feature works
  • I have updated the documentation accordingly
  • I have added appropriate examples to the documentation
  • My changes generate no new warnings
  • No dependent changes are required

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@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
@aidandaly24
aidandaly24 force-pushed the feat/runtime-invoke-tui branch from e6cc83a to e7ab9bf Compare July 30, 2026 16:55
@codecov-commenter

codecov-commenter commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.22%. Comparing base (ec57799) to head (620579f).

Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #1871      +/-   ##
============================================
+ Coverage     96.01%   96.22%   +0.21%     
============================================
  Files           211      214       +3     
  Lines          9837    10362     +525     
============================================
+ Hits           9445     9971     +526     
+ Misses          392      391       -1     

☔ 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.

@aidandaly24
aidandaly24 force-pushed the feat/runtime-invoke-tui branch from e7ab9bf to a23e29e Compare July 30, 2026 22:28
@aidandaly24
aidandaly24 force-pushed the feat/runtime-invoke-tui branch from d10fa32 to cb25573 Compare August 3, 2026 14:59
@aidandaly24
aidandaly24 marked this pull request as ready for review August 3, 2026 15:09
else if (input === "t" && !abortRef.current) setTargetPicker({ stage: "runtime" });
return;
}
if (key.escape) {

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.

This ESC path looks like its bypassing the session clearing logic when navigating back to the endpoint picker screen. CTRL + T path resets mcpSessionId and runtimeSessionId to undefined. Here, it looks like you could navigate back and change the endpoint, and after remount the invoke screen would restore the original session from context. Should selecting a different endpoint through this flow also clear mcpSessionId and runtimeSessionId?

}
}
if (response.runtimeSessionId) setRuntimeSessionId(response.runtimeSessionId);
if (response.mcpSessionId) setMcpSessionId(response.mcpSessionId);

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.

Should this code block persist mcpProtocolVersion as well?

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.

3 participants