0.18

An agent's loop is its harness, and the AI SDK loop's options move into it.

Move loop options into harness

server/assistant.ts
import { agent } from 'experimental-a2/ai/server'

export const assistant = agent({
  name: 'support-agent',
  model: 'openai/gpt-5.6-terra',
  instructions: 'Help the customer. Be concise.',
  harness: {
    type: 'ai-sdk',
    // generation, generate, compaction, and messageMetadata go here:
    compaction: { thresholdTokens: 80_000 },
  },
})

agent() takes its loop as harness. The AI SDK's loop is the default, { type: 'ai-sdk' }, and its options move into it: generation, generate, compaction, and messageMetadata are no longer top-level agent() options, and passing one there throws a TypeError. See Harnesses.

Models are AI Gateway IDs

model is an AI Gateway model ID, or ModelSettings with one, under every harness. agent() no longer takes AI SDK provider model objects, and HarnessModelSettings is gone: use ModelSettings.