coder / coder/vscode-coder

Show RAM usage in the VS Code status bar

Abierto
#1,027 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Feature vs-code
Lenguaje dominante
TypeScript
Estrellas
130
Forks
48
Merge medio
3 d 3 h
PR fusionados (30 d)
15

Descripción

## Feature request

Please add a way for the Coder Remote VS Code extension to show workspace RAM usage directly in the VS Code status bar, alongside or instead of the current first agent metadata value.

Today, Coder workspace templates commonly expose both CPU and RAM through agent metadata, for example:

```hcl
metadata {
display_name = "CPU Usage"
key = "0_cpu_usage"
script = "coder stat cpu"
interval = 10
timeout = 1
}

metadata {
display_name = "RAM Usage"
key = "1_ram_usage"
script = "coder stat mem"
interval = 10
timeout = 1
}
```

The VS Code extension appears to render the first metadata value in the status bar and place the full metadata list in the tooltip. In practice this means CPU is often visible in the status bar, while RAM requires opening the Coder sidebar or hovering the status item.

## Why RAM should be more visible

In Kubernetes-backed workspaces, CPU and RAM pressure have very different failure modes:

- When CPU maxes out, Kubernetes throttles the container and work usually just takes longer.
- When RAM maxes out, Kubernetes can OOM-kill the pod and restart the workspace.

That makes RAM usage much more important to watch continuously. A status-bar RAM indicator would give users time to stop processes, reduce workload, or resize the workspace before the pod is killed.

## Suggested UX

Show RAM usage directly in the VS Code status bar when RAM metadata is available, for example:

```text
RAM 54.1/64 GiB (85%)
```

or a compact variant:

```text
54.1/64 GiB RAM (85%)
```

Possible behavior:

- Prefer metadata whose display name/key clearly represents RAM or memory usage.
- Keep CPU and other metadata available in the tooltip.
- Show a warning state when memory usage is high, such as above 80% or 90%.
- If RAM data is unavailable, do not show a misleading value; keep current behavior or explicitly indicate that memory usage is unavailable.

## Acceptance criteria

- The VS Code status bar can show RAM usage for the active Coder workspace.
- The visible status text includes used memory, memory limit/total, and percentage when available.
- High-memory states are visually noticeable.
- Existing agent metadata tooltip behavior is preserved or improved.
- Missing/unparseable RAM metadata is handled explicitly and does not look like a successful live reading.

## Relevant code paths

- `src/remote/remote.ts` currently creates the agent metadata status bar item and uses the first metadata event as the status text.
- `coder/coder` already provides `coder stat mem`, and default Kubernetes template metadata includes `RAM Usage`, so this may be possible as a display-priority improvement without requiring new workspace telemetry.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Start in src/remote/remote.ts, where the agent metadata status bar item uses the first metadata event as its status text. Review how metadata from coder stat mem and the default Kubernetes template is represented, then trace the tooltip behavior. Done means the active workspace can display used memory, total, and percentage, visibly mark high usage, preserve metadata details, and handle missing or unparseable RAM data without implying a valid reading.

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

Evaluación

Stack tecnológico
typescript, vscode
Área
desktop, developer-experience
Tipo de issue
Nueva funcionalidad
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
68/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.