Memory and swap
Reads free -m. Low available memory is the first thing that starves the extension host.
renderer_ready_timeoutA health gate for the Codex VS Code extension on remote hosts. One bash script checks the memory, load and extension pile-up that starves the 30 second webview budget, then tells you what to fix.
git clone https://github.com/MHJoy99/codex-vscode-health.gitNot affiliated with OpenAI or Microsoft. The terminal shows an illustrative healthy run in the real output format of bin/vscode-health.sh.
The failure
Codex shows “could not start its user interface” on a VS Code Remote host, yet codex app-server answered its handshake. That mismatch is the signature this repo is built around.
[CodexWebviewProvider] Webview renderer did not become ready after 30000ms reason=renderer_ready_timeout
The renderer (Electron, on your local machine) never signalled ready within 30 s.
codex app-server: Initialize received id=1
Backend IPC works, and there is no webview deadline on this side. Investigate host pressure and client extension state, not the app-server protocol.
ready. A slow main thread, not a missing bundle.How it works
Server-side memory and load pressure delays extension-host activation until the fixed webview budget expires. The gate reads those signals first and warns you while the sidebar still works.
What it checks
Each check prints a cyan ▶ line with the measured value, then a green ✔, yellow ⚠ or red ✖ verdict. Warnings and criticals are counted into the exit code.
Reads free -m. Low available memory is the first thing that starves the extension host.
Compares 1-minute load from /proc/loadavg to the core count.
Webview assets and sqlite need headroom. The failure host sat at 84%.
Counts kilo serve --port 0 processes leaked after reloads.
More than one usually means a reload loop or a leaked window. It tells you to reload the window, never to pkill.
Total size and logs_2.sqlite, plus a scan of Codex.log for stale_rollout_path_retained.
Looks for openai.chatgpt-* under ~/.vscode-server/extensions. Exactly one is healthy; leftovers cause version drift.
Tracks five AI extensions that all activate on startup and compete for the renderer budget.
Log sets older than 14 days in ~/.vscode-server/data/logs. Safe to prune, never touches sessions.
Observed on 2026-09-16 at failure time (6 vCPU, 7.8G RAM host). Every signal had already crossed its warning line. Thresholds are tuned from this one host, so adjust them for yours.
Safe by design
--fix does three things.Safe to run over SSH or from cron in check-only mode. The script never takes down the shared box your Codex session lives on.
RESULT: HEALTHY — renderer budget looks safe.
Healthy enough now. Run with --fix and keep AI extensions to 1–2 per window.
Free RAM, reload the window. Prints client-side recovery steps too.
--fix doeskilo serve --port 0, keeps the newest.~/.vscode-server/data/logs/20* older than 14 days.VACUUM on ~/.codex/logs_2.sqlite, only when app-server is stopped.php-fpm, mysql, nginx, reverb, queue workers, prod htdocs.kilo serve and any extensionHost (killing it would drop your SSH).~/.codex. No rm -rf.Quick start
Plain bash on the remote host. No dependencies beyond coreutils and procps.
git clone https://github.com/MHJoy99/codex-vscode-health.git
cd codex-vscode-health
chmod +x bin/vscode-health.sh
# read-only check, safe in cron/SSH
bin/vscode-health.sh
# check + safe fixes only
bin/vscode-health.sh --fix# check-only from cron, every 15 minutes (never --fix unattended)
*/15 * * * * /root/codex-vscode-health/bin/vscode-health.sh >> ~/.codex/health.log 2>&1Exit codes: 0 healthy, 1 warning, 2 critical.
~/.vscode-server and ~/.codex on the host the extension runs on.--fix for the safe three, and drop to 1–2 AI extensions per window.Developer: Reload Window, then retry with a single AI extension.Runbook
Condensed from docs/RUNBOOK.md. Each step ends with the signal that tells you it worked.
Look for Initialize received id=1 and renderer_ready_timeout in Codex.log. Both present means this runbook applies.
bin/vscode-health.sh; echo "exit=$?". If disk is at 90% or more, stop and free space before any update.
bin/vscode-health.sh --fix. Removes older duplicate kilo serve and logs older than 14 days. If only one kilo is running, do not kill it.
Developer: Reload Window, then Reload With Extensions Disabled and enable only Codex. Do not pkill the extension host.
More than one (or zero) openai.chatgpt-* installs, or a version mismatch: uninstall, reload, install one current version. Match client and server code --version.
Confirm app-server is stopped, back up logs_2.sqlite, then VACUUM. If it is running, close the Codex panel and retry.
With VS Code closed, remove %APPDATA%\Code\Cache and GPUCache, then try code --disable-gpu. Do not delete all of %APPDATA%\Code.
pkill -f extensionHost and never kill the newest kilo serve.~/.codex files or sqlite rows. VACUUM only with a backup, only while stopped.FAQ
It is the reason string logged when the Codex sidebar webview does not signal ready inside a fixed 30 second budget: [CodexWebviewProvider] Webview renderer did not become ready after 30000ms reason=renderer_ready_timeout. In the documented incident the backend was fine, with codex app-server: Initialize received id=1 in the server log, so the failure was in the webview handshake, not the app-server protocol.
In the one incident this repo documents (2026-09-16), server-side memory and CPU pressure delayed extension-host activation past the 30 second budget: load 7.2 on 6 vCPU, about 1.8G memory available, 3.6G swap in use, duplicate extensionHost and kilo serve processes, a 459M ~/.codex and several AI extensions. DIAGNOSIS.md ranks resource starvation first, then extension-host contention, bloat, version drift and renderer throttling.
Clone the repo, make the script executable and run it: bin/vscode-health.sh. It is read-only by default. The exit code is 0 for healthy, 1 for warning and 2 for critical.
Only three things: it kills older duplicate kilo serve --port 0 processes (keeping the newest), prunes ~/.vscode-server/data/logs/20* older than 14 days, and takes a backup then runs VACUUM on ~/.codex/logs_2.sqlite, but only when app-server is stopped. It never touches php-fpm, mysql, nginx, reverb, queue workers, prod htdocs, the newest kilo serve, extensionHost or Codex session rows.
Yes, in check-only mode. The prevention guide suggests */15 * * * * /root/codex-vscode-health/bin/vscode-health.sh >> ~/.codex/health.log 2>&1 and says never to run --fix unattended.
Not directly. The renderer runs on the client, not the server. The script fixes and reports server-side pressure; on a critical result it prints client-side steps (reload with extensions disabled, update Codex and match local and remote VS Code versions, clear %APPDATA%\Code\Cache and GPUCache, try --disable-gpu). The runbook covers the same steps.
Yes. Running codex in a terminal keeps working when the webview does not, so it is the fallback while you triage.
It is plain bash with no dependencies beyond coreutils and procps; the optional VACUUM path uses sqlite3. The project is labelled experimental: the shellcheck badge is still TODO and every threshold is tuned from a single incident on a 6 vCPU, 7.8G host, so adjust them for your machine and read DIAGNOSIS.md before changing them.
Open a GitHub issue with the script output, free -m and the Codex extension version. Scrub Codex.log first and attach only a slice around the signature; never paste tokens or ~/.codex/auth.json.
More by MHJoy99