Agent Skills › lobehub/lobehub › response-compliance

response-compliance

GitHub

用于对 Response API 运行 OpenResponses 合规测试套件,验证端点 Schema、基本响应、流式传输及工具调用等功能的正确性。

.agents/skills/response-compliance/SKILL.md lobehub/lobehub

Trigger Scenarios

需要验证 API 合规性 检查端点 Schema 失败 执行 API 测试用例

Install

npx skills add lobehub/lobehub --skill response-compliance -g -y
More Options

Non-standard path

npx skills add https://github.com/lobehub/lobehub/tree/canary/.agents/skills/response-compliance -g -y

Use without installing

npx skills use lobehub/lobehub@response-compliance

指定 Agent (Claude Code)

npx skills add lobehub/lobehub --skill response-compliance -a claude-code -g -y

安装 repo 全部 skill

npx skills add lobehub/lobehub --all -g -y

预览 repo 内 skill

npx skills add lobehub/lobehub --list

SKILL.md

Frontmatter
{
    "name": "response-compliance",
    "description": "Use for OpenResponses\/Response API compliance tests, endpoint schema failures and test runs."
}

OpenResponses Compliance Test

Run the official OpenResponses compliance test suite against the local (or remote) Response API endpoint.

Quick Start

# 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

Prerequisites

  • Dev server running with ENABLE_MOCK_DEV_USER=true in .env
  • The api/v1/responses route registered (via src/app/(backend)/api/v1/[[...route]]/route.ts)

Auth Modes

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>

Test IDs

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

Environment Variables

Variable Default Description
APP_URL http://localhost:3010 Server base URL (auto-appends /api/v1)
API_KEY — API key (alternative to --api-key flag)

How It Works

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.

Debugging Failures

  1. Run with -v to see full request/response payloads
  2. Common failure patterns:
    • "Failed to parse JSON": Auth failed, server returned HTML redirect
    • "Response has no output items": LLM execution not yet implemented
    • "Expected number, received null": Missing required field in response schema
    • "Invalid input": Zod validation on response schema — check field format

Key Files

  • Types: packages/openapi/src/types/responses.type.ts
  • Service: packages/openapi/src/services/responses.service.ts
  • Controller: packages/openapi/src/controllers/responses.controller.ts
  • Route: packages/openapi/src/routes/responses.route.ts
  • Test script: packages/openapi/scripts/compliance-test.sh
  • Cloud route: src/app/(backend)/api/v1/[[...route]]/route.ts

Version History

  • 69012b8 Current 2026-09-28 20:14

    修复了过时的代码引用

  • e0d4b61 2026-09-23 09:53
  • 29fe043 2026-08-20 18:34

Same Skill Collection

.agents/skills/add-model-provider/SKILL.md
.agents/skills/add-provider-doc/SKILL.md
.agents/skills/add-setting-env/SKILL.md
.agents/skills/agent-runtime-hooks/SKILL.md
.agents/skills/agent-signal/SKILL.md
.agents/skills/agent-testing-bot/SKILL.md
.agents/skills/agent-tracing/SKILL.md
.agents/skills/agent-work/SKILL.md
.agents/skills/alint-ruleset/SKILL.md
.agents/skills/builtin-tool/SKILL.md
.agents/skills/chat-sdk/SKILL.md
.agents/skills/cleanup-git-worktrees/SKILL.md
.agents/skills/cli/SKILL.md
.agents/skills/compose-atoms/SKILL.md
.agents/skills/data-fetching-architecture/SKILL.md
.agents/skills/db-migrations/SKILL.md
.agents/skills/debug-frontend-with-browser/SKILL.md
.agents/skills/debug-package/SKILL.md
.agents/skills/deep-review/SKILL.md
.agents/skills/design-prototype/SKILL.md
.agents/skills/desktop-security-update/SKILL.md
.agents/skills/desktop/SKILL.md
.agents/skills/docs-changelog/SKILL.md
.agents/skills/drizzle/SKILL.md
.agents/skills/full-text-search/SKILL.md
.agents/skills/heterogeneous-agent/SKILL.md
.agents/skills/hotkey/SKILL.md
.agents/skills/i18n/SKILL.md
.agents/skills/linear/SKILL.md
.agents/skills/llm-generation/SKILL.md
.agents/skills/modal/SKILL.md
.agents/skills/model-bank-metadata/SKILL.md
.agents/skills/product-design/SKILL.md
.agents/skills/project-overview/SKILL.md
.agents/skills/react/SKILL.md
.agents/skills/run-eval-harbor/SKILL.md
.agents/skills/skills-audit/SKILL.md
.agents/skills/source-layout/SKILL.md
.agents/skills/spa-routes/SKILL.md
.agents/skills/split-large-file/SKILL.md
.agents/skills/split-micro-app/SKILL.md
.agents/skills/store-data-structures/SKILL.md
.agents/skills/testing-heterogeneous-agents/SKILL.md
.agents/skills/testing/SKILL.md
.agents/skills/trpc-router/SKILL.md
.agents/skills/typescript/SKILL.md
.agents/skills/upstash-workflow/SKILL.md
.agents/skills/ux-audit/SKILL.md
.agents/skills/ux/SKILL.md

Metadata

Files
0
Version
aace12f
Hash
352c341d
Indexed
2026-08-20 18:34

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-24 15:05
浙ICP备14020137号-1