Agent Skillslobehub/lobehub › response-compliance

response-compliance

GitHub

用于对本地或远程 Response API 端点运行 OpenResponses 官方合规测试套件。支持开发模式、API Key 等多种认证方式,可执行基础响应、流式传输、工具调用等特定测试用例,并输出详细日志或 JSON 格式结果以集成 CI/CD。

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

Trigger Scenarios

需要验证 Response API 是否符合 OpenResponses 标准 进行 API 端点的合规性测试 调试 Response API 的 Schema 或功能

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": "OpenResponses API compliance testing. Use for Response API endpoint tests, compliance runs, schema debugging, response api test, or openresponses test tasks."
}

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

Version History

  • 29fe043 Current 2026-08-20 18:34

Same Skill Collection

.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/builtin-tool/SKILL.md
.agents/skills/chat-sdk/SKILL.md
.agents/skills/cleanup-git-worktrees/SKILL.md
.agents/skills/cli/SKILL.md
.agents/skills/data-fetching-architecture/SKILL.md
.agents/skills/db-migrations/SKILL.md
.agents/skills/debug-package/SKILL.md
.agents/skills/deep-review/SKILL.md
.agents/skills/design-prototype/SKILL.md
.agents/skills/desktop/SKILL.md
.agents/skills/docs-changelog/SKILL.md
.agents/skills/drizzle/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/skills-audit/SKILL.md
.agents/skills/spa-routes/SKILL.md
.agents/skills/split-micro-app/SKILL.md
.agents/skills/store-data-structures/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
.agents/skills/version-release/SKILL.md
.agents/skills/zustand/SKILL.md
.agents/skills/agent-testing/SKILL.md
.agents/skills/compose-atoms/SKILL.md
.agents/skills/debug-frontend-with-browser/SKILL.md
.agents/skills/pr/SKILL.md
packages/builtin-skills/src/acceptance/SKILL.md

Metadata

Files
0
Version
a06b4e2
Hash
290c5046
Indexed
2026-08-20 18:34

ホーム - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-30 06:28
浙ICP备14020137号-1 $お客様$