Skip to content

feat: add runtime read-only control-plane commands#1797

Open
aidandaly24 wants to merge 4 commits into
refactorfrom
feat/runtime-read-only-cli
Open

feat: add runtime read-only control-plane commands#1797
aidandaly24 wants to merge 4 commits into
refactorfrom
feat/runtime-read-only-cli

Conversation

@aidandaly24

@aidandaly24 aidandaly24 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Description

Adds project-free, command-line access to inspect AgentCore Runtimes:

  • runtime get and runtime list
  • runtime version get and runtime version list
  • runtime endpoint get and runtime endpoint list

The commands follow the Harness handler/Core structure, use the existing JSON output path, and expose one-page pagination through --max-results and --next-token. Endpoint lookup uses --qualifier, mapped to the control-plane endpointName.

Runtime remains hidden from the current TUI, and bare Runtime groups print help. Runtime TUI workflows, invocation, mutations, project or deployment resolution, tags and policies, agent-card operations, logs, and traces are outside this change.

Related Issue

N/A

Documentation PR

N/A. README command examples are included in this PR.

Type of Change

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

Testing

Verified from current HEAD e63739e6:

  • bun test --coverage --coverage-reporter=lcov (263 passed, 0 failed)
  • bun test src/handlers/runtime src/core (39 passed, 0 failed)
  • bun run lint:check
  • prettier --check src/handlers/runtime/runtime.test.tsx
  • bun run typecheck
  • bun run build

Additional verification from production-equivalent commit 22634e54:

  • bun run format:check
  • bun audit
  • bun pm pack
  • bun run compile
  • Built help smokes for all nine Runtime command and group routes
  • Built CLI rejection smokes for the excluded runtime logs and runtime traces groups
  • All six live read commands and a continuation-token request in us-west-2

Live verification used an existing Runtime and did not create, invoke, update, or delete resources. Commit e63739e6 changes tests only, so the production implementation is unchanged from that verification.

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.

Add CLI-only get and list commands for runtimes, runtime versions, and runtime endpoints with Harness-style pagination, output, injected Core clients, fixtures, and command coverage.
@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 20, 2026
@codecov-commenter

codecov-commenter commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.92%. Comparing base (d4c31b1) to head (e63739e).

Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #1797      +/-   ##
============================================
+ Coverage     93.61%   93.92%   +0.30%     
============================================
  Files           117      128      +11     
  Lines          6708     7066     +358     
============================================
+ Hits           6280     6637     +357     
- Misses          428      429       +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 changed the title feat(runtime): add read-only control-plane commands feat: add runtime read-only control-plane commands Jul 20, 2026

@AlexanderRichey AlexanderRichey 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.

Great work on this. I think we should make two changes before merging. First, I think runtime should show in the RouterScreen, even though the TUI isn't there yet. I don't think it's worth it to carve out a special case for runtime when, in the next CR, we'll have to reverse it. Second, I think we should streamline the tests to be more consistent. We now have run(), which manually sets up mocks, and runFixture(), which returns golden file mocks. Let's only use the golden file testing pattern, if possible. So run() should become what runFixture() is and we'll just have to generate fixtures for the couple missing cases. You might have to just create a bunch of runtimes, versions, and endpoints to make this work easily when running the tests in record mode.

() => command.commands.map((c) => ({ name: c.name(), description: c.description() })),
() =>
command.commands
.filter((command) => command.name() !== "runtime")

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 understand that we haven't built the TUI for Runtime yet, but still I don't think it's worth introducing this edge case. After we build the TUI in the next CR, the original code will work as intended. Even now, I think what would happen is that the help screen would be shown, which is also fine for now.


export function createRuntimeVersionHandler(core: Core, io: AppIO): Router {
return new Router("version", "inspect AgentCore Runtime versions")
.default(createHelpDefault(io))

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 makes sense for now, but it will be replaced by withTui().

const frame = r.lastFrame()!;
expect(frame).toContain("harness");
expect(frame).toContain("manage agentcore harnesses");
expect(frame).not.toContain("runtime");

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 think we want the main screen to show runtime.

describe("runtime control reads", () => {
test("gets a Runtime and renders the complete response", async () => {
const result = await run(["runtime", "get", "--id", "runtime-1"]);

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.

Is there a reason why we're not doing golden file testing for some of these cases? I think that would be both simpler and more robust.

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