Skip to content

feat(project): scaffold add harness handler - #1998

Merged
Hweinstock merged 4 commits into
aws:refactorfrom
Hweinstock:feat/add-harness
Aug 14, 2026
Merged

feat(project): scaffold add harness handler#1998
Hweinstock merged 4 commits into
aws:refactorfrom
Hweinstock:feat/add-harness

Conversation

@Hweinstock

@Hweinstock Hweinstock commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Problem

We're missing functionality to add resources to a project. This PR sets up the handler for agentcore project add harness as an example, and scaffolds the remaining work for add.

Solution

  • setup a handler that takes the same flags at the imperative harness create (with a extra few project specific ones). Alternatively considered using different flags from imperative, but this creates an inconsistent UX where project command inputs are similar to api shapes, but slightly different (ex. containerUri is top level, vs nested in json).
  • convert those flags into the spec format expected by the schemas.
  • scaffold an add function for the shared functionality.

Testing / Verification

  • created a project, attempted to add a harness and got the not implemented error.
  • add unit tests for the flag parsing.

Next Steps

  • I want to move the scaffolding of runtime into the add function, then call that from the handler when we're scaffolding. This will make it easier to re-use the logic, and handle harness in the same place.
  • implement the rest of add via json source.

@Hweinstock Hweinstock changed the title Feat/add harness feat(project): scaffold add harness handler Aug 13, 2026
@github-actions github-actions Bot added the agentcore-harness-reviewing AgentCore Harness review in progress label Aug 13, 2026
@codecov-commenter

codecov-commenter commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.50860% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.96%. Comparing base (9398c03) to head (d9138cd).
⚠️ Report is 1 commits behind head on refactor.

Files with missing lines Patch % Lines
src/handlers/project/add/harness/index.ts 99.48% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #1998      +/-   ##
============================================
+ Coverage     96.91%   96.96%   +0.04%     
============================================
  Files           356      357       +1     
  Lines         20136    20531     +395     
============================================
+ Hits          19515    19908     +393     
- Misses          621      623       +2     

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

@github-actions github-actions Bot removed the agentcore-harness-reviewing AgentCore Harness review in progress label Aug 13, 2026
Comment thread src/core/project/manager.tsx Outdated
}

// eslint-disable-next-line require-yield
public async *add<TResource extends ProjectResource>(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i'm imagining minimal special casing here. We'll want to scaffold files for runtime/harness, then the rest should be simple shared logic to write the schema changes. We will also need some special casing for harness since it links to the config in the scaffolded files.

});

/** Converts the SDK's tagged-union model config into the flat project-schema shape. */
function toModelConfig(modelConfig: HarnessModelConfiguration): HarnessModel {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we handle all the api shape --> project schema conversion in the handler to keep the shared logic clean.

@Hweinstock
Hweinstock marked this pull request as ready for review August 13, 2026 19:54
])("%s", async (_label, flags) => {
await inProject();
// TODO: update to verify that the project updates.
await expect(run(["add", "harness", ...flags])).rejects.toThrow("not yet implemented");

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.

TODO: MAke sure you fix tests after implementation

@Hweinstock
Hweinstock requested a review from notgitika August 14, 2026 17:16
}

// eslint-disable-next-line require-yield
public async *addResource<TResource extends ProjectResource>(

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.

nice!

Comment on lines +229 to +238
if ("agentCoreGateway" in c && c.agentCoreGateway) {
return {
type: tool.type,
name: tool.name,
config: {
agentCoreGateway: {
gatewayArn: requireField(c.agentCoreGateway.gatewayArn, "agentCoreGateway.gatewayArn"),
},
},
};

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.

what about when users set outbound auth or JWT here? are these being dropped or are they somewhere where I'm missing them. I am looking at toAuthorizationConfig below and I see those fields.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

good catch, looks like we want to wire up the field here

outboundAuth: HarnessGatewayOutboundAuthSchema.optional(),
from https://docs.aws.amazon.com/bedrock-agentcore-control/latest/APIReference/API_HarnessAgentCoreGatewayConfig.html. I'll track this as a follow-up.

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.

thanks!

Comment on lines +357 to +358
async function inBuildableProject(): Promise<string> {
const projectRoot = await inProject("MyAgent");

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.

nice!

@Hweinstock
Hweinstock merged commit 64d601f into aws:refactor Aug 14, 2026
8 of 16 checks passed
@Hweinstock
Hweinstock deleted the feat/add-harness branch August 14, 2026 19:31
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.

5 participants