|
|
66fa90d6cc
|
feat(server): headless 启动入口(Gateway 专用路由面)+ approval 拆独立蓝图
- 新增 server/headless_app.py:仅挂 gateway/tasks/status/approval/usage 五件蓝图,
无 web 站点路由面(/login、会话管理、静态页全砍),根路径返回 HTML 告知页;
供 CLI 探测无服务时 spawn(同 RuntimeService 单例/数据目录/端口 8091,
与 full 形态互斥不并存)
- server/chat/approval.py 拆出 approval_bp(tool/plan/question 6 条路由 URL 不变),
解除对 chat_bp 的 import 循环,full/headless 双形态共用
- cli/src/gateway.ts:spawn 切 server.headless_app;python 解释器改 pickPython
依赖探测(import yaml/flask 逐个试 .venv → homebrew 3.12/3.11 → python3),
修本机 .venv 缺 pyyaml 导致的自启动即崩
- 修复 socket 移除残留雷:make_terminal_callback 定义随 broadcast.py 被删,
workflow_runtime_api 模块级 import 即炸;resources.py 补兼容空操作(恒返 None)
- AGENTS.md §2 补 headless 启动命令、§12.5 补兼容空操作与 headless 形态说明
验证:tsc ✅ py_compile ✅ 冒烟 6/6 ✅ headless 装配 47 路由 ✅
8093 真实冒烟(health/Bearer/404 面/告知页)✅
Co-authored-by: Astrion powered by Kimi-K3 <astrion-agent@users.noreply.github.com>
|
2026-09-11 19:00:22 +08:00 |
|
|
|
e5808ea5be
|
refactor(server,web): remove Socket.IO entirely, unify on REST polling
- task event stream (_append_event) is now the sole realtime channel for web and CLI
- status snapshots: idle 5s polling of /api/status (was status_update push); operation initiator gets state from REST responses
- terminal panel: REST polling (list 5s, output 1.5s, prefix-matched incremental xterm writes)
- multi-tab passive sync deliberately degrades to polling-based perception
- delete socket_handlers/broadcast/useLegacySocket (2103-line dead file); extensions.py keeps only run_background
- remove socket token chain (/api/socket-token, prune/consume_socket_token, pending_socket_tokens)
- app.run(threaded=True) replaces socketio.run; reapers switched to plain threading
- drop flask-socketio/socket.io-client/websockets dependencies
- docs: AGENTS.md section 12.5 (replacement map + hard constraints), plus CLI rewrite companion doc updates
Co-authored-by: Astrion powered by Kimi-K3 <astrion-agent@users.noreply.github.com>
|
2026-09-11 17:28:47 +08:00 |
|
|
|
aa9bf377a3
|
feat(runtime): Gateway 收尾——session 传输暴露、host Bearer 通道、flask 依赖拆解、审批链路收口
- session.* 传输暴露:新增 gateway_api 蓝图(list/create/history),RuntimeService 补 create_session
- host Bearer 通道:gateway_auth 双通道认证(host 模式+回环限定,token 存 DATA_DIR/host_api_token),tasks/approval 路由接入
- api_v1 会话路由转调公共入口消双轨,会话索引/列表补齐 run_mode/model_key/custom_prompt_name/personalization_name
- flask 包依赖拆解:_flask_bridge 延迟桥接 + context 子包 PEP 562 懒加载,import server.tasks/runtime 不再拉起 flask
- 审批链路:mark_expired 终态回写(超时/软停止/取消三路径)+ 终态 TTL 惰性清理(3600s)
- 测试 patch 点随迁;全量 75 测试失败恰为 4 项存量,独立启动验收 4/4 全绿
Co-authored-by: Astrion powered by Kimi-K3 <astrion-agent@users.noreply.github.com>
|
2026-09-08 11:37:51 +08:00 |
|
|
|
9a17b38153
|
fix(context): 补拆包遗漏的 get_current_user_role 导入,修复 host 策略静默失效
拆包时 resources.py 独立 import 头漏了 get_current_user_role:host 模式 + 非显式身份 + 存在 host 用户记录时触发 NameError,被 except 吞掉后工具分类限制与禁用模型等管理员策略静默不应用(默认无 host 记录不触发)。
- resources.py/usage.py 顺带补 TYPE_CHECKING 导入净化字符串类型注解,server/context/ 与 server/runtime/ pyflakes F821 清零
- 新增回归测试:host 模式 + HTTP 请求上下文 + host 记录存在,断言策略真正应用到 terminal;红绿验证通过(回退导入测试即红)
测试:25/25 全绿(24 + 新增 1)
|
2026-09-07 17:40:49 +08:00 |
|
|
|
7d290d1790
|
refactor(context): server/context.py 拆分为子包,get_user_resources 参数化
- 989 行单文件拆为 server/context/ 9 模块(identity/broadcast/personalization/usage/upload/conversation/resources/decorators/reaper)+ __init__.py 兼容 re-export,外部 import 路径不变
- 新增 RuntimeIdentity 显式身份快照(identity.py),get_user_resources 支持参数化身份驱动,为任务线程拆除 Flask 隐式上下文做准备
- 测试 patch 目标随迁至 server.context.personalization;新增 test_runtime_identity_resources 覆盖 web/host/api 身份路由矩阵
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:14:53 +08:00 |
|