mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-15 00:21:58 +00:00
转发运行事件时跳过不认识的事件种类(回放照样读得到);test-multiprocess.sh 不带参数时 macOS 的 bash 3.2 报 args 未定义,参数直接原样交给 pytest
This commit is contained in:
@@ -159,11 +159,14 @@ class Relay:
|
|||||||
.order_by(RunEvent.seq))).scalars())
|
.order_by(RunEvent.seq))).scalars())
|
||||||
last_log = None
|
last_log = None
|
||||||
for row in rows:
|
for row in rows:
|
||||||
event = RunEventModel(id=row.id, run_id=run_id, seq=row.seq, type=EventType(row.type),
|
|
||||||
node_id=row.node_id, ts=row.ts, data=row.data or {})
|
|
||||||
await bus.publish(event, relayed=True)
|
|
||||||
self._cursor[run_id] = max(self._cursor.get(run_id, 0), int(row.seq or 0))
|
self._cursor[run_id] = max(self._cursor.get(run_id, 0), int(row.seq or 0))
|
||||||
last_log = row
|
last_log = row
|
||||||
|
try:
|
||||||
|
event = RunEventModel(id=row.id, run_id=run_id, seq=row.seq, type=EventType(row.type),
|
||||||
|
node_id=row.node_id, ts=row.ts, data=row.data or {})
|
||||||
|
except ValueError:
|
||||||
|
continue # 不认识的事件种类(更新的版本写的):回放时照样读得到,这里不转
|
||||||
|
await bus.publish(event, relayed=True)
|
||||||
ended = status is None or status in _TERMINAL or (
|
ended = status is None or status in _TERMINAL or (
|
||||||
status == "interrupted" and last_log is not None and last_log.type == EventType.LOG
|
status == "interrupted" and last_log is not None and last_log.type == EventType.LOG
|
||||||
and (last_log.data or {}).get("code") == "server_shutdown")
|
and (last_log.data or {}).get("code") == "server_shutdown")
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ export AGENTLAB_MULTIPROCESS_E2E=1
|
|||||||
echo "测试库:127.0.0.1:${PORT}/${DB}(容器 ${NAME},结束后删除)"
|
echo "测试库:127.0.0.1:${PORT}/${DB}(容器 ${NAME},结束后删除)"
|
||||||
|
|
||||||
cd "$ROOT/backend"
|
cd "$ROOT/backend"
|
||||||
args=("$@")
|
|
||||||
# 不并行(-p no:xdist):工作进程、端口、库都是这一组共用的;-s 让工作进程的日志在失败时看得到
|
# 不并行(-p no:xdist):工作进程、端口、库都是这一组共用的;-s 让工作进程的日志在失败时看得到
|
||||||
env -u ANTHROPIC_API_KEY -u ANTHROPIC_BASE_URL -u ANTHROPIC_AUTH_TOKEN -u OPENAI_API_KEY \
|
env -u ANTHROPIC_API_KEY -u ANTHROPIC_BASE_URL -u ANTHROPIC_AUTH_TOKEN -u OPENAI_API_KEY \
|
||||||
"$PY" -m pytest tests/test_multiprocess_e2e.py -p no:xdist -p no:randomly -rA "${args[@]}"
|
"$PY" -m pytest tests/test_multiprocess_e2e.py -p no:xdist -p no:randomly -rA "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user