Skip to content

feat: NemoClaw compatibility — detect and sync from OpenShell sandboxed OpenClaw#318

Draft
vivekchand wants to merge 2 commits intomainfrom
feat/nemoclaw-compat
Draft

feat: NemoClaw compatibility — detect and sync from OpenShell sandboxed OpenClaw#318
vivekchand wants to merge 2 commits intomainfrom
feat/nemoclaw-compat

Conversation

@vivekchand
Copy link
Copy Markdown
Owner

Closes #233

Summary

Adds full NemoClaw / OpenShell sandbox compatibility to the ClawMetry sync daemon.

Changes

sync.py

  • _is_running_in_container() — detects if ClawMetry itself is inside a Docker/OpenShell sandbox (via /.dockerenv + cgroup check)
  • _detect_nemoclaw() — collects NemoClaw sandbox metadata via nemoclaw status --json and openshell sandbox list
  • _find_openshell_bin() — locates the openshell CLI binary
  • _detect_docker_openclaw() — extended to match openshell, nemoclaw, nvidia container names/images; adds NemoClaw session paths (/sandbox/.openclaw/); tags mirrored data with container_id and runtime=nemoclaw
  • detect_paths() — adds NemoClaw sandbox path candidates + NEMOCLAW_SANDBOX env var override; warns when running inside a sandbox with network policy guidance
  • sync_system_snapshot() — enriches snapshot with sandbox.*, inference.*, and security.* metadata when NemoClaw is detected

README.md

New NemoClaw / OpenShell Support section covering:

  • How auto-detection works
  • Recommended host-side deployment
  • NEMOCLAW_SANDBOX env var override
  • In-sandbox deployment with network egress policy snippet
  • Ports/endpoints table

Architecture

All NemoClaw-specific logic is in the sync daemon only — the cloud dashboard, ingest API, and browser UI contain zero NemoClaw-specific code, consistent with the principle in #233.

- Sliding 2-min window token threshold (default: 10,000 tokens/2min)
- Consecutive tool-call chain detection (default: N=20 without human turn)
- Cost velocity alert (default: $0.10/min over 5-min window)
- In-dashboard banner with Kill Loop + Dismiss buttons (animated, red/orange)
- Background thread checks velocity every 30s
- Telegram notification on new alert types
- GET /api/alerts/velocity — current alert state
- POST /api/alerts/velocity/config — configure thresholds
- POST /api/alerts/velocity/dismiss — dismiss active alerts
- Config stored in existing budget_config SQLite table (velocity_ prefix)
… JSONL data, add HTML panel to Overview

- api_heatmap(): now covers 30 days (was 7); primary source is session JSONL
  files so historical data is richer; log-file fallback for days with no
  session events; each day entry now includes 'date' field alongside 'label'
- loadHeatmap() JS: updated for 30-day view — sparse day labels (every 5th),
  6-band colour scale, hour labels only at 00/06/12/18, safe guard when
  heatmap-grid element is absent
- startSystemHealthRefresh(): now calls loadHeatmap() on startup and refreshes
  every 5 minutes via _heatmapTimer
- Overview HTML (both light/dark themes): added Activity Heatmap panel inside
  the System Health section with heatmap-grid + heatmap-legend elements
- tests/test_api.py: added TestHeatmap (7 tests) — 30-day length, 24 buckets
  per day, label/date keys, non-negative int counts, max field correctness;
  all 78 tests pass

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NemoClaw compatibility: detect and sync from OpenShell sandboxed OpenClaw

1 participant