skills/qa-agent-docs/qa-agent/02-log-guard-plan.md
这是当前活跃设计,已有第一版文件扫描 MVP。实现边界需要和黑盒 E2E 路线保持一致:
lbs test report。LANGBOT_REPO/data/logs/ 下最新的 langbot-*.log,也可扫描 agent
显式提供的 backend/frontend/console 日志文件。当前总体路线见:
docs/qa-agent/04-black-box-e2e-roadmap.md
日志守卫是 lbs test report 的一部分,用来在 agent 执行测试期间捕获 UI 断言之外的运行时问题。
当前命令方向已收敛为 lbs test plan / lbs test report。日志守卫服务于 agent-browser QA,不是独立的后端 API 测试入口。
LangBot 是异步且集成度高的系统,有些问题不会直接表现为页面失败:
日志守卫负责把这些信号结构化地放进测试报告,并关联到 troubleshooting 资产。
日志守卫应从环境和运行上下文读取配置:
skills/.env 中的 LANGBOT_BACKEND_URLskills/.env 中的 LANGBOT_REPO,用于自动发现 LangBot 后端日志lbs test plan / report 记录的 case id除非 case 明确声明,否则应失败:
TracebackTask exception was never retrievedRuntimeWarning: coroutine .* was never awaitedUnclosed client sessionUnclosed connectorKeyErrorTypeErrorAttributeError只有当前 case 声明时允许:
报告但默认不失败:
日志守卫不只输出错误文本,还应尽量匹配已知 troubleshooting id。
例子:
Action list_plugins call timed out
Action list_agent_runners call timed out
Action invoke_llm_stream call timed out
可映射到:
plugin-runtime-timeout
uppercase proxy points to one host, lowercase proxy points to another
可映射到:
proxy-env-mismatch
bin/lbs test plan pipeline-debug-chat
bin/lbs test start pipeline-debug-chat
bin/lbs test run pipeline-debug-chat --dry-run
bin/lbs test report pipeline-debug-chat
bin/lbs test report --output report.md
bin/lbs test report pipeline-debug-chat --backend-log /path/to/backend.log --console-log /path/to/console.log
bin/lbs test report pipeline-debug-chat --since "2026-05-21T10:30:00+08:00"
bin/lbs test report pipeline-debug-chat --tail-lines 2000
bin/lbs test report pipeline-debug-chat --since "2026-05-21T10:30:00+08:00" --tail-lines 2000
bin/lbs test report pipeline-debug-chat --no-auto-log
运行报告应包含:
--since 或 --tail-lines 把扫描范围限制到本次测试窗口。plugin-runtime-timeout 和 proxy-env-mismatch。langbot-testing case 使用它。当前 MVP 已覆盖自动发现 LangBot 后端日志、文件扫描、--since/--tail-lines 扫描窗口、
基础错误检测、case success/failure signal、troubleshooting 匹配、secret 脱敏和 --json
输出。仍待继续完善的是 live log 采集、更多规则、case 级 expected failure 的资产化和真实
E2E report 样例。