openclaw chat as a child process, owning that process lifecycle, persisting evidence written by the bundled plugin, and driving finalization into a structured diagnosis.
This separation means the CLI has no knowledge of what OpenClaw is doing, and the runtime has no knowledge of how the user invoked it. You can call the runtime functions directly from Python without going through Click at all.
Architecture at a Glance
| Layer | Responsibility | Does NOT do |
|---|---|---|
| CLI Layer (Click) | Parse commands, render help, validate options, route to backend | Launch OpenClaw, observe runtime, generate diagnoses |
| Supervised Runtime | Create sessions, launch openclaw chat, own the child process, persist evidence, finalize diagnoses | Render CLI help or parse arguments |
Full Session Pipeline
Every monitored run travels through this pipeline from the moment you invokecritiqor monitor openclaw to the moment the local dashboard opens:
critiqor/clawhub/critiqor-openclaw/ and is loaded automatically by setting OPENCLAW_BUNDLED_PLUGINS_DIR in the child process environment before OpenClaw starts. No manual plugin installation is required.
What Each Stage Does
critiqor monitor openclaw — The CLI validates your options and calls SupervisedOpenClawRuntime.run(). The runtime creates a session record, sets environment variables that carry run context into the child process, then spawns openclaw chat (or a custom command via --openclaw-command).
OpenClaw (child process) — Runs normally. The user interacts with it as they would without Critiqor. The only difference is that the bundled plugin is auto-loaded via the environment variable injected by the runtime.
Critiqor OpenClaw Plugin — A passive JavaScript observer registered through OpenClaw’s extension API. It hooks into tool lifecycle events and timeline events without modifying any agent code. Every captured event is appended to runs/<run_id>/session.json in real time.
critiqor finalize — The CLI calls finalize_observation(). The runtime reads the active session, merges internal lifecycle events with the plugin evidence from session.json, runs the diagnosis engine, and writes diagnosis.json. The local dashboard is then served automatically unless --no-dashboard is passed.
Learn More
- Observation Engine — Session lifecycle, state machine, file structure, and how events flow from two sources into a single finalized record.
- OpenClaw Plugin — How the bundled plugin hooks into OpenClaw’s runtime event system, what it collects, and how event normalization works.