Skip to content

feat(project): wire dev handler - #1966

Open
tejaskash wants to merge 1 commit into
refactorfrom
feat/project-dev-handler
Open

feat(project): wire dev handler#1966
tejaskash wants to merge 1 commit into
refactorfrom
feat/project-dev-handler

Conversation

@tejaskash

@tejaskash tejaskash commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • implement agentcore project dev runtime selection, port resolution, runner dispatch, structured output, and signal handling
  • reuse withProject for project discovery and actionable missing-project guidance
  • load runtime and .env.local values directly; containers forward host AWS variables, mount ~/.aws read-only, and fail early when neither credential source exists
  • reuse shared JSON rendering for NDJSON events and generalize command interruption handling

Stacks on #1962.

Verification

  • bun test (1107 pass)
  • bun run typecheck
  • bun run lint:check
  • bun run format:check
  • bun run build
  • executable smoke: scaffolded a real Python project, ran project dev, received healthy /ping, interrupted with exit 130, and verified child cleanup and port release
  • executable no-project probe verified the actionable project create guidance

@github-actions github-actions Bot added the size/xl PR size: XL label Aug 10, 2026
@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 Aug 10, 2026
@tejaskash
tejaskash force-pushed the feat/project-dev-handler branch from 736c095 to 3d6dd24 Compare August 10, 2026 20:57
@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.59514% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.94%. Comparing base (2d6e44e) to head (73ab887).

Files with missing lines Patch % Lines
src/io/devEnvironment.ts 97.14% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #1966      +/-   ##
============================================
+ Coverage     96.91%   96.94%   +0.02%     
============================================
  Files           356      359       +3     
  Lines         20136    20361     +225     
============================================
+ Hits          19515    19739     +224     
- Misses          621      622       +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.

@tejaskash
tejaskash force-pushed the feat/project-dev-handler branch from 3d6dd24 to d003ce7 Compare August 10, 2026 21:25
@jariy17
jariy17 force-pushed the feat/project-dev-handler branch from d003ce7 to 3b72b9c Compare August 10, 2026 22:55
@tejaskash
tejaskash force-pushed the feat/project-dev-handler branch from 3b72b9c to 03f5223 Compare August 11, 2026 01:12
@tejaskash
tejaskash force-pushed the feat/project-dev-handler branch from 03f5223 to b7c2b24 Compare August 11, 2026 14:05
@tejaskash
tejaskash force-pushed the feat/project-dev-handler branch 3 times, most recently from ac10a56 to 17d2047 Compare August 12, 2026 13:10
@tejaskash
tejaskash force-pushed the feat/project-dev-handler branch 2 times, most recently from 126d77b to c55046e Compare August 12, 2026 13:42
@tejaskash
tejaskash force-pushed the feat/project-dev-handler branch from c55046e to 37312c9 Compare August 13, 2026 14:02
Base automatically changed from feat/container-dev-runner to refactor August 13, 2026 17:37
@tejaskash
tejaskash force-pushed the feat/project-dev-handler branch from 37312c9 to 73ab887 Compare August 13, 2026 17:41

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

only blocking comment is the direct process kill.

});

await expect(collect(runner.run(input(root, runtime({ buildContextPath }))))).rejects.toThrow(
"container build context must be within the project root",

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 we validate the error types in these tests?

Comment thread src/core/dev/container.ts
if (
relativeContext === ".." ||
relativeContext.startsWith(`..${sep}`) ||
isAbsolute(relativeContext)

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.

in what cases does relative return an absolute path?

Comment thread src/core/dev/container.ts
);
const hasAwsConfig = existsSync(this.awsDirectory);
if (!hasAwsCredentials && !hasAwsConfig) {
throw new InputValidationError(

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.

do you think it would be useful to distinguish the missing credentials case from the invalid inputs case in telemetry with a separate error type here?

Comment thread src/core/dev/port.ts
};

function portInUse(port: number, suffix = ""): InputValidationError {
return new InputValidationError(

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.

would it be simpler to make this function its own error type?

Comment thread src/errors/errors.tsx
}

export class RuntimeInvokeInterruptedError extends AgentCoreCLIError {
export class CommandInterruptedError extends AgentCoreCLIError {

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 this is doing something similar to https://github.com/aws/agentcore-cli/pull/1986/changes (haven't fully reviewed that one yet)

if (name) {
const runtime = project.runtimes.find((candidate) => candidate.name === name);
if (runtime) return runtime;
throw new InputValidationError(

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 be a resourceNotFoundError or something?

handle: async () => {
throw new NotImplementedError("agentcore project dev is not implemented yet");
flags: [
flag("agent", "runtime to run", z.string().optional()),

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.

would using the flag agent imply it works for runtime and harness?

},
loadDevEnvironment,
checkPort,
forceExit: () => process.exit(130),

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 to avoid killing the process directly so that we can get telemetry here.

Comment thread package.json
},
"main": "./dist/index.js",
"engines": {
"node": ">=20.12.0"

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.

why exactly is this needed? is there a component bun is missing that we need here?

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.

3 participants