Skip to content

refactor: Update WorkerAssigner & SSH tunnels for Incus-only - #63

Merged
sebyx07 merged 3 commits into
mainfrom
feat/worker-assigner-incus-only
Feb 15, 2026
Merged

sebyx07 merged 3 commits into
mainfrom
feat/worker-assigner-incus-only

Conversation

@sebyx07

@sebyx07 sebyx07 commented Feb 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Simplify WorkerAssigner to remove Docker host resolution — only Incus host is resolved
  • Update SSHTunnelManager to default to Incus socket type, remove Docker socket support
  • Simplify ContainerPool._getBackend() to always route to Incus backend, remove switch/BACKEND_TYPES routing

Test plan

  • All 5584 unit tests pass (0 failures)
  • Lint passes clean
  • Integration test with real workers uses Incus containers

🤖 Generated with Claude Code

Greptile Overview

Greptile Summary

This PR completes the migration from Docker to Incus by removing all Docker-related code paths from the worker assignment and SSH tunnel management systems.

Key changes:

  • Removed _resolveDockerHost() method and dockerHost field from WorkerAssigner assignment results
  • Updated SSHTunnelManager to only support Incus socket type, removed SOCKET_TYPES.DOCKER and getDockerHost() method
  • Simplified ContainerPool._getBackend() to always use Incus backend, removing switch statement
  • Updated BotManager to only handle incusHost from worker assignments
  • Updated API responses to use incusHost instead of dockerHost in server router

Test coverage:

  • All 5584 unit tests pass according to PR description
  • Removed 74 Docker-related test cases (Docker host resolution tests in WorkerAssigner.test.js)
  • Updated remaining tests to verify Incus-only behavior

Confidence Score: 5/5

  • Safe to merge - clean refactoring with comprehensive test coverage
  • This is a well-executed refactoring that removes dead Docker code paths systematically. All changes are consistent across the codebase, tests have been updated appropriately, and the PR description confirms all 5584 tests pass.
  • No files require special attention

Important Files Changed

Filename Overview
src/api/routers/server-router.js Renamed dockerHost to incusHost in tunnel health responses
src/core/bot-manager.js Removed Docker host assignment logic, only uses Incus host from worker assignment
src/core/worker-assigner.js Removed _resolveDockerHost() method and dockerHost from assignment results
src/execution/container-pool.js Simplified _getBackend() to always use Incus backend, removed switch statement routing
src/worker/ssh-tunnel.js Removed Docker socket support, defaults to Incus socket type, removed getDockerHost() method

Sequence Diagram

sequenceDiagram
    participant BM as BotManager
    participant WA as WorkerAssigner
    participant STM as SSHTunnelManager
    participant CP as ContainerPool
    participant IB as IncusBackend

    BM->>WA: assignBot(botId, workerPreference)
    WA->>WA: Select worker (rules, load balancing)
    
    alt Remote Worker
        WA->>STM: getIncusHost(workerId)
        STM-->>WA: incusHost (tcp://127.0.0.1:port)
    else Local Worker
        WA-->>WA: incusHost = null
    end
    
    WA-->>BM: { workerId, incusHost, workerType }
    
    BM->>CP: initializeContainer(botId, config, { incusHost })
    
    alt Remote Incus
        CP->>IB: new IncusBackend({ socketPath: incusHost })
        IB-->>CP: Remote backend instance
    else Local Incus
        CP->>CP: Use default backend
    end
    
    CP->>IB: createContainer(botId, containerConfig)
    IB-->>CP: Container instance
    CP-->>BM: Container ready
Loading

Last reviewed commit: 53df041

sebyx07 and others added 3 commits February 15, 2026 02:15
- Delete _resolveDockerHost() method entirely
- Remove dockerHost from assignBot() and failover() return values
- Remove dockerHost consumption from bot-manager.js
- Remove backward-compat typeof check in _resolveIncusHost()
- Update all JSDoc to reference Incus instead of Docker
- Remove Docker host resolution tests, update Incus tests
- All 52 WorkerAssigner tests pass, lint clean

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

- Remove SOCKET_TYPES.DOCKER and DEFAULT_DOCKER_SOCKET_PATH constants
- Default socketType to INCUS (no longer configurable)
- Remove getDockerHost() method
- Simplify _getRemoteSocketPath() to always use Incus socket
- Simplify _establishTunnel() to always set incusHost
- Remove dockerHost from tunnel entries, health checks, and list results
- Update server-router.js to use incusHost instead of dockerHost
- Update all test mocks and assertions for Incus-only

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove switch/BACKEND_TYPES routing, always use Incus backend
- Remove BACKEND_TYPES import from container-pool.js
- Remove sandbox.type from JSDoc params (no longer used for routing)
- Prefix unused botConfig param with underscore
- Update comments to reflect Incus-only architecture

Co-Authored-By: Claude <noreply@anthropic.com>
@sebyx07 sebyx07 added the claudetm Claude Task Master managed PRs label Feb 15, 2026
@sebyx07
sebyx07 merged commit 20cc72f into main Feb 15, 2026
7 checks passed
@sebyx07
sebyx07 deleted the feat/worker-assigner-incus-only branch February 15, 2026 02:32
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