Skip to content

Comments

intake(lote-A): import upstream AionUi PR #881#3

Open
nsalvacao wants to merge 8 commits intobaseline/main-sync-2026-02-17from
intake/lote-A-pr-881
Open

intake(lote-A): import upstream AionUi PR #881#3
nsalvacao wants to merge 8 commits intobaseline/main-sync-2026-02-17from
intake/lote-A-pr-881

Conversation

@nsalvacao
Copy link
Owner

Intake PR

This PR was created to follow the mandatory intake workflow in AGENTS.md.

kuishou68 and others added 8 commits February 14, 2026 20:59
…in AionUI

When an active OpenClaw session exists, route channel (Feishu/Telegram/DingTalk)
messages to it using a separate gateway session key, avoiding rs_ 404 errors.
Gateway broadcasts responses to all WebSocket clients so the main AionUI
conversation receives and renders replies automatically.

- Add sendChannelMessage() to OpenClawAgent with pre-initialized streaming state
  to prevent duplicate responses from chat and agent event handlers
- Add sendChannelMessage() wrapper to OpenClawAgentManager with cronBusyGuard
- Detect OpenClaw tasks in ChannelMessageService and route via sendChannelMessage
  instead of regular sendMessage; persist user messages and emit IPC events
- Detect active OpenClaw tasks in ActionExecutor before session creation to
  ensure channel messages always land in the original OpenClaw conversation
…w agents

Non-OpenClaw agents (Gemini/ACP/Codex) already handle user message display
through their own sendMessage flow. The extra IPC user_content emission was
causing user messages to be concatenated with AI responses in AionUI.
Add channelTurnActive flag to skip ALL chat.event processing during channel
turns. Previously, handleEndTurn (from agent lifecycle end) reset the
currentStreamMsgId, allowing late-arriving chat.event deltas to be processed
as new content, causing duplicate AI responses in AionUI.
…hannel turns

Instead of blocking all chat events during channel turns (which prevented
chat.event.final from emitting the finish signal when no agent lifecycle
event arrives), keep currentStreamMsgId set during channel turns so
the existing delta-skip logic continues to block late chat.event deltas.

This ensures:
- chat.event.final always calls handleEndTurn → finish signal emitted
- Late chat.event deltas still blocked (currentStreamMsgId remains set)
- Works regardless of whether gateway sends agent or chat events
…UI rendering

Move user message persistence and IPC emission from ChannelMessageService
into OpenClawAgentManager.sendChannelMessage. Emit user_content to both
openclawConversation and conversation response streams, matching the
pattern used by handleStreamEvent for AI responses. Pass msg_id from
ChannelMessageService to sendChannelMessage for proper message tracking.
Instead of separate ipcBridge.emit calls for user_content, route the
channel user message through handleStreamEvent — the same proven code
path used by AI responses. This ensures DB persistence and IPC emission
use the identical execution context that works for AI content streaming.

Skip channelEventBus for user_content to avoid echoing the user's own
message back to the channel platform.
Previously channelTurnActive prevented handleEndTurn from resetting
currentStreamMsgId, causing the second channel message's AI response
to reuse the first message's msg_id. This led to content concatenation
and reversed message order in AionUI.

Now handleEndTurn always resets currentStreamMsgId to null so each turn
gets a fresh msg_id. Late chat.event deltas during channel turns are
blocked by the channelTurnActive flag directly in handleChatEvent.
@gemini-code-assist
Copy link

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants