feat(agents): embedder docker-sandbox options + modelCatalog on AgentHandlerResult#4569
Conversation
…HandlerResult Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4569 +/- ##
==========================================
+ Coverage 56.67% 58.56% +1.89%
==========================================
Files 327 378 +51
Lines 37935 41689 +3754
Branches 10938 11835 +897
==========================================
+ Hits 21498 24416 +2918
- Misses 16401 17198 +797
- Partials 36 75 +39
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…set bullets Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude Code ReviewSummaryThis PR adds two embedder customization hooks to @electric-ax/agents: BuiltinAgentHandlerOptions.dockerSandbox (image/env/mounts passthrough to the built-in docker profile) and modelCatalog on AgentHandlerResult. Small, additive, backward-compatible, with a changeset and a focused unit test. The only change since the last review (58d5492) is a CI-prettier formatting fix to the drift-guard import() line — no functional change. Ready to merge. What's Working Well
Issues FoundCritical (Must Fix)None. Important (Should Fix)None. Suggestions (Nice to Have)None outstanding — all four suggestions from the prior iterations were resolved (see Previous Review Status). One residual, purely-informational note: patch bump (carried, resolved-in-spirit). With resolveDockerSandboxOpts dropped from the public surface, the remaining additive surface is new optional input fields plus a returned object field — a defensible patch for a 0.x package. No change requested. Issue ConformanceNo linked issue — per project convention, a soft warning; a tracking issue would help future archaeology. The PR description thoroughly explains the motivation (OpenFactory's Discord-facing agent needing a tooling-baked image + GH App key mount and shared model resolution). Implementation matches the stated scope with no scope creep. Test CoverageCodecov reports 3 uncovered lines in bootstrap.ts (76.92% patch) — the wiring inside the docker branch of buildBuiltinSandboxProfiles, which needs a live Docker daemon to exercise. Acceptable, given the pure merge logic is fully unit-tested. No new error paths introduced. Monorepo Awareness
Previous Review StatusAll prior suggestions remain addressed; no regressions since iteration 3.
The single new commit (58d5492) is a formatting-only fix for the CI prettier check. No new issues introduced. Review iteration: 4 | 2026-06-15 |
0.4.17 already shipped without these exports, so release as a patch (0.4.18) rather than a minor. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Drop `resolveDockerSandboxOpts` from the public `index.ts` exports (and the changeset) — it's an internal merge helper; the unit test imports it from source, and no other consumer exists. JSDoc updated accordingly. - Document that custom `extraMounts` must not target the `/work` cwd mount (a colliding bind fails opaquely at container create). - Add a zero-runtime compile-time drift guard asserting `BuiltinDockerSandboxMount` stays assignable to the runtime's mount shape (inline `import(...)` type is fully erased). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
CI prettier check wraps the long NonNullable<import(...)> type; move the eslint-disable-next-line directly above the wrapped import line so both prettier and the `quotes` rule are satisfied. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The failing build was the Prettier formatting check (not a compile error): the review-fix added a drift-guard whose long Fixed in 58d5492 by moving the disable comment directly above the wrapped
For context, the review suggestions were addressed in the prior commits: dropped |
What
BuiltinAgentHandlerOptions.dockerSandbox?: { image, allowFloatingTag, env, extraMounts }— threads into the built-indockersandbox profile'sdockerSandbox()call (which already supports all of these). Custom mounts append after the working-directory mount.AgentHandlerResult.modelCatalog— exposes the catalogcreateBuiltinAgentHandleralready builds.resolveBuiltinModelConfig,resolveDockerSandboxOpts, and typesBuiltinModelCatalog,BuiltinAgentModelConfig,BuiltinDockerSandboxOptions,BuiltinDockerSandboxMount.Why
OpenFactory registers a custom Discord-facing agent entity alongside horton/worker. It needs (a) a sandbox image with git + gh + a GitHub-App token helper baked in, plus the GH_APP env/key mount inside the container, and (b) the same model-arg resolution the built-in agents use, without re-implementing the catalog.
Tests
packages/agents/test/docker-sandbox-options.test.tscovers the option merge (cwd-mount only, full passthrough, mount append, empty).🤖 Generated with Claude Code
Notes for reviewers
BuiltinDockerSandboxMountintentionally duplicates the runtime's mount item shape instead of importingDockerSandboxOpts— that type only exists on the@electric-ax/agents-runtime/sandbox/dockersubpath, which this package deliberately keeps out of its top-level import graph (docker code is reached via dynamic import only).env/extraMountsextend the existing embedder/operator trust boundary: same trust level as the embedder process itself, andextraMountsstays behind the runtime's docker-socket guard.