feat: OpenClaw integration — Phase 1 (spawn mode, dashboard badge, examples & docs)#376
feat: OpenClaw integration — Phase 1 (spawn mode, dashboard badge, examples & docs)#376AndreRatzenberger wants to merge 36 commits intomainfrom
Conversation
…, migration guide
… (flock-repo-cv4.1)
…(flock-repo-cv4.9)
…ts (flock-repo-cv5.1-5.3)
…(cv5 review fixes)
…etadata, verification primitives)
…ph UI) - graph_builder.py: detect OpenClaw engines, emit isOpenClawAgent + engineKind - AgentNode.tsx: render orange 🦞 OpenClaw badge pill - AgentNode.test.tsx: badge rendering test - test_dashboard_graph.py: backend graph assembler test
…ion mismatch The CI rich version has a different Text.assemble() signature than local. Using no_output=True isolates transport tests from terminal rendering.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #376 +/- ##
==========================================
+ Coverage 83.64% 83.78% +0.13%
==========================================
Files 144 148 +4
Lines 9245 9454 +209
Branches 1174 1209 +35
==========================================
+ Hits 7733 7921 +188
- Misses 1212 1228 +16
- Partials 300 305 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…oost test coverage to 93% - engine.py: raise RuntimeError on non-auth ok:false (was silently falling through) - core/__init__.py: add GatewayConfig, OpenClawConfig, OpenClawDefaults to __all__ - test_openclaw_engine.py: 10 new tests covering error paths, parse edge cases, tokenless auth - test_openclaw_builder.py: __all__ verification test - uv.lock: regenerated for version 0.5.400
|
To use Codex here, create a Codex account and connect to github. |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex pls take a look |
|
To use Codex here, create a Codex account and connect to github. |
Updated the title and introductory text in README.
…-input artifacts, auto-label openclaw agents - engine.py: thread agent into _build_spawn_payload, include description in prompt - engine.py: iterate all input artifacts (array if >1, single object if 1) - orchestrator.py: auto-apply 'openclaw' label for dashboard badge detection on inactive agents - Tests updated to verify label and new payload structure
Updated the README to improve formatting and clarity.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| data, | ||
| produced_by=agent.name, | ||
| metadata={"correlation_id": ctx.correlation_id}, | ||
| ) |
There was a problem hiding this comment.
Pydantic ValidationError bypasses engine retry/repair loop
Medium Severity
When output_decl.apply(data, ...) calls spec.build, the underlying self.model(**data) performs Pydantic validation. If the OpenClaw agent returns valid JSON that doesn't match the output model (e.g., missing a required field), a Pydantic ValidationError is raised. This exception is not caught by the retry loop, which only handles RuntimeError and ValueError. As a result, no repair attempt is made and the error doesn't match the documented RuntimeError mapping. The repair prompt includes the schema, so a retry could succeed — but the opportunity is missed.
Additional Locations (1)
| {"id":"flock-repo-cv4.8","title":"Write failing integration tests: mixed OpenClaw + native pipeline behavior","notes":"Starting TDD step: add failing integration tests for OpenClaw + native mixed pipeline behavior.","status":"closed","priority":1,"issue_type":"task","owner":"pyros.sd.models@gmail.com","created_at":"2026-02-11T14:48:15.061717+01:00","created_by":"pyros-projects","updated_at":"2026-02-11T15:44:24.722408+01:00","closed_at":"2026-02-11T15:44:24.722408+01:00","close_reason":"Added failing integration tests in tests/integration/openclaw/test_openclaw_pipeline.py for validated OpenClaw artifact publishing and mixed OpenClaw+native pipeline; verified red (2 failed) due missing OpenClaw config exports from flock/flock.core namespaces.","dependencies":[{"issue_id":"flock-repo-cv4.8","depends_on_id":"flock-repo-cv4","type":"parent-child","created_at":"2026-02-11T14:48:15.062407+01:00","created_by":"pyros-projects"},{"issue_id":"flock-repo-cv4.8","depends_on_id":"flock-repo-cv4.7","type":"blocks","created_at":"2026-02-11T14:48:15.063393+01:00","created_by":"pyros-projects"}]} | ||
| {"id":"flock-repo-cv4.9","title":"Implement orchestrator/export wiring for OpenClaw integration","status":"closed","priority":1,"issue_type":"task","owner":"pyros.sd.models@gmail.com","created_at":"2026-02-11T14:48:15.170707+01:00","created_by":"pyros-projects","updated_at":"2026-02-11T15:50:17.691989+01:00","closed_at":"2026-02-11T15:50:17.691989+01:00","close_reason":"Implemented package export wiring for OpenClawConfig/GatewayConfig/OpenClawDefaults in flock and flock.core; integration red tests from cv4.8 turned green (commit 0fc4d780).","dependencies":[{"issue_id":"flock-repo-cv4.9","depends_on_id":"flock-repo-cv4","type":"parent-child","created_at":"2026-02-11T14:48:15.171334+01:00","created_by":"pyros-projects"},{"issue_id":"flock-repo-cv4.9","depends_on_id":"flock-repo-cv4.8","type":"blocks","created_at":"2026-02-11T14:48:15.172217+01:00","created_by":"pyros-projects"}]} | ||
| {"id":"flock-repo-cv5","title":"OpenClaw Phase1 Docs \u0026 Examples","status":"closed","priority":0,"issue_type":"epic","owner":"andre.ratzenberger@whiteduck.de","created_at":"2026-02-11T15:56:00.73672+01:00","created_by":"AndreRatzenberger","updated_at":"2026-02-11T16:05:02.334229+01:00","closed_at":"2026-02-11T16:05:02.334229+01:00","close_reason":"done"} | ||
| {"id":"flock-repo-cv5.1","title":"Create OpenClaw examples (01-03 + README)","status":"closed","priority":1,"issue_type":"task","owner":"andre.ratzenberger@whiteduck.de","created_at":"2026-02-11T15:56:17.244299+01:00","created_by":"AndreRatzenberger","updated_at":"2026-02-11T16:05:02.231448+01:00","closed_at":"2026-02-11T16:05:02.231448+01:00","close_reason":"done"} |
There was a problem hiding this comment.
Development tracking files committed to repository
Low Severity
The .beads/ directory (issue tracker database, config, metadata) and openspec/ directory (change proposals, task lists, test discovery notes) are development process scaffolding from the TDD workflow. They contain closed task tracking data with personal email addresses and duplicate information already captured in docs/specs/004-openclaw-integration/. Neither directory is mentioned in the PR's "What's Included" section, suggesting they were swept into the commit unintentionally.


