Skip to content

refactor: remove local workspace runtime, redesign config schema#571

Open
dorey-agent[bot] wants to merge 7 commits into
mainfrom
refactor/remove-local-runtime
Open

refactor: remove local workspace runtime, redesign config schema#571
dorey-agent[bot] wants to merge 7 commits into
mainfrom
refactor/remove-local-runtime

Conversation

@dorey-agent
Copy link
Copy Markdown
Contributor

@dorey-agent dorey-agent Bot commented May 10, 2026

Motivation

The local subprocess runtime (WorkspaceConfig::Local) was a development convenience that bypasses all container isolation, proxy enforcement, and resource limits. In production, all agents run in Docker containers. Keeping the local runtime adds code complexity, widens the attack surface, and creates a config path that's never used in real deployments.

Additionally, the workspace config schema needed redesign to support future runtime types (e.g., Firecracker, Podman) without breaking changes.

Solution

Remove local runtime entirely:

  • Delete LocalBackend and local_backend module (141 lines)
  • Remove WorkspaceConfig::Local variant and LocalWorkspaceConfig struct
  • Remove local agent validation, binary resolution, and spawn logic
  • Simplify keepalive (always enabled — was conditional on is_docker())

Redesign config schema with versioning:

  • Add schema_version: u32 to AnyclawConfig (default: 1)
  • Rename DockerWorkspaceConfigDockerWorkspaceOptions
  • Custom Deserialize supports both formats:
    • v2 (new): { type: "docker", options: { image: "...", ... } }
    • v1 (deprecated): { type: "docker", image: "...", ... } — emits tracing::warn!
  • type: "local" → clear error: "workspace type "local" has been removed"
  • Serialize always outputs v2 format
  • Future runtimes: just add a new enum variant + options struct

BREAKING CHANGE: type: local is no longer accepted. All agents must use Docker.

Testing

  • cargo test --workspace --exclude anyclaw-integration-tests --exclude anyclaw-services: all pass (1467 tests)
  • cargo clippy --workspace: zero warnings
  • cargo +1.95.0 fmt --check --all: clean
  • cargo clippy --workspace --manifest-path ext/Cargo.toml: clean
  • 29 manager tests marked #[ignore] (require Docker daemon — previously used local subprocess spawn)
  • Config deserialization tests cover: v1 compat, v2 format, local rejection, schema_version field

Checklist

  • Tests pass (cargo test)
  • No clippy warnings (cargo clippy --workspace -- -D warnings)
  • Formatted (cargo fmt --all -- --check)
  • Docs build cleanly (cargo doc --no-deps --workspace)
  • PR title follows Conventional Commits format
  • Updated relevant AGENTS.md if module structure or public APIs changed
  • Updated CHANGELOG.md if this is a user-facing binary change

[ai-assisted]

Remove the local subprocess runtime (WorkspaceConfig::Local) and redesign
the workspace config schema with versioned format support:

- Delete LocalBackend and local_backend module entirely
- Replace internally-tagged enum with custom Deserialize/Serialize that
  supports both v1 (flat fields, deprecated with warning) and v2
  (adjacently-tagged: type + options) formats
- Rename DockerWorkspaceConfig to DockerWorkspaceOptions
- Add schema_version field to AnyclawConfig (default: 1)
- Remove local agent validation, binary resolution, and spawn logic
- Simplify keepalive_interval (always enabled, Docker-only now)
- Add convenience methods docker()/docker_mut() on WorkspaceConfig
- Reject type: local with clear error message
- Update all examples to v2 format
- Regenerate JSON schema

BREAKING CHANGE: workspace type "local" is no longer supported.
All agents must use Docker containers (type: "docker").
Config schema v2 wraps runtime-specific fields under "options" key.
v1 format (flat fields) still accepted with deprecation warning.
@dorey-agent dorey-agent Bot requested a review from donbader as a code owner May 10, 2026 20:48
@dorey-agent dorey-agent Bot enabled auto-merge (squash) May 10, 2026 20:48
dorey-agent[bot] added 6 commits May 10, 2026 21:10
The Local workspace variant is needed by integration tests that spawn
agent-mock as a native subprocess. It remains rejected from YAML config
(deserialization produces a clear error), but is constructable in code.

- Re-add LocalBackend with test-only documentation
- Re-add LocalWorkspaceOptions struct (no serde derives for YAML)
- Add Local arm to build_backend, fs_sandbox, banner, supervisor
- Revert test-helper configs to use Local for agent-mock spawning
- Add is_docker() method back for keepalive conditional
…emon_uris

These production code paths called .docker() unconditionally, which panics
on Local workspace variants used by integration tests. Use match instead.
… YAML

Split the test: one verifies supervisor boot with Local config (no YAML),
the other verifies Docker config YAML round-trip (requires Docker image).
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.

0 participants