feat(xxm): dynamic TUI session context injection for coregroup
- chat_bridge: mark_active_tui_session() + get_active_tui_session() Tracks active TUI session via temp/.active_tui_session.json, auto-expires after 1 hour (matching Hermes state_meta pattern) - chat_bridge: inject TUI context when processing coregroup messages Bot now sees what hmo was discussing in TUI when replying in group - session_router: record active session ID on every TUI message Uses _resolve_session() to get the current bound session ID
This commit is contained in:
@@ -620,5 +620,16 @@ class SessionRouter:
|
||||
tagged = f"{prefix}{message}"
|
||||
history = [{"role": "user", "content": tagged}]
|
||||
|
||||
# Dynamic context switching: record active TUI session
|
||||
# so bot can inject TUI context when replying to coregroup
|
||||
if channel != "xmpp":
|
||||
try:
|
||||
sid = self._resolve_session(key, allow_create=False)
|
||||
if sid:
|
||||
from chat_bridge import mark_active_tui_session
|
||||
mark_active_tui_session(sid)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# 4. Run LLM command loop
|
||||
return self._llm_loop(key, history)
|
||||
|
||||
Reference in New Issue
Block a user