Skip to content

feat(dev): add container dev runner - #1962

Open
tejaskash wants to merge 2 commits into
refactorfrom
feat/container-dev-runner
Open

feat(dev): add container dev runner#1962
tejaskash wants to merge 2 commits into
refactorfrom
feat/container-dev-runner

Conversation

@tejaskash

Copy link
Copy Markdown
Contributor

Summary

  • add a streamed ContainerDevRunner for Docker, Podman, and Finch builds
  • validate build inputs, protect widened contexts with .dockerignore, and map protocol-specific loopback ports
  • keep environment and build-argument values out of argv while explicitly cleaning up project-scoped containers
  • cover runtime selection, command construction, validation, cancellation, cleanup, and failure sequencing with fake process tests

Stack

Verification

  • bun test (1013 tests)
  • bun test src/core/dev/ (30 tests)
  • bun run typecheck
  • bun run lint:check
  • bun run format:check
  • bun run build

@github-actions github-actions Bot added the size/l PR size: L 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/container-dev-runner branch from 961beaf to e42dbf8 Compare August 10, 2026 18:41
@codecov-commenter

codecov-commenter commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.82%. Comparing base (1e7de20) to head (072611d).
⚠️ Report is 1 commits behind head on refactor.

Additional details and impacted files
@@             Coverage Diff              @@
##           refactor    #1962      +/-   ##
============================================
+ Coverage     96.79%   96.82%   +0.02%     
============================================
  Files           306      307       +1     
  Lines         17051    17182     +131     
============================================
+ Hits          16505    16636     +131     
  Misses          546      546              

☔ 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/container-dev-runner branch from e42dbf8 to 853e311 Compare August 10, 2026 20:12
@tejaskash
tejaskash force-pushed the feat/container-dev-runner branch 2 times, most recently from 3f4e482 to 5caac75 Compare August 10, 2026 20:25
@tejaskash
tejaskash force-pushed the feat/container-dev-runner branch from 5caac75 to 10cea59 Compare August 10, 2026 20:57
Base automatically changed from feat/dev-server-core to refactor August 10, 2026 22:55
@jariy17
jariy17 force-pushed the feat/container-dev-runner branch from 10cea59 to c6dd19b Compare August 10, 2026 22:55
@tejaskash
tejaskash force-pushed the feat/container-dev-runner branch from c6dd19b to cb1915e Compare August 11, 2026 14:05
@tejaskash
tejaskash force-pushed the feat/container-dev-runner branch from cb1915e to 69d7548 Compare August 11, 2026 16:24
Comment thread src/core/dev/container.ts Outdated
Comment thread src/core/dev/container.ts Outdated
Comment thread src/core/dev/container.ts
Comment thread src/core/dev/container.ts
Comment thread src/core/dev/container.ts
Comment thread src/core/dev/container.test.ts
Comment thread src/core/dev/container.ts

const runtimeName = input.runtime.name.toLowerCase();
const projectId = hashString(resolve(input.projectRoot));
const imageTag = `agentcore-dev/${runtimeName}-${projectId}`;

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.

can we sanitize underscores when creating the image name, docker has rules here like only 2 consecutive underscore (runtimename can have many).

Comment thread src/core/dev/container.ts
input.signal.throwIfAborted();

const buildArgs = input.runtime.customDockerBuildArgs ?? {};
const buildArgFlags = Object.keys(buildArgs).flatMap((key) => ["--build-arg", key]);

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.

finch does not forward arbitrary env vars into its VM, so --build-arg KEY loses the value.

should probably be --build-arg KEY=value

Comment thread src/core/dev/container.ts
],
{
cwd: context,
env: { ...process.env, ...forwardedEnv },

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.

for docker specifically, build args and app env vars are passed into Docker’s own environment. names like DOCKER_HOST can change which Docker daemon is used so can we keep these values separate?

Comment thread src/core/dev/container.ts
signal.throwIfAborted();
if (!hasVersion) continue;

const canBuild = await this.toolAvailable(tool, ["build", "--help"]);

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.

while I was trying on my own system, it seems like this treats a failed finch build --help as an unavailable binary. it was installed but not initialized. It should instead suggest running finch vm init. this is also likely a bug in the current CLI but I would like to have it fixed here if possible!

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

Labels

size/l PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants