Files
Nexus/docs/changelog/2026-06-08-script-exec-results-mediumtext.md
T
Nexus Agent 09d4613e46 fix(scripts): script_executions.results 扩 MEDIUMTEXT 并截断落库
366 台批量执行 results JSON 超 TEXT 64KB 导致 flush 失败、状态卡在 running。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-08 11:57:20 +08:00

931 B

2026-06-08 — 脚本执行 results 落库 TEXT 溢出修复

摘要

  • script_executions.results 扩为 MEDIUMTEXT
  • Redis → MySQL flush 前截断每台 stdout/stderr(512 字符),超大批次降级为摘要

动机

366 台脚本执行结果 JSON 约 75KB,超过 MySQL TEXT(64KB),flush 失败导致状态卡在 running、无 completed_at

涉及文件

  • server/infrastructure/redis/script_execution_store.py
  • server/domain/models/__init__.py
  • server/infrastructure/database/migrations.py
  • tests/test_script_execution_mysql_persist.py

迁移/重启

  • 启动时 run_schema_migrations() 自动 MODIFY results MEDIUMTEXT
  • 需重启 API 容器使新 flush 逻辑生效

验证

pytest tests/test_script_execution_mysql_persist.py -q
bash deploy/pre_deploy_check.sh

部署后:执行记录 #14 应在 60s 内 flush 为 partial 并写入 completed_at