Skip to content

feat(project): add project-aware invoke - #2115

Draft
aidandaly24 wants to merge 18 commits into
aws:refactorfrom
aidandaly24:feat/project-aware-invoke
Draft

feat(project): add project-aware invoke#2115
aidandaly24 wants to merge 18 commits into
aws:refactorfrom
aidandaly24:feat/project-aware-invoke

Conversation

@aidandaly24

@aidandaly24 aidandaly24 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

Add a project-aware top-level agentcore invoke command for Runtimes and Harnesses declared by the project enclosing the current directory.

  • resolve logical project resources to deployed IDs through the selected project backend and deployment target
  • invoke project Runtimes with the template contract {"prompt": content}
  • share one project agent-event parser between dev and deployed invoke for JSON strings, text objects, Converse deltas, and non-JSON text
  • render Strands Runtime SSE contentBlockDelta events as streaming assistant text in headless and prompt-TUI invocation
  • fail incomplete Strands streams when AgentCore emits an SSE error frame
  • pass unsupported SSE through without buffering the complete response
  • preserve exact Runtime wire responses with --json
  • invoke project Harnesses with the existing user-message and transcript contract
  • reuse the existing Runtime and Harness transports instead of introducing a third invoke path
  • launch the existing interactive experiences when content is omitted
  • add a Runtime prompt input mode while preserving direct Runtime JSON-console behavior
  • document project invoke in the CLI and generated Runtime templates

Gateway project invoke and non-Strands response adapters are intentionally outside this PR.

This draft depends on the following refactor work landing first:

Related Issue

N/A

Documentation PR

N/A - documentation is included.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Other

Testing

  • bun test src: 2166 pass, 0 fail
  • focused shared parser, dev Inspector, project invoke, Runtime response, and Runtime TUI suites: 104 pass, 0 fail
  • bun run typecheck
  • bun run lint:check
  • bun run format:check
  • bun run build
  • git diff --check

Live verification in account 603141041947, region us-west-2:

  • project Runtime headless invoke returned exactly RUNTIME_RENDER_OK without SSE framing
  • project Harness headless invoke returned HARNESS_INVOKE_OK with end_turn
  • Runtime prompt TUI rendered exactly TUI_RENDER_OK without SSE framing or serialized Strands events
  • project Runtime --json preserved SSE metadata, framing, and Strands events
  • the rebuilt root TUI no longer offered an unsupported blank project-invoke route
  • retained the deployed InvokeTuiE2E825 project for continued manual testing

Checklist

  • I have added tests that prove the feature works
  • I have updated relevant documentation
  • I have verified direct Runtime, Harness, and Gateway behavior remains green
  • I have run live deployment and TUI verification
  • Dependent changes have been merged and published

@github-actions github-actions Bot added the size/xl PR size: XL label Aug 26, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added agentcore-harness-reviewing AgentCore Harness review in progress claude-security-reviewing Claude Code /security-review in progress labels Aug 26, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@codecov-commenter

codecov-commenter commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.00000% with 40 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.30%. Comparing base (9ab30d3) to head (2c6f8c3).

Files with missing lines Patch % Lines
src/core/project/backends/cdk/deployment.ts 62.22% 17 Missing ⚠️
src/handlers/project/invoke/index.tsx 92.89% 13 Missing ⚠️
src/handlers/runtime/invoke/promptResponse.ts 87.95% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #2115      +/-   ##
============================================
- Coverage     97.41%   97.30%   -0.11%     
============================================
  Files           453      459       +6     
  Lines         27637    28054     +417     
============================================
+ Hits          26922    27299     +377     
- Misses          715      755      +40     

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

@agentcore-devx-automation agentcore-devx-automation Bot 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.

AgentCore Harness Review

Verdict: Looks good

Nice split: the shared invokeRuntimeTarget / invokeHarnessTurn helpers cleanly refactor the existing handlers into reusable operations, the new project-level invoke composes those without duplication, and the resolveDeployedResource layering (manager → backend → deployment helpers) is easy to follow. Tests use real temp dirs + fake backends, and only mock at true I/O boundaries (readStack, per the guidelines).

One thing worth double-checking before this fully lights up end-to-end:

  • src/core/project/backends/cdk/deployment.ts:28 looks up harnesses by CloudFormation export name ${stackName}-Harness-${resourceName}-Id. Scanning agentcore-l3-cdk-constructs, the harness constructs (AgentCoreHarnessEnvironment, AgentCoreHarnessRole, AgentCoreApplication) currently only emit Harness-<name>-RoleArn and Harness-<name>-ImageUri outputs — no Harness-<name>-Id. Runtime lookup will work today (AgentEnvironment.ts emits <agentName>-RuntimeId), but agentcore invoke --harness ... will always fail with the "not deployed" error until the L3 emits that export. If a coordinated L3 change is in flight this is fine; if not, this handler and its export-name contract will need to land together with the construct change (and ideally the runtime path in AgentEnvironment.ts should probably also be prefixed like -Runtime-<name>-Id for symmetry with Harness-<name>-Id, but that's a naming choice).

Not blocking — tests all pass with a fake backend, and if the harness export is a known follow-up this is just a heads-up. Everything else (validation, mutual-exclusion, --json requiring content, session-id length rule, bearer-token restricted to runtime, TUI launch with inputMode: "prompt", region override from the resolved target) reads correctly.

@agentcore-devx-automation agentcore-devx-automation Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Aug 26, 2026
@aidandaly24
aidandaly24 force-pushed the feat/project-aware-invoke branch from f2c164c to c6796be Compare August 26, 2026 22:02
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Aug 26, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Aug 26, 2026
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Aug 26, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 26, 2026
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Aug 27, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 27, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Aug 27, 2026
@github-actions github-actions Bot added size/xl PR size: XL and removed size/xl PR size: XL labels Aug 27, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Aug 27, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants