[Bug]: v0.1.61 fails to initialize preload script due to system memory information error on Linux

未关闭 适合新手
#167 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
electron, javascript
领域
desktop

调研方向

报告指出,out/preload/index.js 和对 process.getSystemMemoryInfo() 的调用可能是故障点。首先找到生成此调用的 preload 源代码,并检查它如何处理 sandboxed Linux 环境中的错误。完成标准是:即使无法获取内存信息,preload 桥接程序也能初始化;如果项目提供 Linux 启动方式或针对性测试,请据此验证。

由索引模型根据 Issue 内容生成。

描述

bug
GUI version

0.1.61

Operating system

Linux (other)

Reproduction steps

Environment

Application: Command Code Desktop

GUI version: 0.1.61

Operating system: Manjaro Linux

Desktop environment: Hyprland

Display server: Wayland

GPU: NVIDIA GeForce RTX 5090

Installation type: AppImage

Upgrade path: Automatically upgraded from v0.1.60 using the in-app updater

Description

After Command Code automatically updated from v0.1.60 to v0.1.61, the application became unusable.

The main process starts normally, and the application window reaches the ready-to-show stage. However, the renderer displays the following generic error page:

"An unexpected error occurred. Reloading usually fixes this..."

Clicking Reload does not resolve the problem. The same error occurs repeatedly.

Expected behavior

The preload script should initialize successfully, and the application should remain usable even if system memory information cannot be retrieved.

Possible cause and suggested investigation

Could the development team investigate whether process.getSystemMemoryInfo() is failing in the sandboxed preload environment?

It may be worth adding error handling and a fallback value so that failure to retrieve system memory information does not prevent the entire preload script from initializing.

The --no-sandbox workaround mentioned in another report may be useful for diagnosis, but I have not independently verified it.

Impact

The application is completely unusable on my system after upgrading to v0.1.61.

Reloading does not recover the application.

Additional information

I have not modified system permissions, NVIDIA drivers, or Electron sandbox settings to work around this issue.

I can provide additional sanitized logs if needed.

Actual behavior

When launching the application with Chromium logging enabled:

AppImage/CommandCode-0.1.61-x86_64.AppImage --enable-logging=stderr --v=1

The following errors appear:

  1. Preload script initialization failure

Unable to load preload script:
.../resources/app/out/preload/index.js

Error: Unable to retrieve system memory information

  1. Renderer-side IPC bridge errors

TypeError: Cannot read properties of undefined (reading 'authStatus')

TypeError: Cannot read properties of undefined (reading 'onMenuAction')

Additional investigation

Inspection of the packaged preload script revealed the following code:

residentChatLimit: l(process.getSystemMemoryInfo().total * 1024),

The main window is configured with:

webPreferences: {
contextIsolation: true,
nodeIntegration: false,
sandbox: true
}

This suggests that the memory information call may be throwing an exception during preload initialization.

If this happens before contextBridge.exposeInMainWorld() executes, the electronAPI bridge will not be exposed to the renderer, which would explain the subsequent authStatus and onMenuAction errors.

I also found an independent report describing an almost identical failure on Linux with version 0.1.61, including the same system memory information error and subsequent IPC bridge errors.

This suggests the issue may not be specific to my system.

Screenshots, recordings, or sanitized logs

No response

Safety check
  • I removed credentials and private project information from this report.
主要语言
Shell
星标
110
派生
9
平均合并
12 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

CommandCodeAI/desktop 的其他 Issue

查看 CommandCodeAI/desktop 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。