ag-ui-protocol / ag-ui-protocol/ag-ui

test: migrate release-note Anthropic mocks to aimock

Aberta
#2,482 0 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
15.9k
Forks
1.4k
Merge médio
1d 17h
PRs com merge (30d)
163

Descrição

## Context

The retired-Anthropic-model audit exposed test-hygiene debt in `scripts/release/generate-ai-release-notes.test.ts`. The audit-remediation PR intentionally keeps its scope to updating model references; this issue tracks the test cleanup separately.

## Problem

The Anthropic request-path tests currently use hand-written HTTP servers instead of the repository's preferred aimock fixtures. In the affected test regions this also leaves:

- a dynamic `await import("node:http")` inside a test callback;
- type and non-null assertions such as `server!`, `server.address() as { port: number }`, and `receivedBody.messages!`;
- duplicated HTTP-server setup across multiple tests;
- a bespoke Anthropic response stub that can drift from provider request and response shapes.

## Proposed remediation

- Migrate the release-note Anthropic integration tests to Vitest with `@copilotkit/aimock/vitest` in strict replay mode.
- Add deterministic fixtures and assert the request journal, including method, path, headers, selected model, token limit, and prompt content.
- Replace dynamic imports, casts, non-null assertions, and duplicated server setup with typed file-local helpers.
- Keep the existing success, transport-failure, and non-2xx fail-soft coverage.
- Update the release-script CI workflow and package dependencies as required by the isolated migration.

## Acceptance criteria

- All existing release-note test behaviors remain covered.
- No live Anthropic request or credential is required.
- Unmatched model requests fail loudly in CI.
- The migrated test passes formatting, lint, explicit typecheck, and the full release-script test workflow.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.