Glove v4 release notes

glove-core 4.0.0 changes where live state reaches the model. Goals, forms and pinned context no longer rewrite the system prompt: they are resolved by runtime context providers before each model iteration and appended at the model-input tail, as transient snapshots that never enter saved conversation history. That is the one breaking change in v4, and it only affects custom runnables, custom builders and exhaustive subscriber handlers.

4.1, 4.2 and 4.3 are minor releases on top: Foundry's production controls and native goals, facts and forms; browser and sandbox mounts with Station 3 as the first backend; and the Vercel AI Gateway as a built-in provider. The current release is 4.3.0. The other Glove packages are versioned independently.

VersionHighlights
4.0.0Live runtime context at the model-input tail. Breaking for custom IGloveRunnable / IGloveBuilder implementations and exhaustive subscriber handlers.
4.1.0Foundry production controls; lazy goals, facts and forms; durable SQLite memory adapters; an interactive project initializer; MCP stdio transport.
4.2.0Browser scripting and persistent sandbox mounts (Station 3); runtime context accepts content parts as well as text.
4.3.0Vercel AI Gateway provider.

Breaking change in 4.0

Changing memory state stays out of system prompts. Before each iteration, core resolves every registered context provider and appends the results at the tail of the model input, after stored history and complete tool-result bundles. Saved conversation history is not changed, and the resolved snapshots are exposed to tracing. Goals, forms and pinned context all use this mechanism. Realtime voice injects changed snapshots silently at startup and after tools, with an explicit refresh for external changes (see Keeping a live session current).

Your own application state can use the same channel. A provider returns the current state, or null / undefined when it has nothing to add, and registration returns a function that removes it:

agent.tstypescript
const removeContext = agent.addContextProvider(async (signal) => {
  const order = await loadOrder(orderId, signal);
  return order ? `Order ${order.id} is ${order.status}.` : null;
});

// Later, when the state no longer applies:
removeContext();

Migrating from v3

The standard Glove class implements everything below. You only have work to do if you wrote one of these yourself:

  1. Custom IGloveRunnable. Implement addContextProvider(provider), which returns an unregister function, and getRuntimeContext(signal?), which resolves to the current snapshot messages. A wrapper around another runnable can forward both:
    runnable-proxy.tstypescript
    import type { IGloveRunnable } from "glove-core";
    
    // Spread into a wrapper that delegates to an inner runnable.
    export function forwardRuntimeContext(
      inner: IGloveRunnable,
    ): Pick<IGloveRunnable, "addContextProvider" | "getRuntimeContext"> {
      return {
        addContextProvider: (provider) => inner.addContextProvider(provider),
        getRuntimeContext: (signal) => inner.getRuntimeContext(signal),
      };
    }
  2. Custom IGloveBuilder. Implement addContextProvider with the same signature.
  3. Exhaustive subscriber handlers. Handle the new runtime_context event. Its data is { messages: Message[] }: the resolved snapshots, outside persisted history.
  4. Goals, forms and pinned context are live snapshots. They are appended at the model-input tail on every iteration, not written into the system prompt. Anything that expected to find that state in the system prompt or in saved history should read the runtime_context snapshots instead.

4.0.0 also preserves real user-turn boundaries when runtime context, inbox reminders, skills or compaction markers are present. Current-turn tool results stay full, pending reminders are appended after complete tool-result bundles, and structured image and video content survives when the OpenAI-compatible, OpenRouter and MiMo adapters merge adjacent user messages.

4.1

  • Foundry production controls. Glove Foundry now builds on the core runtime-context and multimodal contracts, and adds durable single-host data, authoritative conversation transcripts, adapter-owned HTTP authorization, expiring tool approvals, interrupt-and-restart steering and bounded programmatic tool composition.
  • Goals, facts and forms in Foundry. First-class lazy goals, facts, forms and native context-provider fields, with typed execution handles, conversation or instance scoping, opt-in shared preparation and metadata-only inspector progress. The SQLite bundle gains durable goal and form adapters and fact saves protected by process-death-safe locks. See Goal-oriented agents and Goals, facts & forms in Foundry.
  • Durable memory. Opt-in glove-memory/sqlite adapters for entity, episodic, resource and pinned-context memory on Node 22.13+, with isolated namespaces, transactional writes, cross-process reads and corruption checks. The browser-safe entry points are unchanged.
  • Project initializer. npx glove-foundry init is now an interactive initializer with target, starter and package-manager choices, a review before writing files, cancellation and optional dependency installation. Non-interactive flags still work for automation. It requires Node 20.12+ (22.13+ is recommended for SQLite memory). See Install & CLI.
  • MCP. stdio transport, tool allowlists, sanitized resources and prompts, bounded timeouts, lease-safe child recycling, live tool refresh and deactivation cleanup. See MCP.
  • Core tool-registry updates are atomic, and Gemini keeps provider thought signatures across tool turns. Foundry requires Station 2.3.0 or newer.

4.2

  • Browser and sandbox mounts. Adapter-backed browser scripting and persistent sandbox mounts, with Station 3 as the first backend. They use the existing mount approach and add no browser, sandbox or Station dependencies to glove-core. Retained browser scopes and a portable UTF-8 sandbox writeText ship with them. See Browsers & Sandboxes.
  • Multimodal runtime context. Context providers can return portable content parts as well as text. Browser mounts use this channel without replacing the agent's model, and media bytes and URLs are left out of runtime_context telemetry.
  • Foundry and Station. Agent jobs move into a separate managed Station daemon process, and Foundry now requires Node 22+. An optional application-level stationDaemon setting lets that daemon host browser and sandbox provider adapters alongside agent jobs. Mounts can register cleanup with Foundry. See Browser & sandbox agent.
  • Scheduled activation transitions are serialized, so a pause, update or cancellation can no longer be overwritten by a stale dispatch or completion write.

4.3

The Vercel AI Gateway is a built-in provider. It routes through https://ai-gateway.vercel.sh/v1 using AI_GATEWAY_API_KEY, and inside a Vercel deployment falls back to the injected VERCEL_OIDC_TOKEN. With cache enabled, cache_control breakpoints are placed at the message level so they reach Anthropic models upstream. createChatHandler({ provider: "vercel" }) in glove-next works the same way.

model.tstypescript
import { createAdapter } from "glove-core/models/providers";

const model = createAdapter({
  provider: "vercel",
  model: "anthropic/claude-sonnet-4",
  cache: true,
});

ProviderDef gains an optional fallbackEnvVars list, and the new resolveProviderApiKey(def) helper reads envVar first, then each fallback in order. See Providers.

Where to read more