feat: 模块统一 ias- 前缀、独立版本与内网地址支持 (0.1.7)
- 所有 Rust crate 统一加 ias- 前缀:ai → ias-ai、common → ias-common、context → ias-context、mail → ias-mail、service → ias-service、wechat → ias-wechat - 新增 ias-main 模块承载 CLI 入口和二进制打包 - 各模块开始独立维护版本号,ias-main 0.1.7 代表整体版本 - 新增 IA_WEB_INTERNAL_URL 环境变量,版本通知同时发送公网和内网链接 - 将已有升级日志翻译为中文 - ias_upgrade_logs 新增 modules JSONB 字段 - 新增 VERSION 文件和 CHANGELOG.md - 新增 AGENTS.md 项目规则文件
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
UPDATE ias_long_term_memories
|
||||
SET scope_key = channel || ':' || account_id || ':' || from_user_id;
|
||||
|
||||
UPDATE ias_context_sessions
|
||||
SET scope_key = channel || ':' || account_id || ':' || from_user_id;
|
||||
|
||||
UPDATE ias_context_summaries AS summary
|
||||
SET scope_key = session.scope_key
|
||||
FROM ias_context_sessions AS session
|
||||
WHERE summary.source_session_id = session.id;
|
||||
|
||||
WITH ranked AS (
|
||||
SELECT
|
||||
id,
|
||||
ROW_NUMBER() OVER (
|
||||
PARTITION BY scope_key
|
||||
ORDER BY started_at DESC, id DESC
|
||||
) AS rank
|
||||
FROM ias_context_sessions
|
||||
WHERE ended_at IS NULL
|
||||
)
|
||||
UPDATE ias_context_sessions AS session
|
||||
SET
|
||||
ended_at = last_message_at,
|
||||
end_reason = 'scope_normalized',
|
||||
summary = COALESCE(summary, '旧上下文 scope 合并时自动结束。')
|
||||
FROM ranked
|
||||
WHERE session.id = ranked.id
|
||||
AND ranked.rank > 1;
|
||||
Reference in New Issue
Block a user