ag-ui-protocol / ag-ui-protocol/ag-ui
test: migrate release-note Anthropic mocks to aimock
- 主要语言
- Python
- 星标
- 15.9k
- 派生
- 1.4k
- 平均合并
- 1 天 17 小时
- 30 天内合并 PR
- 163
描述
## 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.
贡献指南
评估
这个 Issue 还没有评估数据。