Summary
First-class OpenClaw agent support for Flock. OpenClaw agents participate in Flock pipelines using the same fluent API — same blackboard semantics, different compute backend.
What's Included
Core Integration (
src/flock/integrations/openclaw/)OpenClawConfig/GatewayConfig— Gateway registration with env-based auto-discovery (OPENCLAW_<ALIAS>_URL+OPENCLAW_<ALIAS>_TOKEN)OpenClawEngine— Engine implementation (spawn mode) with task prompt builder, JSON response parsing, repair pass for malformed output, and error mapping.openclaw_agent()— Builder method onFlockclass for fluent APIDashboard
GraphAssembleremitsisOpenClawAgent+engineKindfieldsAgentNode.tsxrenders badge with triple detection (flag, engineKind, label fallback)Examples (
examples/11-openclaw/)01_pizza_with_openclaw.py— Single OpenClaw agent in a pipeline02_mixed_pipeline.py— OpenClaw + native LLM agents in the same workflow03_env_config.py— 12-factor env-based configurationREADME.md— Example guideDocumentation
docs/guides/openclaw.md— Comprehensive integration guide (setup, config, usage, error handling, Phase 2+ roadmap)docs/guides/index.md— Updated with Integrations sectiondocs/specs/004-openclaw-integration/concept.md— Full design spec (Phases 1–4)README.md— OpenClaw announcement banner + integration section with code samplesArchitecture Decision
Engine-based, not a new agent type. OpenClaw replaces only the compute step — all Flock semantics work unchanged:
Test Coverage
respxfor HTTP mocking — no real gateway neededPhase 1 Scope (Locked)
flock.openclaw_agent()on Flock class directlyValueError(config/auth),RuntimeError(transport/timeout/parse)Future Phases
Note
Medium Risk
Introduces a new remote-execution engine path (HTTP calls, retries, error mapping) and new public API surface (
openclaw_agent, config exports), which can affect runtime behavior and dashboard rendering despite being opt-in.Overview
Adds an opt-in OpenClaw integration that lets pipelines run agents via
flock.openclaw_agent()using a newOpenClawEngine(spawn-mode HTTP transport) plusOpenClawConfig/GatewayConfig(includingfrom_env()discovery), and re-exports these types fromflock/flock.core.Updates the dashboard graph payload to tag agents with
engineKind/isOpenClawAgentand updates the frontendAgentNodeto render an OpenClaw badge, with new unit/integration tests covering config, builder chaining, engine error/repair behavior, mixed pipelines, and dashboard tagging.Bumps version to
0.5.400and adds substantial docs/examples/spec artifacts (OpenClaw guide, README/AGENTS updates, examples, changelog, OpenSpec + Beads tracking/merge configuration).Written by Cursor Bugbot for commit 19fb103. This will update automatically on new commits. Configure here.