Repository navigation
Conversation
getLongBridgeStatusAction() covered only 3 of the 6 LongBridgeStatusValue states, so 'timeout' and 'unknown' returned undefined. The renderer then fell back to "Install LongBridge CLI and run longbridge auth login." and titled the banner "setup needed" - wrong guidance when the CLI is installed and the call merely did not return in time. Add timeout/unknown branches to the action map, and treat a timeout as a pause rather than a setup problem in the banner title. Refs helsome#312
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.
问题与修复
LongBridgeStatusValue有 6 个取值(packages/longbridge-tools/src/status.ts:4-10),但apps/electron/src/main/kernelHost.ts:2586-2597的getLongBridgeStatusAction()只处理其中 3 个,'timeout'与'unknown'落到default: return undefined。UI(AppShell.tsx:67-73)又把undefined兜底成Install LongBridge CLI and run longbridge auth login.,标题也只剩「限流 / 其它」两分支 —— 于是超时被描述成「需要安装」,而 CLI 其实已安装、也可能已登录。本 PR:
getLongBridgeStatusAction()补齐'timeout'与'unknown'两个分支(超时 → 检查网络/代理并重试;未归类错误 → 先longbridge --version自检再重试)。'available'仍由调用方status.available ? undefined : …(kernelHost.ts:645-647)短路,不需要动作,故不新增分支。AppShell.tsx的横幅标题把'timeout'并入「paused」分支:超时是暂时不可用,与限流同类;'unknown'保留setup needed(原因未知,确实可能是环境问题)。不改动已支持状态的既有文案,不改 IPC 契约与状态码。
Closes #312
可复现测试报告
744846f84);基线 main3a17eca6(2026-10-03T16:16:35Z)cd apps/electron && bun test src/main/kernelHost.test.ts(新增 3 个用例:available 无动作 / timeout 走重试而非安装 / unknown 有自己的动作):Expected: "string" / Received: "undefined")bun run typecheck→@finagent/core/i18n/shared/ui/electron全部 exit 0cd apps/electron && bun test→ 32 pass / 1 fail。唯一失败是research-prompts.test.ts的synthesis prompt embeds SECURITY RULES before the data bundle,与本改动无关且属既有问题:它单独运行是4 pass / 0 fail;把本 PR 的 3 个文件还原成 main 版本后全量仍是 29 pass / 1 fail(同一条失败);且research-prompts.ts/research-prompts.test.ts与上游 main 逐字节一致。判定为既有的跨文件测试隔离问题,未在本 PR 处理。test:e2e/test:e2e:visible/test:package-smoke(Windows 上跑不起完整 e2e)。.github/workflows/pr.yml当前为disabled_manually,本 PR 不会产生 check run —— 以上全部为等价本地命令结果,非 CI。UI 变化
LongBridge 横幅在超时场景下的文案:
LongBridge setup needed:LongBridge paused:Install LongBridge CLI and run longbridge auth login.(action为undefined时的兜底)LongBridge CLI timed out; market data requests are paused. Check your network or proxy and retry.'unknown'场景标题前缀不变(仍为setup needed),但处置建议由安装引导改为run longbridge --version自检 + 重试。已支持状态(not_installed/not_authed/rate_limited)与available(不显示横幅)文案不变。本 PR 未附组件截图(§7.6 的截图流程在评审要求时启用),如需要我可在本 PR 补 Before/After 组件截图与直链。查重与冲突
apps/electron/src/main/kernelHost.ts:84 个 open PR 中 11 个改动它。本 PR hunk 为@@ -2591,6 +2591,10 @@;最近的他人/自开 hunk 是 [Issue #34] Add conversation lineage foundation and operations #53@@ -2610,6 +2637,34 @@、feat: close research platform issues 36-38 #56@@ -2543,6 +2685,9 @@与@@ -2654,6 +2799,98 @@、fix(automation): 校验规则保存的 IPC 输入 #276@@ -2684,6 +2681,69 @@、fix(diagnostics): 诊断包恒报券商「已连接、1 个账户」,与是否登录无关 #246@@ -2461,6 +2467,28 @@⇒ 均不相交。apps/electron/src/main/kernelHost.test.ts:8 个 PR 改动它,其中 fix(automation): 每日简报的组合敞口标签不再混用原币与本币 #277 / fix(eval): 可观测性链路把用户取消的运行记成 cancelled,不再记成任务失败 #255 / fix: resolve issue #96 #97 都在文件尾部@@ -521,4 +…追加用例;本 PR 新增用例位于@@ -511,6 +511,57 @@(插在wraps market data errors用例之前)⇒ 与其插入点不相交;fix(automation): 校验规则保存的 IPC 输入 #276 / fix(portfolio-import): 草稿行全部带 issue 时仍静默创建空组合 #244 的@@ -436,6 +436,41 @@更靠上,也不相交。packages/ui/src/components/layout/AppShell.tsx:零冲突。