-
Notifications
You must be signed in to change notification settings - Fork 0
07 workerpals
github-actions[bot] edited this page Feb 20, 2026
·
1 revision
WorkerPals is the execution engine. It takes planned jobs and turns them into concrete repository changes.
Main responsibilities:
- claim jobs from Server,
- run backend agents (
miniswe,openhands,openai_codex), - stream logs back to Server,
- create job-scoped commits,
- enqueue completion records for integration.
-
apps/workerpals/src/workerpals_main.ts- daemon loop, claim/report lifecycle. -
apps/workerpals/src/execute_job.ts- task execution orchestration and quality gates. -
apps/workerpals/src/docker_executor.ts- warm-container runtime and worktree isolation. -
apps/workerpals/src/job_runner.ts- container-side execution wrapper. -
apps/workerpals/src/backends/backend_config.ts- backend registry/config mapping. -
apps/workerpals/src/backends/*- backend-specific integrations.
- Host mode:
- jobs run directly in host worktrees.
- Docker mode (recommended/default in full stack):
- jobs run in isolated containers with worktree mounting.
- warm container model reduces repeated startup overhead.
At a high level:
- Worker claims job.
- Isolated worktree is created.
- Backend executor runs task.
- Logs stream to server as job logs.
- Job result is reported complete/fail.
- Commit metadata is enqueued as completion when applicable.
- Worktree is cleaned up.
Each job runs in an isolated git worktree to avoid cross-job contamination.
This provides:
- safer parallelism,
- clear commit provenance by job,
- simpler cleanup semantics.
execute_job.ts adds quality mechanisms beyond "run command":
- deterministic quality checks for test-focused tasks,
- validation-step execution support,
- optional critic/revision loops (backend-specific),
- output compaction and structured result handling.
- Backend output parse errors:
- usually schema/format mismatch in executor output.
- Docker warm container issues:
- usually image/tooling/network precondition failures.
- Repeated timeouts:
- usually budget mismatch or backend model/tool slowness.
backend_config.ts plus backend specs provide:
- named backend selection from config,
- runtime python/timeout mapping,
- docker warmup hooks,
- task executor registration.
This keeps workerpals_main.ts mostly backend-agnostic.
Pros:
- strong isolation for safety and reproducibility,
- backend modularity,
- resilient execution with retries/backoff.
Cons:
- Docker mode adds startup and tooling requirements,
- backend diversity increases complexity and test matrix size,
- execution wrappers are operationally heavy.
- Confirm worker heartbeat recency.
- Confirm claimed job state transitions and job logs.
- Confirm executor backend and timeout config in effective runtime config.
- Confirm Docker image and warm-container health when in Docker mode.
- Add per-backend capability declarations and planner-aware backend routing.
- Add richer artifact publishing (diff summaries, file-level metrics, coverage deltas).
- Add adaptive timeout policies based on historical task profiles.