Skip to content

build(driver): adopt @mosoo/agent-driver package name and bump pin - #399

Merged
Yevanchen merged 2 commits into
mainfrom
build/driver-package-rename
Jul 24, 2026
Merged

build(driver): adopt @mosoo/agent-driver package name and bump pin#399
Yevanchen merged 2 commits into
mainfrom
build/driver-package-rename

Conversation

@Yevanchen

Copy link
Copy Markdown
Collaborator

Closes #396.

Points the driver submodule at driver main 9d4415d — first pin bump since the package rename and Driver Contract v2. Brings in:

Superproject adaptation:

  • all agent-driver/* imports → @mosoo/agent-driver/* (50 files, incl. boundary-test literals)
  • wrangler.toml container image path DockerfileContainerfile (renamed upstream)
  • sandbox-layout: derive control-port count from DRIVER_CONTROL_PORT_MAX (v2 dropped DRIVER_CONTROL_PORT_COUNT; range unchanged 20000–59999)
  • contract v2 occurredAt: envelope occurredAt is now an ISO 8601 string. Wire schema admits strings; events.ts parses to epoch ms at the persistence boundary. Without this the old typeof === "number" guard silently persisted null for every driver event timestamp.
  • root fmt/lint scoped to apps/api apps/web: pinned driver checkout is styled by the driver repo's own config/CI; root formatting no longer rewrites submodule files on bun run fmt

Verification: api tc/test 1052 pass, web tc/test 183 pass, driver tc/build/test green (1 known macOS-only /var/private/var symlink case, passes on Linux), root fmt:check/lint/tc/docs:check green.

Staging screen gate (paired warm-ping, openai instrument) running — results will be posted before merge.

The driver repo renamed its package agent-driver -> @mosoo/agent-driver and
established Driver Contract v2. Point the submodule at driver main 9d4415d
(includes the message_start-loss stream anchoring fix, the npm-cache image
diet, and the acp cache-bucket usage fix) and adapt the superproject:

- rewrite all agent-driver/* imports to @mosoo/agent-driver/* (50 files)
- wrangler.toml: container image path Dockerfile -> Containerfile
- sandbox-layout: derive the control-port count from the exported
  DRIVER_CONTROL_PORT_MAX (contract v2 dropped DRIVER_CONTROL_PORT_COUNT)
- rpc-wire/events: envelope occurredAt is an ISO 8601 string in contract
  v2; admit strings on the wire and parse to epoch ms at the persistence
  boundary (the old number-only typeof guard silently nulled every value)
- scope root fmt/lint to apps/api apps/web: driver style is owned by the
  driver repo's own CI; the pinned checkout no longer matches root config
- boundary tests: assert the new package specifiers and contract v2
  occurredAt shape
The driver's v2 runtime.timing.recorded payload carries completedAt/startedAt
as ISO 8601 strings; the mosoo-side parser only accepted the legacy epoch-ms
completedAtMs/startedAtMs fields and threw, turning every driver event batch
that contained a timing event into an oRPC 500. The driver then failed
input.start with the opaque 'Internal server error', killing every run on the
new pin (both claude and openai runtimes, observed on the perf stacks).

Accept either shape and normalize to epoch ms so the pin bump is
order-independent: new API + old driver (numbers) and new API + new driver
(ISO strings) both parse.
@Yevanchen

Copy link
Copy Markdown
Collaborator Author

Staging screen gate: PASS (paired warm-ping, openai instrument, stage-a=main 8939fedb vs stage-b=this branch 95d07bbf)

  • 8/8 pairs valid, 0 run failures
  • Median server TTFT: 7,748ms (main) vs 6,387ms (this branch); paired median Δ = −1,087ms, B faster in 7/8 pairs
  • Stage medians (main → branch): context_hydration 796→227ms, driver_turn 159→98ms, prepare_run 4,557→4,086ms

The gate also caught a live incompatibility before merge: the first stage-b deploy failed every run (driver.command_failed.input.start, oRPC 500). Root cause: Driver Contract v2 emits runtime.timing.recorded timestamps as ISO strings (completedAt/startedAt), while pkgs/runtime-events still required legacy epoch-ms fields and threw — poisoning every driver event batch that contained a timing event. Fixed in 95d07bbf (accept both shapes, normalize to epoch ms, regression test), verified by rerunning the full gate with zero failures. Static checks (tc, CI) could not catch this drift — the two packages type-check independently.

@Yevanchen
Yevanchen merged commit 7aa0973 into main Jul 24, 2026
10 checks passed
@Yevanchen
Yevanchen deleted the build/driver-package-rename branch July 24, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: bump agent-driver submodule pin past the @mosoo/agent-driver rename

1 participant