agent-Specialization/server/tasks
JOJO 652c160640 feat(runtime): 抽出 RuntimeService 公共任务入口,任务线程拆除 Flask 隐式上下文
Gateway 化阶段一/二实施(公共任务入口),计划与验收记录见 cache_research/gateway/phase12_implementation_plan.md;契约文档 docs/runtime_contract.md 为本地文档按仓库惯例不入库

- 新增 server/runtime/:RuntimeContext 三层模型(TrustedPrincipal/TaskParams/InternalDirectives)+ RuntimeService(create_task/cancel/guidance/queue/get_task_events)
- create_chat_task 强制显式 session_data(缺失 ValueError,i18n key tasks.missing_session_data);6 处调用点迁移至 runtime_service.create_task()(tasks/api、api_v1、workflow_runtime_api x2、chat_flow_task_main x2),门闸 token 移交与 notice 互斥豁免语义保留
- _run_chat_task 拆除 test_request_context 桥,任务线程全程 RuntimeIdentity 驱动
- 审批超时经 terminal._approval_timeout_seconds 透传至工具循环 4 个 _wait_* 调用点(默认 3600s 语义不变)
- 附带:config/_load_dotenv 容忍沙箱禁读 .env;AGENTS.md 同步结构

测试:改造相关 24/24 全绿(冒烟 6 + runtime_service 10 + model_persistence 4 + identity 路由 4);真实环境验证已由用户人工完成

Co-authored-by: Astrion powered by Kimi-K3 <astrion-agent@users.noreply.github.com>
Co-authored-by: Codex powered by ChatGPT-6-Astra <codex@example.com>
2026-09-07 16:16:12 +08:00
..
__init__.py release: sync from main @0f9fd1b2 (2026-08-22) 2026-08-22 12:27:19 +08:00
api.py feat(runtime): 抽出 RuntimeService 公共任务入口,任务线程拆除 Flask 隐式上下文 2026-09-07 16:16:12 +08:00
helpers.py release: sync from main @0f9fd1b2 (2026-08-22) 2026-08-22 12:27:19 +08:00
media.py release: sync from main @0f9fd1b2 (2026-08-22) 2026-08-22 12:27:19 +08:00
models.py feat(runtime): 抽出 RuntimeService 公共任务入口,任务线程拆除 Flask 隐式上下文 2026-09-07 16:16:12 +08:00
skills.py feat(i18n): 后端用户可见消息国际化(zh/en 双语 + ui_locale 偏好持久化) 2026-08-29 07:58:29 +08:00