Skip to content

fix(eve): resolve dev model module map from authored source#105

Open
oksr wants to merge 1 commit into
vercel:mainfrom
oksr:fix/dev-schedule-channel-model-resolution
Open

fix(eve): resolve dev model module map from authored source#105
oksr wants to merge 1 commit into
vercel:mainfrom
oksr:fix/dev-schedule-channel-model-resolution

Conversation

@oksr

@oksr oksr commented Jun 19, 2026

Copy link
Copy Markdown

Description

Fixes #104.

Under eve dev, model resolution loaded the compiled module map with the raw loader (loadCompiledModuleMap). That loader statically re-imports authored entry modules, so a run-handler schedule importing a channel via a .js specifier crashed the turn with LoadCompiledModuleMapError (native ESM can't map the .js specifier to the dev snapshot's .ts source). Builds and production were unaffected.

The fix routes model resolution through the runtime's existing loadRuntimeCompiledModuleMap (now exported from compiled-agent-cache.ts), which already hydrates source-backed/dev runs through the authored-source loader and falls back to the raw loader for bundled/production. One call swapped; production path unchanged.

How did you test your changes?

  • Added packages/eve/test/scenarios/schedule-channel-model-resolution.scenario.test.ts: spawns a real eve dev subprocess (with real, unmocked model resolution) for an agent whose run-handler schedule imports a channel, then asserts a turn starts and resolution does not raise LoadCompiledModuleMapError. It fails before the fix with the exact error and passes after. (In-process tests can't catch this: vitest's resolver maps .js.ts, and the model mock seam skips the load.)
  • Manually verified against a real agent running this branch's build: a run-handler schedule that delivers to a Telegram channel failed with LoadCompiledModuleMapError under eve dev before the fix, and after it the session resolved the model, ran the turn, and delivered the message.
  • pnpm typecheck, pnpm lint, pnpm guard:invariants, pnpm test:unit, pnpm test:integration, pnpm test:scenario all pass.

PR Checklist

  • I ran the relevant checks from CONTRIBUTING.md
  • I added tests and documentation where relevant
  • I added a changeset if this touches the published eve package
  • DCO sign-off passes for every commit (git commit --signoff)

@vercel

vercel Bot commented Jun 19, 2026

Copy link
Copy Markdown

@oksr is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@oksr oksr marked this pull request as draft June 19, 2026 10:27
@oksr oksr force-pushed the fix/dev-schedule-channel-model-resolution branch 2 times, most recently from 9821e23 to fcf090b Compare June 19, 2026 10:32
Model resolution used the raw module-map loader, which can't map a
schedule's `.js` channel import to the dev snapshot's `.ts` source. Route it
through loadRuntimeCompiledModuleMap, as the rest of the dev runtime does.

Signed-off-by: oksr <hello@ofeks.dev>
@oksr oksr marked this pull request as ready for review June 19, 2026 10:35
@AndrewBarba

Copy link
Copy Markdown
Collaborator

Thanks a lot we'll take a look at this Monday. We're just wrapping up some plumbing on our side so we can officially accept outside contributions, safely run CI etc.

ManuLosta added a commit to ManuLosta/carlitos that referenced this pull request Jun 22, 2026
… LoadCompiledModuleMapError

Channels importing from lib/ crash under eve dev because the raw
module-map loader uses native ESM, which can't resolve the lib module
(not in the compiled module map). Inlining the helper avoids the
transitive import. Upstream fix pending in vercel/eve#105.
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.

Handler-form schedule → channel receive() fails in eve dev with LoadCompiledModuleMapError

2 participants