feat(project): support local Runtime invocation - #2209
Conversation
|
Claude Security Review: no high-confidence findings. (run) |
There was a problem hiding this comment.
AgentCore Harness Review
Verdict: Looks good
Solid change. The new local-invoke path is a self-contained branch in the existing runtime invoke handler with the right guardrails:
- Validates that
--portrequires--local, and that all deployed-runtime-only flags are rejected with a specific--<flag> cannot be used with --localerror. - Preserves the existing
--payloadrequirement (with correctExitCode.USAGE) and the--json+--output-filemutual-exclusion. - The
--targetchange from.default("default")to.optional()with a?? "default"fallback at the resolve site is behaviorally equivalent for the deployed path. z.boolean()on--localcorrectly defaults tofalse(confirmed in router tests), and adding"local"to thehasHeadlessOnlyFlagexclusion list prevents the boolean'sfalsevalue from being treated as a headless-only signal in the TUI branch.invokeLocalRuntimeusesredirect: "manual", honorsAbortSignal(rethrowingsignal.reasonon aborts), and converts fetch failures into a helpfulInvalidEnvironmentErrorthat points users atagentcore project dev.- Non-2xx responses are surfaced via
RuntimeInvokeResponseErrorafter the body is written, which is a reasonable UX for local debugging (differs from the deployed path that discards the body on non-ok, but that's a deliberate trade-off).
Test coverage exercises the happy path and the server-down path against a real startHttpServer — no excessive mocking. The console.error spy is needed because runWithExitCode writes directly to console.error rather than injected IO.
No new telemetry needed; the invoke handlers don't instrument per-invocation and telemetry is captured at the router/command-path level.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## refactor #2209 +/- ##
==========================================
Coverage 97.07% 97.08%
==========================================
Files 544 545 +1
Lines 37866 37994 +128
==========================================
+ Hits 36760 36886 +126
- Misses 1106 1108 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
73963d1 to
83dd3ae
Compare
|
Claude Security Review: no high-confidence findings. (run) |
Summary
--localand--porttoagentcore project invoke runtime127.0.0.1:<port>/invocationsTesting
bun test src/handlers/project/invoke/index.test.tsx(8passed)bun test(2962passed)bun run typecheckbun run lint:checkbun run format:checkbun run buildagent-pythonproject and invoked its real headlessproject devserver successfully on the default port8080--port 8081Notes
--localis intentionally headless and requires--payload