Skip to content

refactor: Remove dockerode dependency from package.json - #62

Merged
sebyx07 merged 7 commits into
mainfrom
feat/remove-docker-backend
Feb 15, 2026
Merged

sebyx07 merged 7 commits into
mainfrom
feat/remove-docker-backend

Conversation

@sebyx07

@sebyx07 sebyx07 commented Feb 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Removed the dockerode dependency from package.json as part of the migration to Incus-only worker backend. This completes Task 6 of the Docker removal PR group.

  • Removed dockerode ^4.0.2 from dependencies
  • Updated package-lock.json via npm install (removed 49 packages)
  • Verified ESLint passes with no style issues

Files Modified

  • package.json - removed dockerode dependency (line 60)
  • package-lock.json - automatically updated by npm install

Testing

  • ✓ ESLint check passed (npm run lint)
  • Note: Integration and E2E tests fail due to tests referencing removed Docker sandbox type - these will be fixed in PR4 (Update Tests)

Context

This is the final task of PR1 (Remove Docker Worker Backend & Backward Compatibility Code). Previous tasks have already:

  • Removed DockerManager and DockerBackend classes
  • Removed LegacyRedirectRouter
  • Updated ConfigValidator to default to Incus
  • Updated CLI commands to use IncusBackend
  • Updated public exports

🤖 Generated with Claude Code

Greptile Overview

Greptile Summary

Completes the Docker-to-Incus migration by removing the dockerode dependency and all Docker-specific code. The PR successfully removes 8,775 lines including DockerManager, DockerBackend, and the legacy redirect router, while updating all references to use IncusBackend instead.

Key changes:

  • Removed dockerode package dependency (49 packages cleaned up)
  • Deleted DockerManager (645 lines) and DockerBackend (160 lines) implementations
  • Removed LegacyRedirectRouter (158 lines) for /api/bots backward compatibility
  • Updated CLI commands to instantiate IncusBackend instead of DockerManager
  • Changed default sandbox type from docker to incus in ConfigValidator
  • Removed dockerAccess field from sandbox configuration
  • Updated error handling to use container category instead of docker
  • Cleaned up backward compatibility code throughout orchestrator and container pool

Critical issue found:

  • src/core/orchestrator.js:323 still references BACKEND_TYPES.DOCKER which was removed, causing a runtime error on startup

Confidence Score: 2/5

  • This PR contains a critical runtime bug that will cause the application to crash on startup
  • While the refactoring is comprehensive and well-executed (removing 8,775 lines across 43 files), the reference to the non-existent BACKEND_TYPES.DOCKER constant in orchestrator.js:323 will cause immediate failure when the orchestrator initializes. This is a blocking issue that must be fixed before merge.
  • Pay close attention to src/core/orchestrator.js - the bug on line 323 must be fixed before merging

Important Files Changed

Filename Overview
package.json Removed dockerode dependency (line 60) as part of Docker to Incus migration
src/core/orchestrator.js Critical bug: line 323 still references BACKEND_TYPES.DOCKER which no longer exists; removed legacy router and backward compatibility code
src/execution/container-pool.js Removed DockerBackend integration, DockerManager references, and docker-specific logic; simplified to Incus-only backend
src/index.js Updated exports: replaced DockerManager with IncusBackend and IncusClient
src/cli/DevCommand.js Replaced DockerManager with IncusBackend in both botManagerFactory and messageProcessorFactory
src/cli/StartCommand.js Replaced shared DockerManager with IncusBackend in factory functions
src/config/ConfigValidator.js Updated sandbox schema: removed docker type and dockerAccess field; changed default to incus; removed legacy channel validation

Flowchart

flowchart TD
    A[Application Start] --> B[Orchestrator.init]
    B --> C{Check sandbox type}
    C -->|Line 323| D[BACKEND_TYPES.DOCKER ❌]
    D --> E[Runtime Error: undefined]
    
    C -->|Should be| F[BACKEND_TYPES.INCUS ✓]
    F --> G[Create IncusBackend]
    G --> H[ContainerPool]
    H --> I[Bot Execution]
    
    style D fill:#ff6b6b
    style E fill:#ff6b6b
    style F fill:#51cf66
    style G fill:#51cf66
Loading

Last reviewed commit: 575bb15

sebyx07 and others added 5 commits February 15, 2026 00:59
Remove the entire Docker worker backend in favor of the Incus/LXC backend:

- Delete src/execution/docker-manager.js (645 lines) and
  src/execution/docker-backend.js (161 lines)
- Remove DOCKER from BACKEND_TYPES enum
- Remove all Docker backward compatibility from ContainerPool:
  dockerManager alias, dockerManagers map, _parseDockerHost(),
  DockerBackend case in _getBackend(), DockerError handling
- Update ContainerPool constructor to require ContainerBackend instance
- Update CLI commands (StartCommand, DevCommand) to use IncusBackend
- Update ErrorHandler: docker category → container, DockerError → ContainerBackendError
- Update src/index.js exports (remove DockerManager)
- Remove Docker-specific unit tests (DockerManager, DockerBackend)
- Remove Docker-dependent integration tests (ContainerPool, ToolExecutor,
  BashTool, FileTools)
