群内插句嘴实现:能量窗口 + 群管鉴权(issue #159) #168
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/159-group-slow-interrupt"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #159
What
正式给 issue #37 AC7 交付的
slow_interrupt_energy_boost(gating.py)接上消费方:群内非 @ 消息的"插句嘴"能力,per-chat opt-in、能量窗口触发(ADR-0032)。IsGroupAdmin/ArisePorts.is_group_admin,语义严格限定"平台原生群管理员/群主判断"——不复用ports.is_adminSlowInterruptStoragePort)+/setslowinterrupt命令(经_group_admin_gate校验,host 未接线时如实说明不支持)IngressPort.is_bot_of同步早期判定 +_handle_group_slow_interrupt(新@event_postprocessor分派点):tier-1(活跃度信号喂情感态 EMA)恒开、不受 opt-in 限制;tier-2(读内容判断是否接话)需要 opt-in + 能量窗口两道闸都过RuntimeLoop.run_group_slow_interrupt:不经run(),天然不写 Delta(AC5"未接话内容不写入任何 RecallEvent/长期存储"由此自动满足)TriggerPath新增group_slow_interrupt,decision_snapshot.py/cost.py/explain.py/gate_pipeline.py完成 blast radius 更新Review 修复
两轴 review(Standards + Spec)+ 对抗式 Verify 确认 4 处问题并已修复:
run_group_slow_interrupt未解析message.media_refs就组装上下文,带图片/贴纸的非 @ 消息触发插句嘴评估时会在assemble_context对空media_content取KeyError,被外层except Exception静默吞掉——已接入_resolve_media_content,并补充回归测试(先反向验证测试能捕获该 bug,再确认修复后通过)_spawn_slow_interrupt_window_record的 fire-and-forget 任务缺少异常兜底——已仿_learn_stickers先例包一层try/except + logger.exceptioncost.py/gate_pipeline.py的触发路径计数文档未同步新增的第六条路径——已更新PersistentStorage方法此前只经内存版SentLog测过——已补test_slow_interrupt_storage.py(memory/persistent 参数化覆盖)Test plan
uv run pytest -q:1993 passeduv run ruff check src/ tests/:全通过uv run lint-imports:2 kept, 0 brokenty check:47 diagnostics(与 main 基线一致,无新增)_handle_group_slow_interrupt的 opt-in/窗口/is_bot/私聊/续期共 5 处守卫逐一变异验证测试能捕获