feat(runtime): add interactive invoke console - #1871
Conversation
e6cc83a to
e7ab9bf
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
e7ab9bf to
a23e29e
Compare
d10fa32 to
cb25573
Compare
| else if (input === "t" && !abortRef.current) setTargetPicker({ stage: "runtime" }); | ||
| return; | ||
| } | ||
| if (key.escape) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Should this code block persist mcpProtocolVersion as well?
Description
Adds a persistent interactive console for
agentcore runtime invokeon top of the headless Runtime invocation support merged in #1820.Running
agentcore runtime invokewithout a payload now opens the Runtime and endpoint pickers.--idskips the Runtime picker, while--idwith--qualifieropens the console directly. Supplying--payloadpreserves 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
Testing
Verified on current PR head
e6cc83ac:bun test(526 passed, 0 failed)bun run typecheckbun run lint:checkbun run format:checkbun run buildAWS_PROFILE=deploy bun run src/index.tsrenders the root TUIEntersends,Shift+Enterinserts a newline, and sending remains disabled until the current stream settlesChecklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.