Skip to content

openclaw substrate support #1939

Open
peterj wants to merge 31 commits into
mainfrom
peterj/substrate
Open

openclaw substrate support #1939
peterj wants to merge 31 commits into
mainfrom
peterj/substrate

Conversation

@peterj
Copy link
Copy Markdown
Collaborator

@peterj peterj commented May 27, 2026

support running openclaw on substrate.

Copilot AI review requested due to automatic review settings May 27, 2026 17:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Agent Substrate as a new runtime option for OpenClaw/NemoClaw AgentHarnesses, alongside the existing OpenShell flow. The PR introduces new CRD/API fields, controller/provisioning logic for Substrate WorkerPool/ActorTemplate/Actor lifecycle, a kagent gateway proxy for OpenClaw UI traffic, Helm wiring/RBAC, UI form/list updates, and example documentation.

Changes:

  • Adds spec.runtime=substrate and spec.substrate configuration/status support for AgentHarness resources.
  • Implements Substrate backend/provisioner logic, shared OpenClaw bootstrap generation, and HTTP/WebSocket gateway proxying to actor pods.
  • Updates UI, Helm chart, CRDs, examples, and Go module dependencies to expose and deploy the new runtime.

Reviewed changes

Copilot reviewed 63 out of 67 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
ui/src/types/index.ts Adds Substrate harness response shape to UI types.
ui/src/lib/openshellSandboxAgents.ts Adds helpers for identifying Substrate harness rows.
ui/src/lib/openClawSandboxForm.ts Extends harness form draft generation with runtime and Substrate fields.
ui/src/lib/agentHarness.ts Generalizes harness helpers across OpenShell/Substrate runtimes.
ui/src/components/AgentListView.tsx Routes Substrate harness chat/action links to the gateway path.
ui/src/components/AgentCard.tsx Shows runtime context and links Substrate harnesses to gateway UI.
ui/src/components/agent-form/OpenClawSandboxFields.tsx Adds runtime selection and Substrate-specific form inputs.
ui/src/app/openshell/OpenshellTerminalPage.tsx Refactors terminal reconnect/autoconnect handling and messaging.
ui/next.config.ts Adds local-development /api rewrite to the controller.
helm/kagent/values.yaml Adds Substrate controller values and oauth2-proxy gateway skip-auth regex.
helm/kagent/templates/rbac/getter-role.yaml Grants controller RBAC for Substrate CRDs.
helm/kagent/templates/controller-deployment.yaml Wires Substrate Helm values into controller environment variables.
helm/kagent-crds/templates/kagent.dev_agentharnesses.yaml Regenerates Helm CRD with runtime/substrate fields.
go/go.mod Adds Substrate module dependency and related version updates.
go/go.sum Adds checksums for new/updated Go dependencies.
go/core/pkg/sandboxbackend/substrate/* Adds Substrate backend, ate-api client, provisioning, deletion, gateway-token, startup template, and tests.
go/core/pkg/sandboxbackend/openshell/* Updates OpenShell imports to use the shared OpenClaw package.
go/core/pkg/sandboxbackend/openclaw/* Moves/refactors shared OpenClaw bootstrap, policy, channels, credentials, and model config logic.
go/core/pkg/app/app.go Registers Substrate scheme, flags, backend/provisioner construction, and gateway config.
go/core/internal/httpserver/server.go Adds AgentHarness gateway route and WebSocket auth-query handling.
go/core/internal/httpserver/middleware.go Excludes gateway proxy paths from forced JSON content type.
go/core/internal/httpserver/handlers/handlers.go Passes gateway configuration into handlers.
go/core/internal/httpserver/handlers/agents.go Emits Substrate harness list entries in agent responses.
go/core/internal/httpserver/handlers/agentharness_gateway.go Adds HTTP/WebSocket reverse proxy for Substrate OpenClaw gateway UI.
go/core/internal/httpserver/handlers/agentharness_gateway*_test.go Adds gateway proxy/path behavior tests.
go/core/internal/controller/agentharness_controller.go Dispatches AgentHarness reconciliation by runtime and integrates Substrate provisioning/deletion.
go/api/v1alpha2/agentharness_types.go Adds runtime, substrate spec/status, and CRD printer column definitions.
go/api/v1alpha2/zz_generated.deepcopy.go Regenerates deepcopy methods for new AgentHarness fields.
go/api/httpapi/types.go Adds Substrate harness response DTOs.
go/api/config/crd/bases/kagent.dev_agentharnesses.yaml Regenerates base CRD with runtime/substrate schema.
examples/substrate-openclaw/README.md Documents local Substrate/OpenClaw setup and harness usage.
Files not reviewed (1)
  • go/api/v1alpha2/zz_generated.deepcopy.go: Language not supported
Comments suppressed due to low confidence (1)

go/core/pkg/sandboxbackend/openclaw/modelconfig.go:40

  • This SecretKeyRef only contains the secret name, so it will be resolved in the ActorTemplate/actor namespace. modelConfigRef can point at a ModelConfig in another namespace, and the existing OpenShell path reads the API key Secret from mc.Namespace; in that case substrate actors will look for the secret in the wrong namespace. Either reject cross-namespace ModelConfigs for substrate with a clear error or copy/reference credentials in the harness namespace before creating the ActorTemplate.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ui/src/lib/openClawSandboxForm.ts
Comment thread go/core/pkg/sandboxbackend/substrate/client.go Outdated
Comment thread go/core/pkg/sandboxbackend/substrate/client.go Outdated
Comment thread go/core/pkg/sandboxbackend/substrate/provision_openclaw.go
Comment thread go/core/pkg/sandboxbackend/substrate/openclaw.go
Comment thread go/core/internal/httpserver/handlers/agentharness_gateway.go
Comment thread helm/kagent/values.yaml Outdated
Comment thread go/core/pkg/sandboxbackend/substrate/gateway_token.go Outdated
peterj added 5 commits May 27, 2026 11:14
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
…modelconfig/channels

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
@peterj peterj force-pushed the peterj/substrate branch from eb6a487 to 25bf681 Compare May 27, 2026 18:19
@chromatic-com
Copy link
Copy Markdown

chromatic-com Bot commented May 27, 2026

Important

UI Tests need review – Review now

🟡 UI Tests: 9 visual and accessibility changes must be accepted as baselines
🟡 UI Review: Go review the new and updated UI
Storybook icon Storybook Publish: 134 stories published

Comment on lines +51 to +56
type AgentHarnessSubstrateSnapshotsConfig struct {
// Location is the GCS URI prefix for golden and incremental snapshots.
// Example: gs://ate-snapshots/kagent/my-namespace/my-harness/
// +required
Location string `json:"location"`
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

substrate usually deploys with an instance of rustfs, how can the user specify that for snapshots?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it comes down to the way substrate is installed. with the kind installation it automatically deploys rustfs and points atelet to it.

Comment thread go/api/v1alpha2/agentharness_types.go Outdated
Comment thread go/api/v1alpha2/agentharness_types.go Outdated
Comment thread go/api/v1alpha2/agentharness_types.go
Comment thread go/api/v1alpha2/agentharness_types.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this code only for substrate or also for openshell, I'm a little confused what the difference is

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is substrate only. we don't have a way to ssh into the workload as we have in openshell; so, instead we're launching into the openclaw UI.

Comment thread helm/kagent/templates/rbac/getter-role.yaml
Comment thread go/core/pkg/sandboxbackend/substrate/delete_provision.go Outdated
Comment thread go/core/pkg/sandboxbackend/substrate/config.go
Comment thread go/core/pkg/sandboxbackend/substrate/openclaw.go Outdated
peterj and others added 9 commits May 27, 2026 16:15
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
@peterj peterj force-pushed the peterj/substrate branch from c4ffeed to a161e7e Compare June 1, 2026 17:37
@peterj
Copy link
Copy Markdown
Collaborator Author

peterj commented Jun 1, 2026

@copilot resolve the merge conflicts in this pull request

Copy link
Copy Markdown

Copilot AI commented Jun 1, 2026

@copilot resolve the merge conflicts in this pull request

Resolved and pushed in 5995939.

Copilot finished work on behalf of peterj June 1, 2026 17:46
peterj added 10 commits June 1, 2026 19:05
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
…modelconfig/channels

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
@EItanya EItanya force-pushed the peterj/substrate branch from 5995939 to c4bfce5 Compare June 1, 2026 19:58
EItanya added 4 commits June 1, 2026 20:06
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@EItanya EItanya force-pushed the peterj/substrate branch from c4bfce5 to 4d379f1 Compare June 1, 2026 20:07
peterj added 3 commits June 1, 2026 14:16
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
…peterj/substrate

* 'peterj/substrate' of github.com:kagent-dev/kagent:
  Fix AgentHarness CI failures
  Split AgentHarness controllers by runtime
  Simplify substrate actor cleanup wiring
  Refine substrate AgentHarness lifecycle
  fix failing helm unit tests
  commenting out the substrate section in values
  move write ops to writer-role
  make linter happy
  pr feedback
  move startup script to a template
  split substrate and openshell, use the secrets in substrate fork for modelconfig/channels
  clean up ui/gateway stuff (use base path from openclaw)
  fix up the optional/non-optional types in the crd/values file
  substrate wip
  fix(compaction): preserve namespaced tool names in LLM summarizer prompt (#1907)
  Fix/1945 fix for wrong validation being triggered (#1946)
  fix(security): replace shell-templated skills-init with Go binary (#1842) (#1928)

Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
Signed-off-by: Peter Jausovec <peter.jausovec@solo.io>
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.

4 participants