Skip to content

Receive-only channels disappear from compiled manifests #1270

Description

@glucas1103

eve version

eve@0.27.8 (main at f736533d)

Describe the bug

A channel authored only as a target for schedules or cross-channel handoffs is valid at the public API level:

export default defineChannel({
  routes: [],
  async receive(input, { send }) {
    return send(input.message, {
      auth: input.auth,
      continuationToken: "worker",
      mode: "task",
    });
  },
});

However, compileChannelDefinition() currently returns definition.routes.map(...). An empty route list therefore emits no compiled entry. The module is absent from the compiled manifest and module map, so schedules and other channels cannot resolve it as a receive target. Applications must add a fake HTTP route solely to keep the channel discoverable.

Expected behavior

A channel with routes: [] and receive should remain in the compiled manifest and module map, resolve into the runtime channel registry, and work with schedule/cross-channel receive(...). It should not mount an HTTP or WebSocket route.

Reproduction

  1. Add the receive-only channel above under agent/channels/worker.ts.
  2. Import it from a handler-form schedule and call receive(worker, ...).
  3. Run eve build or inspect .eve/compile/agent-compiled-manifest.json.

The channel is missing from manifest.channels; the schedule target cannot be registered without adding a dummy route.

Proposed direction

Preserve a dedicated receive-only channel entry in the compiled manifest, resolve it through the normal authored-module path, include it in info/agent discovery with no route metadata, and exclude it from Nitro route registration. Add compiler, runtime schedule/cross-channel, discovery, and no-route regression tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions