Use for OpenResponses/Response API compliance tests, endpoint schema failures and test runs.
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-response-compliance-6ede38854c19 ,按照其中的说明把「response-compliance」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Run the official OpenResponses compliance test suite against the local (or remote) Response API endpoint.
# From the openapi package directory
cd packages/openapi
# Run all tests (dev mode, localhost:3010)
APP_URL=http://localhost:3010 bun run test:response-compliance -- \
--auth-header "lobe-auth-dev-backend-api" --no-bearer --api-key 1
# Run specific tests only
APP_URL=http://localhost:3010 bun run test:response-compliance -- \
--auth-header "lobe-auth-dev-backend-api" --no-bearer --api-key 1 \
--filter basic-response,streaming-response
# Verbose mode (shows request/response details)
APP_URL=http://localhost:3010 bun run test:response-compliance -- \
--auth-header "lobe-auth-dev-backend-api" --no-bearer --api-key 1 -v
# JSON output (for CI)
APP_URL=http://localhost:3010 bun run test:response-compliance -- \
--auth-header "lobe-auth-dev-backend-api" --no-bearer --api-key 1 --json
ENABLE_MOCK_DEV_USER=true in .envapi/v1/responses route registered (via src/app/(backend)/api/v1/[[...route]]/route.ts)| Mode | Flags |
|---|---|
| Dev (mock user) | --auth-header "lobe-auth-dev-backend-api" --no-bearer --api-key 1 |
| API Key | --api-key lb-xxxxxxxxxxxxxxxx |
| Custom | --auth-header <name> --api-key <value> |
Available --filter values:
| ID | Description | Related Issue |
|---|---|---|
basic-response | Simple text generation (non-streaming) | LOBE-5858 |
streaming-response | SSE streaming lifecycle + events | LOBE-5859 |
system-prompt | System role message handling | LOBE-5858 |
tool-calling | Function tool definition + call output | LOBE-5860 |
image-input | Multimodal image URL content | — |
multi-turn | Conversation history via input items | LOBE-5861 |
| Variable | Default | Description |
|---|---|---|
APP_URL | http://localhost:3010 | Server base URL (auto-appends /api/v1) |
API_KEY | — | API key (alternative to --api-key flag) |
The script (packages/openapi/scripts/compliance-test.sh) clones the official openresponses/openresponses repo into scripts/openresponses-compliance/ (gitignored) and runs its CLI test runner. First run clones; subsequent runs update from upstream.
-v to see full request/response payloadspackages/openapi/src/types/responses.type.tspackages/openapi/src/services/responses.service.tspackages/openapi/src/controllers/responses.controller.tspackages/openapi/src/routes/responses.route.tspackages/openapi/scripts/compliance-test.shsrc/app/(backend)/api/v1/[[...route]]/route.ts