agent-runtime-gateway-smoke-test
它能做什么
这个工具用来检查 AI 代理能否通过安全隧道与本地 API 通信,且不使用真实的工具或数据。它会测试整条通信链路,并确保测试结束后一切恢复正常。
适用场景
- ✓当你需要测试本地 API 能否与代理正常配合工作时。
- ✓当代理任务突然失效,你怀疑通信隧道有问题时。
- ✓当你在测试一个新配置,其中网站临时指向本地 API 时。
技能链接
https://github.com/affaan-m/ECC/blob/main/skills/agent-runtime-gateway-smoke-test/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“通过安全隧道验证我的本地 API 与 AI 代理之间的通信,不使用真实数据,测试完成后再恢复原来的连接。”
每周 5 个新技能,1 分钟读完。
工作原理
这个测试会先启动你的本地 API 和安全隧道。然后向隧道发送一个简单请求,确认 API 能正常响应。接着,让代理执行一个简单的测试任务,并检查本地 API 是否收到了预期的返回结果。最后,恢复网站原本的配置,并关闭测试用的 API 和隧道。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Agent Runtime Gateway Smoke Test
Use this workflow when an agent task runs in a remote sandbox that calls back to a local API through a gateway. It verifies the whole path without relying on connected tools or private production data.
When to Activate
- A local agent API needs an end-to-end runtime check.
- A task stalls after dispatch and the gateway or tunnel may be unreachable.
- A web app is temporarily pointed at a local API for agent testing.
- A previous test left the web app pointing at a stopped API.
Required Inputs
- Repository-relative instructions for starting the API and web app.
- The gateway route path and its expected anonymous response.
- An isolated test agent, a tool-free prompt, and its exact expected answer.
- A way to inspect task status and confirm a callback reached the local API.
- Provider credentials, supplied through the project's normal secret store. Name the providers in shared documentation; never copy credential values into the skill or test report.
If these inputs are unavailable, report the missing input instead of guessing an endpoint or using a real account.
Authorization and Cleanup
Confirm authorization to expose the local test API through the selected tunnel provider, dispatch the test task, and temporarily change the web app route. Use an isolated local web app or test deployment; do not switch a shared production app as part of this smoke test. Keep tunnel access scoped to the required authenticated route.
Install cleanup before changing the route: on success, error, timeout, interruption, or cancellation, restore the recorded target and verify health before stopping the API and tunnel. Track only the process IDs or resources created by this test. If restoration fails, report it immediately and keep the evidence needed to recover; do not claim success.
Smoke Test
- Record and check the original route. Note the web app's current API target and verify it is healthy. Keep this value locally for restoration. Confirm the test agent and data are isolated from real users.
- Start the local API and tunnel. Use a process manager that will keep both alive for the full test. Verify API health. Probe the gateway route anonymously and confirm the documented authentication response, usually
401or403. Confirm the probe appears in the local API log; an edge response alone does not prove the API was reached. - Switch the web app only after both checks pass. Verify a request from the web app reaches the local API. Check the route again after any web server restart or configuration reload.
- Run one tool-free task. Use a short prompt with an exact expected answer. Confirm the remote sandbox called the local gateway, the task reached a terminal state, and the returned answer matches. A queued or running task is not a pass.
- Restore the original route. Set the web app back to its recorded API target, verify that target and a representative page load, then stop the test API and tunnel. If restoration fails, report the broken route immediately.
Example checks, with values supplied by the project:
curl --silent --show-error --output /dev/null --write-out '%{http_code}\n' "$LOCAL_API_HEALTH_URL"
curl --silent --show-error --output /dev/null --write-out '%{http_code}\n' "$PUBLIC_GATEWAY_PROBE_URL"
The first command should return the project's healthy status. The second should return the documented anonymous authentication status and appear in the local API log. Do not put a credential in either URL.
Connected Tool Follow-up
Run a separate test only after the tool-free task passes. Use an explicit test connection and grants. Report connection presence and actions granted as different facts. Do not infer that an empty action search means no app is connected. Do not execute a write action against a real account as a smoke test.
Failure Handling
| Observation | Next check |
|---|---|
| Web page loads but API requests fail | Compare the configured API target with the listening process and restore the original route. |
Gateway probe gets a connection error or 404 |
Check tunnel lifetime, route path, and local API health before dispatching a task. |
Gateway probe gets 401 or 403, but no local log entry |
The response may come from the tunnel edge; verify the callback path. |
| Task stays queued or running | Check whether another dispatcher claimed it and whether the sandbox reached the local gateway. |
…
常见问题
为什么不用真实数据?
为了保证安全和隐私,这个测试只使用模拟场景,不会访问任何敏感信息。
什么是“安全隧道”?
它是一条受保护的连接,即使本地 API 和 AI 代理位于不同位置,也能安全地互相通信。
如果测试失败了会怎样?
测试会报告通信中哪一环出了问题(本地 API、隧道、代理或配置恢复),方便你针对性地修复。
详情
作者的原始描述
Verify a local agent API, temporary gateway tunnel, and remote sandbox callback with a tool-free task, then restore the original app connection.
repo: affaan-m/ECC
热度
- GitHub 星标
- 280k
- 排名
- #259
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
accessibility
280k帮你的智能体创建人人都能使用的界面。确保网站和应用对残障人士友好,比如失明或行动不便的用户也能顺畅使用。
agent-architecture-audit
280k让你的智能体检查一切是否正常运行。它能找出并修复 AI 系统中的问题,确保系统按预期工作。
agent-eval
280k帮你的智能体比较不同的 AI 编程工具。它能衡量哪个工具在特定任务上更快、更便宜、更可靠。
agent-harness-construction
280k让你的智能体更好地理解如何完成任务。它会优化智能体使用的工具和指令,提高成功的几率。