Feishu: hidden session-checkpoint marker ("Continue the active task...") is delivered to the user after idle compaction
Bug Description
On the Feishu (Lark) channel, the internal session-checkpoint marker message
Continue the active task from the working-memory checkpoint above.is delivered to the user as an ordinary chat message after idle auto-compaction runs. This message is persisted with "_hidden_history": true and is explicitly documented as something that must not be shown as a chat turn, yet it reaches the chat.
This is not the compaction-notice noise already tracked in #5784 / #5780. Those are about the visible lifecycle strings (Compressing context… / Context compacted.), whose content is intended to be visible on channels that can render it. The message here is a hidden internal marker that was never meant to be user-visible at all, so it is a different defect on a different delivery path.
Steps to Reproduce
- Enable the Feishu channel with streaming on:
{
"channels": {
"feishu": { "instances": [{ "enabled": true, "streaming": true }] }
},
"agents": {
"defaults": { "idleCompactAfterMinutes": 15 }
}
}- DM the bot a few turns and leave the session idle past
idleCompactAfterMinutes(default 15 min) so idle auto-compaction runs. - Observe a standalone message
Continue the active task from the working-memory checkpoint above.posted into the Feishu chat. - Repeat idle → another identical message is posted. Observed twice on 2026-09-24 at 20:59 and 21:26 (Asia/Shanghai).
Expected Behavior
The checkpoint marker is committed with HIDDEN_HISTORY_META: True and session/manager.py's own docstring states the marker "is not a user request and must not resume an old task on the next turn." It therefore must not be rendered to the user on any channel.
Concretely:
_hidden_history: truemessages are never delivered to a chat channel.- The marker keeps doing its internal job of marking the archived boundary for replay.
get_history()already skips it viais_summary_checkpoint(); the chat delivery path must apply the same visibility rule.
Relevant Logs
Two persisted records from the live Feishu session file (sessions/<id>/<base64-session-key>.jsonl):
{"role": "user", "content": "Continue the active task from the working-memory checkpoint above.", "_hidden_history": true, "timestamp": "2026-09-24T20:59:22.957196"}
{"role": "user", "content": "Continue the active task from the working-memory checkpoint above.", "_hidden_history": true, "timestamp": "2026-09-24T21:26:57.735507"}nanobot gateway --verbose logs the idle compaction that precedes each delivery:
2026-09-24 20:59:xx | INFO | - | Idle-session compact for feishu:...: archived=N, visible=1, retained=..., summary=Truenanobot Version
0.3.5 (PyPI nanobot-ai), also present on main @ f744652b4b16a56184d14f2e02c514cd06c089f3
Python Version
3.12
Operating System
Linux
Channel / Platform
Feishu (Lark)
LLM Provider
Anthropic (Claude)
Configuration (Optional)
channels:
sendProgress: true
sendToolHints: true
showReasoning: true
feishu:
instances:
- instanceId: default
enabled: true
streaming: true
domain: feishu
agents:
defaults:
idleCompactAfterMinutes: 15
idleCompactCheckIntervalSeconds: 60
dream:
enabled: true
intervalH: 2Additional Context
Code trail on main @ f744652 (verified still present):
session/manager.py:228-233—commit_summary_checkpoint()inserts the marker with the hidden flag:self.messages.insert(boundary, { "role": "user", "content": SUMMARY_CONTINUATION_TEXT, HIDDEN_HISTORY_META: True, "timestamp": datetime.now().isoformat(), })session/history_visibility.py— the filter exists:def is_hidden_history_message(message): return _has_hidden_history_marker(message) or is_automation_history_message(message)session/manager.py:240-284—get_history()(the LLM replay path) already drops it viais_summary_checkpoint():if message.get("_command") or is_summary_checkpoint(message): continuechannels/feishu/runtime.py— the chat delivery path has zero references tois_hidden_history_message/_hidden_history/ compaction filtering (grepped the whole 2,897-line file). The admission policy that would normally gate this isbus/notification_delivery.py, and it only coversContextCompactionEvent, not persisted hidden session messages.
So the marker is correctly filtered on the LLM replay path but not on the chat delivery path for Feishu.
Why this is worse than #5784: #5784 is about notice copy that a channel cannot render politely; content is by design visible. This is an internal message marked hidden leaking to the user, i.e. a visibility/isolation defect, not a formatting one.
Suggested fix direction (for discussion): gate outbound chat delivery on is_hidden_history_message() the same way get_history() gates replay — ideally at a common point in the channel dispatch so every channel benefits, rather than per-channel. The same class of leak was reported for runtime-context scaffolding in #3670; a shared visibility gate would cover both.
Workaround: set agents.defaults.idleCompactAfterMinutes: 0 to disable idle compaction, which stops the marker from being generated (at the cost of no automatic context compaction).
Source: HKUDS/nanobot