INSERT INTO ias_upgrade_logs (
    version,
    released_at,
    title,
    description,
    changes,
    modules
) VALUES (
    '0.2.20',
    '2026-07-08T00:00:00+08:00',
    '微信输入中状态修复',
    '微信输入中状态改用官方 sendtyping 流程，并在回复完成或上下文打断时显式取消。',
    '[
        "微信输入中状态改用 getconfig + sendtyping 流程：按用户获取并缓存 typing_ticket，再发送 typing/cancel 状态，不再依赖 sendmessage 的 message_state=1 中间态。",
        "服务队列在最终回复发出后、空回复结束时和 /new 打断当前 turn 时会显式取消微信输入中状态，避免提示残留。",
        "微信 sendmessage 请求补齐 base_info；所有微信 API 请求默认带 iLink-App-Id=bot，并可通过 WEIXIN_APP_ID 覆盖。",
        "数据库无结构变化。"
    ]'::jsonb,
    '{
        "ias-common": "0.1.2",
        "ias-ai": "0.1.9",
        "ias-wechat": "0.1.1",
        "ias-context": "0.1.4",
        "ias-http": "0.1.12",
        "ias-mail": "0.1.15",
        "ias-service": "0.1.17",
        "ias-main": "0.2.20"
    }'::jsonb
) ON CONFLICT (version) DO UPDATE SET
    released_at = EXCLUDED.released_at,
    title = EXCLUDED.title,
    description = EXCLUDED.description,
    changes = EXCLUDED.changes,
    modules = EXCLUDED.modules;
