[NOT READY FOR REVIEW] feat(dev): CodeZip dev runner and process lifecycle core - #1883
Open
tejaskash wants to merge 3 commits into
Open
[NOT READY FOR REVIEW] feat(dev): CodeZip dev runner and process lifecycle core#1883tejaskash wants to merge 3 commits into
tejaskash wants to merge 3 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feat/project-foundation #1883 +/- ##
===========================================================
- Coverage 96.01% 95.75% -0.27%
===========================================================
Files 208 211 +3
Lines 9764 9942 +178
===========================================================
+ Hits 9375 9520 +145
- Misses 389 422 +33 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
tejaskash
force-pushed
the
feat/dev-server-core
branch
from
July 31, 2026 16:55
f5e0f3a to
ba41e68
Compare
The first executable slice of agentcore project dev. CodeZipDevRunner bootstraps a uv venv (or node_modules) on first run, then serves the entrypoint with uvicorn --reload (or tsx watch). spawnServer owns process lifecycle: line-streamed logs, SIGTERM->SIGKILL escalation on stop, and a process-group reaper so a detached server can't outlive the CLI and hold the port. The DevRunner interface lives with its consumer (handlers/project/dev), per the dependency-inversion convention. Command execution and server spawning are injectable, so runner tests never start real uv or uvicorn; process tests use real short-lived node processes because process handling is the thing under test. run.ts duplicates the CommandRunner shape from #1872 deliberately; fold into src/io/exec.ts once that lands.
…to src/errors All typed errors live in src/errors; the dev module was defining its own inline.
tejaskash
force-pushed
the
feat/dev-server-core
branch
from
July 31, 2026 17:07
ba41e68 to
720de89
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second PR in the
agentcore project devstack, on top of #1880. This adds the machinery that actually runs an agent locally — nothing is user-visible yet; thedevhandler wires it up in a later PR.What changed
src/core/dev/is new and has three pieces:spawnServer(process.ts) owns process lifecycle for a long-running server: streams output line by line to a log callback, escalates SIGTERM → SIGKILL on stop, and registers a process-group reaper so a detached server can't outlive the CLI and squat on the port. The child is spawned detached (its own process group) on POSIX so stopping it also stops uvicorn's reload workers — killing just the parent leaves the worker holding the socket.CodeZipDevRunner(codezip.ts) runs a CodeZip runtime from a resolved project. Python entrypoints get a uv-managed venv (uv syncon first run, skipped when uvicorn is already in.venv) and thenuvicorn --reload. TypeScript entrypoints getnpm install+tsx watch. The agent process receivesPORTandLOCAL_DEV=1plus whatever env the caller passes —.env.localloading comes with the handler PR.The
DevRunnerinterface lives inhandlers/project/dev/types.tsnext to its future consumer, following the repo's dependency-inversion rule. The runner takes injectablerun/spawnseams, so its tests never start real uv or uvicorn; the process tests use real short-livednode -eprocesses, since process handling is the thing under test there.One deliberate duplication: run.ts carries the same
CommandRunnershape assrc/io/exec.tsfrom #1872. Whichever lands second folds into the other — noted in the file.Compared to the old CLI's dev server, this drops the Python traceback filtering and stderr ring buffer. Raw output first; filtering can come back if it proves painful in practice.
Testing
Runner tests cover the missing-code-directory error, venv bootstrap vs. skip, the uvicorn/tsx command shapes, and env injection. Process tests cover line streaming, stderr classification, stop(), and a nonexistent binary. 565 tests pass,
tscclean.Stack
#1880 (project foundation) → this PR → container runner → OTLP collector → Inspector web server →
project devhandler.