Skip to content

DenchClaw v2.0 - External OpenClaw Runtime#81

Merged
kumarabhirup merged 120 commits into
mainfrom
kumareth/ironclaw-v2.0
Mar 5, 2026
Merged

DenchClaw v2.0 - External OpenClaw Runtime#81
kumarabhirup merged 120 commits into
mainfrom
kumareth/ironclaw-v2.0

Conversation

@kumarabhirup
Copy link
Copy Markdown
Collaborator

Summary

This PR implements IronClaw v2.0, a major architectural refactor that converts the repository from a monolithic OpenClaw+IronClaw bundle to a clean IronClaw-only frontend/bootstrap layer with strict external dependency on a globally-installed OpenClaw runtime.

  • Problem: The repository bundled OpenClaw core runtime (agents, ACP, commands, etc.) creating tight coupling, versioning conflicts, and deployment complexity.
  • Why it matters: Users want IronClaw UX (web UI on :3100) with independent OpenClaw updates. This enables side-by-side operation and removes forked-core maintenance burden.
  • What changed:
    • Removed ~150+ OpenClaw core source files (src/agents/, src/acp/, src/commands/*)
    • Web app now spawns global openclaw binary (no local script resolution)
    • CLI delegates non-bootstrap commands to global openclaw
    • Renamed package scripts: pnpm openclawpnpm ironclaw
    • Updated bootstrap to verify/install global OpenClaw
    • Migrated workspace/profile storage to OpenClaw canonical paths
  • What did NOT change:
    • Gateway protocol (still WebSocket on 18789)
    • Stream JSON/session subscribe contracts
    • Web UI UX and features preserved via compatibility adapters

Change Type

  • Refactor
  • Bug fix
  • Feature
  • Docs
  • Security hardening
  • Chore/infra

Scope

  • Gateway / orchestration
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Plans

  • .cursor/plans/bootstrap_dev_testing_0b5817e5.plan.md
  • .cursor/plans/ironclaw_frontend_split_1c02d591.plan.md
  • .cursor/plans/strict-external-openclaw_7c0d1717.plan.md

User-visible / Behavior Changes

  • Prerequisite: Users must npm install -g openclaw before running IronClaw
  • Bootstrap: First npx ironclaw run checks for global OpenClaw, prompts to install if missing
  • Scripts: Renamed pnpm openclawpnpm ironclaw, openclaw:rpcironclaw:rpc
  • Profiles: IronClaw uses ironclaw profile by default, isolating from main OpenClaw

Security Impact

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No (same gateway protocol)
  • Command/tool execution surface changed? Yes - now delegates to global openclaw binary
  • Data access scope changed? No

Compatibility / Migration

  • Backward compatible? No - requires global OpenClaw installation
  • Config/env changes? No
  • Migration needed? Yes - run npm install -g openclaw if not already installed

Known Issues (Post-Migration)

Remaining type errors from deleted module imports (expected for major refactor):

  • Some extension files reference deleted openclaw/plugin-sdk paths
  • Some test utilities reference deleted core modules
  • Some config files reference deleted type modules

These will be resolved in follow-up commits before final release.

Test Plan

  • Bootstrap E2E: clean machine, npx ironclaw installs OpenClaw, launches UI
  • Gateway streaming: web chat works via gateway WebSocket
  • Profile isolation: IronClaw profile doesn't collide with main OpenClaw
  • Subagent spawning: web subagents spawn via global openclaw

Risks and Mitigations

  • Risk: Users without global OpenClaw get confusing errors
    • Mitigation: Bootstrap checks and prompts for installation with clear instructions
  • Risk: Version skew between IronClaw and global OpenClaw
    • Mitigation: Gateway protocol stability + explicit update UX (no auto-update)

Note: This is a draft PR for the v2.0 architectural refactor. Some TypeScript errors remain from the migration and will be resolved before merge.

BREAKING CHANGE: Convert repository to IronClaw-only package with strict
external dependency on globally installed `openclaw` runtime.

### Changes

- Remove entire OpenClaw core source from repository (src/agents/*, src/acp/*,
  src/commands/*, and related modules)
- Implement CLI delegation: non-bootstrap commands now delegate to global
  `openclaw` binary via external contract
- Remove local OpenClaw path resolution from web app; always spawn global
  `openclaw` binary instead of local scripts
- Rename package.json scripts: `pnpm openclaw` → `pnpm ironclaw`,
  `openclaw:rpc` → `ironclaw:rpc`
- Update bootstrap flow to verify and install global OpenClaw when missing
- Migrate web workspace/profile logic to align with OpenClaw state paths
- Add migration contract tests for stream-json, session subscribe, and profile
  resolution behaviors
- Update build/release pipeline for IronClaw-only artifacts
- Update documentation for new peer + global installation model

### Architecture

IronClaw is now strictly a frontend/UI/bootstrap layer:
- `npx ironclaw` bootstraps OpenClaw (if missing), runs guided onboarding
- IronClaw UI serves on localhost:3100
- OpenClaw Gateway runs on standard port 18789
- Communication via stable CLI contracts and Gateway WebSocket protocol only

### Migration

Users must have `openclaw` installed globally:
  npm install -g openclaw

Existing IronClaw profiles and sessions remain compatible through gateway
protocol stability.

Refs: bootstrap_dev_testing, ironclaw_frontend_split, strict-external-openclaw
@kumarabhirup
Copy link
Copy Markdown
Collaborator Author

#80

…r-version gating

Refactor bootstrap to use a managed web runtime lifecycle instead of
ad-hoc standalone server spawning. The managed runtime copies packaged
Next.js assets into ~/.openclaw-dench/web-runtime/, tracks deployment
state via manifest/process metadata, and cleanly separates Dench-owned
processes from foreign listeners on the target port.

- Fix false-negative web readiness when /api/profiles returns null
  activeProfile (first-run regression).
- Add `dench start` (start without updating assets), `dench stop`
  (terminate only Dench-managed web server), and `dench update`
  (refresh web runtime with major-version OpenClaw update gate).
- Major-version transitions (e.g. v2->v3) require mandatory OpenClaw
  update; non-interactive mode fails closed without --yes.
- All lifecycle commands show the ASCII banner/logo animation.
- Deploy smoke checks now verify update/stop/start --help paths.
- Bump version of denchclaw to 2.0.2 in package.json.
- Add posthog-node and posthog-js dependencies with specified versions.
- Update chokidar dependency in web package.json.
- Modify deploy script to publish an alias package (dench) alongside denchclaw.
- Fix bootstrap-command test: mock ensureManagedWebRuntime to probe
  directly instead of requiring standalone build on disk
- Add PostHog telemetry to CLI and web app with opt-out support
- Add dench alias package (npm rejects name; kept for future use)
- Bump version to 2.0.4 and publish to npm
Always pass --skip-ui and --accept-risk to openclaw onboard so the
wizard never prompts for TUI/Web UI selection — bootstrap manages the
web UI lifecycle itself. Add a post-onboard spinner to eliminate the
silent gap while config-set calls, gateway probing, and web runtime
startup run. Fix remediation messages to use `npx denchclaw`.
Documents required environment variables so new contributors can onboard without guessing.
pnpm standalone output contains symlinks that break after npm pack; dereference ensures real files are copied.
…lags

Onboard command now passes --accept-risk and --skip-ui by default; align test expectations.
pnpm's standalone output uses symlinks that npm pack silently drops, breaking require('next') on user machines. This flattens the virtual store into a standard node_modules layout.
Adds deploy convenience scripts, wires flatten-standalone-deps into web:prepack, and updates test:cli to include the new test file.
@kumarabhirup kumarabhirup marked this pull request as ready for review March 5, 2026 03:12
@kumarabhirup kumarabhirup added enhancement New feature or request architecture Architecture and tech debt dx Developer experience labels Mar 5, 2026
@kumarabhirup kumarabhirup changed the title refactor!: IronClaw v2.0 - External OpenClaw Runtime DenchClaw v2.0 - External OpenClaw Runtime Mar 5, 2026
@kumarabhirup kumarabhirup merged commit c4c73e1 into main Mar 5, 2026
@JayGhiya
Copy link
Copy Markdown

JayGhiya commented Mar 5, 2026

hey @kumarabhirup any instructions for migrating the old ironclaw 1.0 to 2.0 ?

@kumarabhirup
Copy link
Copy Markdown
Collaborator Author

@JayGhiya

Setup npx denchclaw separately, and then copy ~/.openclaw-ironclaw/workspace contents into ~/.openclaw-dench/workspace It should work just fine.

@kumarabhirup kumarabhirup mentioned this pull request Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

architecture Architecture and tech debt dx Developer experience enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants