@voltagent/server-elysia@2.0.8

VoltAgent/voltagent@voltagent/server-elysia@2.0.8Apr 22, 2026by voltagent-bot

AI Summary

Patch release mirroring the request headers feature from the core package.

Key Highlights

  • Expose request headers to dynamic agent configuration.
  • Update dependencies to `@voltagent/core@2.7.1` and `@voltagent/server-core@2.1.14`.

New Features

  • Expose request headers to dynamic agent configuration

Full Release Notes

### Patch Changes

-   [#1218](https://github.com/VoltAgent/voltagent/pull/1218) [`4860832`](https://github.com/VoltAgent/voltagent/commit/48608321ec9a67a6bb0cc93ec93681eab51de9d0) Thanks [@omeraplak](https://github.com/omeraplak)! - feat(agent): expose request headers to dynamic agent configuration

    Dynamic `instructions`, `model`, and `tools` functions now receive a `headers` map in
    `DynamicValueOptions` when an agent is called through the built-in HTTP endpoints. This makes it
    possible to configure tenant-aware models and request-scoped tools from headers such as
    `authorization`, `x-tenant-id`, or `x-user-id` without manually copying them into
    `options.context`.

    Header names are normalized to lowercase:

    ```ts
    const agent = new Agent({
      name: "Tenant Agent",
      instructions: "You are a tenant-aware assistant.",
      model: ({ headers }) => {
        return headers?.["x-tenant-id"] === "enterprise" ? "openai/gpt-4o" : "openai/gpt-4o-mini";
      },
      tools: ({ headers }) => {
        return headers?.authorization ? [createTenantTool(headers.authorization)] : [];
      },
    });
    ```

    For direct in-process calls, pass `requestHeaders`:

    ```ts
    await agent.generateText("Hello", {
      requestHeaders: {
        authorization: "Bearer token",
        "x-tenant-id": "tenant-1",
      },
    });
    ```

    Fixes #1201

-   Updated dependencies \[[`4860832`](https://github.com/VoltAgent/voltagent/commit/48608321ec9a67a6bb0cc93ec93681eab51de9d0), [`71c9f84`](https://github.com/VoltAgent/voltagent/commit/71c9f84a9f58b591c453900c7c0a4eda53a08196)]:
    -   @voltagent/core@2.7.1
    -   @voltagent/server-core@2.1.14