360 Secure SkillHub
360 安全技能中心

agentscope-agent-test-harness

根据现有 AgentScope 智能体模块生成轻量测试脚本,用假模型替代真实模型调用,断言工具调用、消息格式与状态转移,可用 pytest 离线运行,并输出通过/失败报告。

分类:开发
trend0522
trend0522
热度 8.71
最近更新 2026-10-03 10:10:30

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add trend0522/agentscope-agent-test-harness
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
agentscope-agent-test-harness
description
Create and run lightweight tests for AgentScope agents without hitting external APIs. Use this whenever the user wants to validate agent wiring, tool binding, or prompt formatting before live model calls.
version
0.1.0
metadata
{"openclaw":{"requires":{"env":["OPENAI_API_KEY"],"bins":["python3"]},"primaryEnv":"OPENAI_API_KEY","envVars":[{"name":"OPENAI_API_KEY","required":true,"description":"OpenAI or compatible API key."},{"name":"AGENTSCOPE_TEST_MODE","required":false,"description":"When set, skip live model calls and run offline assertions only."}],"emoji":"🧪","homepage":"https://github.com/agentscope-ai/agentscope"}}

AgentScope Agent Test Harness

This skill helps you test AgentScope agents with mocked models and offline assertions.

What this skill does

  • Creates a test harness for an existing agent module
  • Replaces the live model with a fake one that returns canned responses
  • Asserts tool calls, message formatting, and agent state transitions
  • Reports pass/fail in markdown

Usage

Run the harness generator from this skill folder:

python3 scripts/generate_harness.py --agent /path/to/agent_module.py --output /path/to/test_harness.py

Then run:

python3 -m pytest /path/to/test_harness.py

Safety

  • No live API calls are made unless the agent explicitly uses a real model.
  • Tests are offline by default.