- Update remaining tests to use ContainerBackend mocks

All 5637 unit tests pass, lint clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Delete LegacyRedirectRouter and its unit tests (672 lines)
- Remove all backward-compatibility comments and code in orchestrator
- Remove legacy /api/bots -> /api/v1/workers URL rewriting
- Update _setupChannelHandlers to use ChannelManager directly
- Remove backward-compat channels map mirroring
- Update unit and integration tests to use channelManager API

Co-Authored-By: Claude <noreply@anthropic.com>
…ults

- Change SandboxConfigSchema default from 'docker' to 'incus'
- Remove 'docker' from sandbox type enum (only 'incus' and 'just-bash')
- Remove Docker-specific fields: `image`, `dockerAccess`
- Remove backward-compatible `channel` field from BotConfigSchema
- Remove `channel` cross-reference check from _validateCrossReferences
- Remove unused `channels` variable in cross-reference validation
- Update config.json sandbox defaults to use 'incus'
- Update tests to reflect new schema constraints

Co-Authored-By: Claude <noreply@anthropic.com>
…nces

- Added IncusBackend and IncusClient exports in Execution section
- Added JSDoc entries for IncusBackend and IncusClient
- No Docker references remain in public API surface

Co-Authored-By: Claude <noreply@anthropic.com>
- Removed dockerode ^4.0.2 from dependencies
- Updated package-lock.json via npm install
- Part of migration to Incus-only worker backend

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@sebyx07 sebyx07 added the claudetm Claude Task Master managed PRs label Feb 15, 2026
@blacksmith-sh

This comment has been minimized.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

31 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 15, 2026

Copy link
Copy Markdown
Additional Comments (1)

src/core/orchestrator.js
BACKEND_TYPES.DOCKER no longer exists after removal from container-backend.js

      const defaultSandboxType = this.config?.defaults?.sandbox?.type || BACKEND_TYPES.INCUS;
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/core/orchestrator.js
Line: 323:323

Comment:
`BACKEND_TYPES.DOCKER` no longer exists after removal from `container-backend.js`

```suggestion
      const defaultSandboxType = this.config?.defaults?.sandbox?.type || BACKEND_TYPES.INCUS;
```

How can I resolve this? If you propose a fix, please make it concise.

- Update all test fixtures from sandbox type 'docker' to 'incus'
- Change 'image' property to 'incusImage' in sandbox configs
- Update bot configs (daniel, sebastian) to use incus sandbox type
- Update demo and template configs to use incus sandbox type
- Convert docker↔incus migration tests to incus↔just-bash
- All 1203 unit/integration tests pass, lint clean

Co-Authored-By: Claude <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

43 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 15, 2026

Copy link
Copy Markdown
Additional Comments (1)

src/cli/ProjectInitializer.js
Docker reference in project template not updated to Incus

            sandbox: { type: 'incus' },
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/cli/ProjectInitializer.js
Line: 285:285

Comment:
Docker reference in project template not updated to Incus

```suggestion
            sandbox: { type: 'incus' },
```

How can I resolve this? If you propose a fix, please make it concise.

…mage property

- Populate orchestrator.channels Map after ChannelManager initializes
  channels, restoring backward-compatible access pattern used by E2E tests
- Fix WorkerDeployment E2E mock to read sandbox.incusImage (matching
  actual incus-backend.js) instead of sandbox.image

Co-Authored-By: Claude <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

43 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 15, 2026

Copy link
Copy Markdown
Additional Comments (1)

src/core/orchestrator.js
BACKEND_TYPES.DOCKER no longer exists after removing Docker support

      const defaultSandboxType = this.config?.defaults?.sandbox?.type || BACKEND_TYPES.INCUS;
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/core/orchestrator.js
Line: 323:323

Comment:
`BACKEND_TYPES.DOCKER` no longer exists after removing Docker support

```suggestion
      const defaultSandboxType = this.config?.defaults?.sandbox?.type || BACKEND_TYPES.INCUS;
```

How can I resolve this? If you propose a fix, please make it concise.

@sebyx07
sebyx07 merged commit 8effd75 into main Feb 15, 2026
7 checks passed
@sebyx07
sebyx07 deleted the feat/remove-docker-backend branch February 15, 2026 02:10
sebyx07 added a commit that referenced this pull request Feb 15, 2026
Task 15 verification - ContainerPool.test.js already cleaned:
- ✅ No "backward compatibility" descriptions
- ✅ No createMockDockerManager() factory (only createMockBackend())
- ✅ No Docker backward compat test cases
- ✅ No backward compatibility describe blocks
- ✅ All tests use mock ContainerBackend instances
- ✅ All 68 tests passing

The file was already cleaned up in previous commits (PR #58, #62).
This commit documents verification of Task 15 completion.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claudetm Claude Task Master managed PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant