Skip to content

Jev directory

Wakegate

An experimental TypeScript gate that asks Jev one wake, not-yet, or unrelated Choice before resuming a sleeping agent's LLM, while code handles timers, user messages, skip limits, errors, and timeouts.
Stars
6
Language
TypeScript
License
MIT
Reading time
3 min
Published by
Community
Author
shitianfang
Last verified
Sep 2026

About this project

Before you resume a sleeping agent, ask Jev whether the wakeup is worth a full LLM turn. Long-running agents sleep. A timer fires every 30 minutes to re-check a price, or an email lands while the agent waits for one particular reply. Each wakeup usually resumes the LLM with its whole context, and many of them end in "nothing changed, back to sleep". That turn's tokens are spent anyway.

Quoted from the project's README. Read the full README.

Highlights

  • Jev only gates the resume: the wakeup is skipped only when Jev puts less than 0.2 on wake, and every other path wakes the agent.
  • User messages, bare timers, skipped >= maxSkips, Jev errors, 5-second timeouts, and a missing key all wake without asking Jev.
  • In a local workerd Durable Object alarm an unchanged $349.99 kept the agent asleep (p = 0.04) and $279.99 against a below-$300 goal woke it (p = 0.99).
  • A Jev call took about 250 ms in their runs; the whole gate is src/index.ts at 69 lines.
  • Its eval is 21 hand-written scenarios, 11 that should wake and 10 that should not, not a benchmark.

Quickstart

ts
import { shouldWake } from "wakegate";

const verdict = await shouldWake({
  waitingFor: "A reply from Dana Li about scheduling my second-round interview",
  event: { type: "email", from: "[email protected]", subject: "Your Daily Digest" },
  skipped: 0,
});

if (verdict.wake) await resumeAgent();

Watch out

MIT-licensed. Not on npm yet, so it installs from GitHub; needs the Vercel AI SDK 7.0.105 or later as a peer dependency, the 0.2 threshold and 5-second timeout are fixed, and savings are not measured.

Questions about this entry

Short answers drawn from the linked project or page.

Reactions & coverage

Posts, threads, and videos about this entry from around the web.

X: Search and tagging on keep.md

X: Jev lands on the Vercel AI Gateway

X: Vercel ships the AI SDK provider for Jev

Reddit: Jev is on Workers AI as typesafe/jev

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai