[Bug]: A improvement in 0.1.61 causes fails to start the GUI

Abierto
#166 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
56/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
electron, javascript
Área
backend, desktop

Línea de trabajo

The report points to the preload sequence and process.getSystemMemoryInfo() in the desktop app. Read the code that sets residentChatLimit and check how it handles sandboxed Linux startup when retrieving system memory throws. Reproduce with the 0.1.61 AppImage in a sandboxed environment; done means the preload completes and the GUI loads without the renderer errors.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
GUI version

0.1.61

Operating system

Linux (Debian/Ubuntu)

Reproduction steps
  1. Launch CommandCode-0.1.61-x86_64.AppImage on Linux (in our case upgraded from 0.1.60 via the in-app updater).
  2. Wait for startup to finish. The main-process log reaches window-created / ready-to-show normally.
  3. Observe the window: it shows the error page "An unexpected error occurred. Reloading usually fixes this..." (in some runs under Wayland the window never appears at all, while the process keeps running).
  4. Click Reload → the error page comes back every time; the app never becomes usable.
Expected behavior

The app loads its UI normally and the preload script installs without errors.

Actual behavior

Timeline captured with --enable-logging, in order of occurrence:

  1. First exception — start of the failure chain: the preload script fails to load:
Unable to load preload script: <AppDir>/resources/app/out/preload/index.js
Error: Unable to retrieve system memory information
  1. Because the preload never finishes, the IPC bridge is never installed; the renderer then crashes with:
TypeError: Cannot read properties of undefined (reading 'authStatus')
TypeError: Cannot read properties of undefined (reading 'onMenuAction')
  1. The renderer shows the generic error page. Every reload fails identically, so press the "reload" button never recovers.
Screenshots, recordings, or sanitized logs

An improvement introduced in 0.1.61—"The app stays responsive on 8 GB machines and while long replies stream"—involves setting a memory threshold in preload sequence:

const threshold = 8 * 2**30;  // 8 GiB, in bytes

function chooseLimit(totalBytes) {
  return totalBytes <= threshold ? 3 : 8;
}

residentChatLimit: chooseLimit(
  process.getSystemMemoryInfo().total * 1024 // Convert KiB to bytes
)

(Comments added by the issue author)

This approach first checks the machine’s available memory and then selects a memory limit based on that amount. However, in a sandboxed environment, calling getSystemMemoryInfo() will throw an error, resulting in the message "Error: Unable to retrieve system memory information" during debugging, and the GUI will redirect to a generic error page. Starting the application with the --no-sandbox parameter may resolves this issue.

Safety check
  • I removed credentials and private project information from this report.
Lenguaje dominante
Shell
Estrellas
110
Forks
9
Merge medio
12 min
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de CommandCodeAI/desktop

Todos los issues de CommandCodeAI/desktop

Issues similares

Más issues de Shell/Bash

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.