Skip to content

chore: promote dev to master (npm-ci fallback hardening + WSL memory detection)#1200

Merged
jaylfc merged 3 commits into
masterfrom
dev
Jun 20, 2026
Merged

chore: promote dev to master (npm-ci fallback hardening + WSL memory detection)#1200
jaylfc merged 3 commits into
masterfrom
dev

Conversation

@jaylfc

@jaylfc jaylfc commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Promotes #1199 (gitar fallback hardening + WSL memory detection). Constituent PRs were CI-gated into dev. Jay-authorized.

Summary by CodeRabbit

  • Bug Fixes

    • Improved resilience during package installation with enhanced fallback and recovery mechanisms.
  • New Features

    • Added Windows Subsystem for Linux (WSL) detection and environment awareness.
    • Enhanced memory reporting for WSL deployments with clearer capacity information.
  • Tests

    • Expanded test coverage for installation fallback and hardware detection scenarios.

jaylfc added 3 commits June 20, 2026 12:01
The fallback's git checkout restore now captures stderr, checks its return
code and warns on failure (instead of silently leaving the lockfile dirty),
and catches FileNotFoundError if git is absent. Adds a test for the npm ci
failure -> npm install -> restore -> build path. Even if the restore fails,
apply_update restores the lockfile before every pull, so it stays
double-covered.
Under WSL the Linux VM is capped at 50% of the Windows host by default (8GB
on a 16GB machine), so /proc/meminfo reports 8GB and users think taOS is
limiting them. Add _detect_wsl (WSL_DISTRO_NAME/WSL_INTEROP env or
/proc/version 'microsoft') and a wsl flag + mem_note advisory on
HardwareProfile pointing to .wslconfig memory= + wsl --shutdown. ram_mb is
left unchanged (it is genuinely what the VM has); this only contextualizes
it. Exposed via the hardware profile API for the UI to surface.
fix: harden npm-ci fallback (gitar #1197) + detect WSL memory cap
@jaylfc jaylfc merged commit 8996ac2 into master Jun 20, 2026
4 checks passed
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@github-actions

Copy link
Copy Markdown

👋 Thanks for the PR! This one targets master, which is our
stable branch (it's what live installs track). Please retarget it to
dev — click Edit next to the PR title and change the base
branch dropdown from master to dev. Your commits and any review
carry over, nothing is lost.

See CONTRIBUTING.md for the branch model.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: de3e4e46-e9cf-4826-9d21-6940a327fbfa

📥 Commits

Reviewing files that changed from the base of the PR and between 8558555 and 6bc3287.

📒 Files selected for processing (4)
  • tests/test_desktop_rebuild.py
  • tests/test_hardware.py
  • tinyagentos/desktop_rebuild.py
  • tinyagentos/hardware.py

📝 Walkthrough

Walkthrough

Two independent improvements: HardwareProfile gains wsl: bool and mem_note: str fields backed by a new _detect_wsl() helper that checks environment variables and /proc/version; detect_hardware() is updated to populate these fields. Separately, the git checkout lockfile-restore step in the npm cinpm install fallback path gains try/except error handling. Both changes include new tests.

Changes

WSL Detection in HardwareProfile

Layer / File(s) Summary
HardwareProfile WSL fields, _detect_wsl(), detect_hardware() wiring, and tests
tinyagentos/hardware.py, tests/test_hardware.py
HardwareProfile adds wsl and mem_note fields; load() deserializes them with safe defaults. New _detect_wsl() helper checks WSL_DISTRO_NAME/WSL_INTEROP and /proc/version. detect_hardware() calls _detect_wsl() and sets mem_note to an "about X GB" string when in WSL. TestWslDetection covers _detect_wsl() return values and the resulting profile fields from detect_hardware().

Desktop Rebuild Fallback Hardening

Layer / File(s) Summary
Guarded git checkout restore and fallback test
tinyagentos/desktop_rebuild.py, tests/test_desktop_rebuild.py
The git checkout -- package-lock.json restore call inside the npm cinpm install fallback is now wrapped in try/except, capturing stderr to log a warning on non-zero rc and catching FileNotFoundError when git is unavailable. The new async test mocks create_subprocess_exec, forces npm ci to fail, and asserts rebuilt/success flags plus the presence of npm ci, npm install, and git checkout in the invocation sequence.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • jaylfc/taOS#1197: Introduces the initial npm cinpm install fallback in rebuild_desktop_bundle_if_stale, which this PR hardens with guarded restore error handling.
  • jaylfc/taOS#1199: Contains the same desktop_rebuild.py restore hardening and the same WSL detection additions (HardwareProfile.wsl/mem_note) with matching new tests.

Poem

🐇 Hoppin' through the Linux kernel's veil,
I sniff /proc/version for a WSL trail.
If npm ci stumbles and trips on a stone,
I catch the git error so it's not alone.
With mem_note in paw and wsl flag bright,
This bunny ships hardware-aware code tonight! 🌙

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant