Description
LINE group chats currently only forward messages to OpenAB when the bot is directly mentioned. That is the correct visible-reply behavior, but it also means the bot has no short-term awareness of the immediately preceding group conversation.
This makes the bot feel less present in group chats. A user may discuss a topic with others, then mention the bot and ask it to summarize or respond, but the bot only receives the final mention message and misses the recent context.
Use Case
In a LINE group:
- users exchange a few normal text messages without mentioning the bot
- someone directly mentions the bot and asks for help
- the bot should answer using the directly mentioned message plus the recent unmentioned text from the same group
The bot should still avoid replying to every group message. The goal is better context on the next direct mention, not more unsolicited replies.
Proposed Solution
Keep the scope small and LINE-specific:
- keep current visible reply behavior gated on direct bot mentions
- make short-term group context capture opt-in with
LINE_GROUP_CONTEXT_ENABLED=true
- buffer recent unmentioned group/room text messages locally in the gateway when enabled
- key the buffer by LINE group/room channel ID
- inject buffered text into the next directly mentioned text turn for the same chat
- drain the buffer after injection so context is one-shot
- bound the buffer by TTL, maximum message count, and total character budget
- document that this is short-term local context, not long-term memory or GBrain storage
Prior Art / Related Systems
- OpenClaw-style gateway designs often separate message admission from contextual pre-processing so adapters can enrich an admitted turn without forcing the bot to reply to every message.
- Hermes-style messaging gateways keep platform-specific admission behavior explicit and avoid broad semantic changes that affect all adapters.
- This proposal follows the same conservative direction: keep LINE mention-gated replies intact, but add an opt-in LINE-local context buffer to improve the next admitted turn. The initial implementation keeps context eligible for up to 24 hours when enabled, matching the feel of Discord's default session continuity more closely, while still bounding each chat by count and total character budget. The feature and bounds are configurable through LINE gateway environment variables.
Out of Scope
- changing visible reply behavior for unmentioned group messages
- using Push API for proactive group participation
- long-term transcript storage
- GBrain or retrieval memory integration
- image/audio/file buffering
- cross-platform context semantics
- mention-gating changes for non-text LINE messages
Validation Plan
- unit test that an unmentioned group text message is buffered and not dispatched
- unit test that the next direct mention receives the buffered context
- unit test that buffered context is chat-local
- unit test that buffered context drains after use
- unit test that multiple buffered messages preserve arrival order
- manual LINE group test:
- send unmentioned group text
- directly mention the bot
- confirm the bot can answer with awareness of the prior group text
Description
LINE group chats currently only forward messages to OpenAB when the bot is directly mentioned. That is the correct visible-reply behavior, but it also means the bot has no short-term awareness of the immediately preceding group conversation.
This makes the bot feel less present in group chats. A user may discuss a topic with others, then mention the bot and ask it to summarize or respond, but the bot only receives the final mention message and misses the recent context.
Use Case
In a LINE group:
The bot should still avoid replying to every group message. The goal is better context on the next direct mention, not more unsolicited replies.
Proposed Solution
Keep the scope small and LINE-specific:
LINE_GROUP_CONTEXT_ENABLED=truePrior Art / Related Systems
Out of Scope
Validation Plan