Repository navigation
fix(gateway): 未连接远程时发布队列快照不再报 outbound stream is offline - #952
Merged
xiaozhou26 merged 1 commit intoOct 10, 2026
Merged
xiaozhou26 merged 1 commit into
xiaozhou26 merged 1 commit into
Conversation
未启用或未连上 Gateway 时,publish_chat_queue_event 把出站流离线当作错误返回, 前端每次排队变化都会 console.warn 一次。改为与 runtime status 发布一致: 离线时视为无需投递直接返回 Ok,真实发送失败仍然上抛。 离线错误文案提取为常量 GATEWAY_OUTBOUND_OFFLINE_ERROR,避免字符串匹配漂移。 Closes Stack-Cairn#949
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联
Closes #949
根因
前端
useChatTurnQueue.ts的publishChatQueueSnapshot()在每次队列变化(入队/出队)时调用gateway_publish_chat_queue_event。后端GatewayController::publish_chat_queue_event无条件send_agent_envelope,而未启用/未连上 Gateway 时current_outbound_sender()固定返回Err("gateway outbound stream is offline"),前端 catch 后console.warn。同类的尽力而为发布早已把离线当作正常状态:
publish_settings_sync离线直接Ok(()),runtime status 发布用字符串匹配吞掉离线错误。队列快照是唯一不一致的路径。改动
connection.rs:离线文案提取为常量GATEWAY_OUTBOUND_OFFLINE_ERROR,新增ignore_gateway_outbound_offline(),只吞精确的离线错误,其它发送失败照常上抛。chat.rs:publish_chat_queue_event离线时返回Ok(());信封构造拆为build_chat_queue_event_envelope()以便测试。chat_inbox.rs:runtime status 发布改用同一个 helper,替换原来的contains("outbound stream is offline")。console.warn,告警依然有意义。测试
cargo test --no-default-features --lib services::gateway:79 passed, 0 failed。实测(Windows 11 · tauri dev · Gateway enabled=true / online=false)
通过 WebView2 CDP 订阅 console 计数:
未处理
Issue 附注里的
[MCP][BRIDGE][WARN] Script injection request: not available来自仅开发构建使用的 tauri-plugin-mcp-bridge,按 issue 说明留给维护者决定。