Skip to main content

Workers

Status: Ready

Truth label: Limited

Audience: Fleet operator, System designer

Reader outcome: Provision a worker with a known engine, a known identity, and a known permission ceiling, and predict which tasks it will be offered.

Last verified: 2026-09-13

Full guides: Forge, Runbook, Antigravity parity

What a worker is​

A worker is the only part of AGENTASIAN that executes code in your repository. It polls Central, claims a task, assembles a prompt, runs a coding CLI in the project directory, captures what changed, runs verification, and posts a result.

Central never starts a worker and never connects to one. That direction is why a worker can sit behind a firewall.

Prerequisites on the worker host​

  • Python 3.11 or newer.
  • A local checkout of each project the worker will execute.
  • At least one supported CLI installed and authenticated as the same operating system user that runs the worker.
  • Network access to Central, and preferably to Brain.

Complete the CLI's interactive login first, then confirm the binary is on that process's PATH.

Engines​

EngineCLINotes
claude-codeclaudeDefault. No provider key in .env
codexcodexNo OPENAI_API_KEY needed for CLI execution
codex-osscodex against OllamaRequires CODEX_OSS_BASE_URL ending in /v1. Forwards only gpt-oss model names
antigravityagyLog in once interactively. Streams agent and tool progress
agenticin-process tool loopLegacy
legacysingle shotLegacy

Antigravity accepts explicit model ids unchanged, including its Claude and GPT-OSS choices. Invalid ids fail through its own validation. An omitted model uses the CLI default. Use the AGY parity script to inventory two Antigravity installations before comparing their results.

CLI versions and effort​

Nothing in the repository installs or upgrades these CLIs, so two machines can run different versions and the adapters build command lines against flags verified on a particular one. A worker reports the version of each CLI it advertises when it registers, and Cortex shows it beside the engine name. An engine listed with no version means the CLI did not answer, which is unknown rather than missing. python scripts/upgrade-clis.py --check reports versions on the box it runs on; without --check it upgrades the backends with a verified self-update command, which today is claude-code. A CLI upgraded under a running worker takes effect on the next task, and the version shown is from the last registration, so restart the worker to refresh it.

Reasoning effort is a per-engine choice: Claude Code offers low to max, Antigravity low to high, Codex minimal to xhigh, and Codex OSS none. A worker drops a level its engine does not offer rather than passing a flag the binary would reject. There is no turn cap on any engine; agent turns are unlimited, and Claude Code runs without --max-turns.

Identity​

The worker identifies itself by hostname plus FORGE_WORKER_NAME. Use distinct names when running more than one worker process on one machine, because identity is the pair.

Central mints a credential on first registration. The worker stores it under <data_root>/worker-credentials/<hostname>-<instance>.token and Central stores only the hash. If that file is lost, delete the idle worker registration in Cortex or with DELETE /workers/{id}, then restart the worker. A stale token returns 401 at registration.

Permission levels​

Permission intent runs least to most authority.

LevelMeaning
safeRead-only analysis. Claude uses plan mode, Codex a read-only sandbox
writeEdit project files and run commands in the project. The default
yoloBypass the CLI's sandbox and permission checks entirely

FORGE_WORKER_PERMISSION is the default for tasks that do not specify one. FORGE_WORKER_MAX_PERMISSION is the ceiling a task may request on this machine. A task requesting more is clamped, with a warning in the task log.

Safe is a best effort engine mode, not an operating system sandbox. A verification command still executes repository code. Use yolo only on a trusted machine against a trusted project directory.

Routing​

Central decides whether to offer a pending task to a polling worker using:

  • the worker pin, if the task names an assigned_worker_id
  • the engine the worker has installed, or its pinned engine
  • required capabilities against the worker's advertised tags
  • parent task completion
  • the current task state
  • the worker's idle state
  • the project's status, rechecked inside the claim transaction

The worker normally polls every ten seconds. Paused and archived projects omit their pending tasks from polling.

If a worker is idle and a task is not offered, compare those fields one by one. That comparison resolves nearly every "the queue looks healthy but nothing runs" report.

Several workers on one machine​

Run one worker per engine and pin each of them, so they divide the queue rather than compete for it:

FORGE_WORKER_ENGINE=codex FORGE_WORKER_NAME=codex \
FORGE_WORKER_PIN_ENGINE=true ./run-worker.sh

Leave FORGE_WORKER_PIN_ENGINE off for a single worker so it can take work for every CLI installed on that machine.

Two workers must not check out the same project directory at the same time. Give each its own checkout, or pin the work.

Leases, fences, and the outbox​

Central issues a lease with a server owned TTL at claim, and a run token that identifies the attempt. The worker renews while the run continues. The renewal poll runs about every five seconds, so the default 60 second TTL tolerates many dropped polls without expiring a live run.

Three protections follow from that design:

  1. An expired lease lets another worker take the task. The original worker treats lease loss as a cancel and stops the CLI.
  2. A late result from a stale attempt is fenced by the run token and rejected, so it cannot overwrite newer work.
  3. A result that cannot reach Central stays in the worker's local outbox and drains when connectivity returns. Completed work missing in Central is usually sitting in an outbox.

The absolute cap is SE_MANAGER_RUN_MAX_WALLCLOCK_SECONDS on Central. Past it, Central expires the lease regardless of renewals.

Bundled governance​

Agent Global Operating Rules (AGOR) ship inside Agent Asian. Workers need no separate governance repository, plugin or installation. Startup validates and pins the bundled policy, and every executor receives it as required prompt input.

Project-local memory remains authoritative in managed and direct sessions. Writable tasks create only missing memory and native entrypoints. Existing files, legacy task ledgers and style guides are preserved. Read-only tasks perform no governance setup writes. Current repository controls are read in full; exceeding the combined 12,000-character limit stops the task before a model call instead of silently clipping rules.

Run metadata records the policy version, profile and digests, plus the current control digest and memory setup report. These identify the supplied policy; native compliance and fleet activation require separate evidence. A policy update takes effect after the idle worker restarts with updated Agent Asian code. Startup configures owned native instruction blocks and Claude advisory hooks; native permissions and unrelated settings remain unchanged.

Prompt assembly​

The served task prompt can include task and project identity, the description and specification, persona instructions or a managed method package, up to five requested legacy skills, repository control files, active Brain rules, session and parent context, prior stage inputs, scoped canonical project memory and learnings, verification expectations, and prior retry or revision feedback.

Repository control files are trusted instructions for that repository. Retrieved history and knowledge are labeled untrusted evidence.

The whole assembly runs through the worker context budget. Core task facts and required guidance are never silently shortened. A required prompt that exceeds the allocation stops before the CLI call, which is why some multi-skill methods need a larger profile configured before dispatch.

Execution and capture​

The adapter maps the task permission to engine flags and starts the CLI in the project directory with standard input closed. Output is captured and supported progress events are sent to Forge.

The worker records a bounded workspace baseline before execution and compares the final workspace with that baseline using file hashes and modes rather than Git status alone. A worker that creates a file and commits it still reports the net change. Untouched dirty or untracked files do not become this run's changes. Full detail is in Reviews and deliverables.

Verification​

If a verification command is configured, the worker parses it with shell-like argument rules but does not invoke a shell. It runs with a maximum of ten minutes. With no command configured and a project containing .git, the fallback is git diff --check.

Choose a command that exists on the selected worker. A bare python -m pytest can resolve to a missing or wrong global interpreter. Prefer an explicit virtual environment path or a command the worker resolves reliably.

Retrieval from a worker​

Brain resolves worker searches from the task Central has currently assigned. The saved source choices, lens groups, and recorded managed source publications govern retrieval. A worker cannot substitute its own source choices. Retiring or replacing a recorded publication makes it unavailable to that saved task rather than silently substituting a newer edition.

A worker does not need a local copy of the influence library. It retrieves eligible passages through Brain, and a saved choice does not grant direct file access.

Task-ledger migration​

Older projects can have competing task ledgers. The bundled governance commands stage a single editable ledger with a private diff, complete original bytes and a source-to-destination coverage map. Every checklist occurrence retains its original state. Duplicate records and differing completion states remain visible with provenance. The retired filename becomes a pointer.

Run python -m governance migrate-plan --root /path/to/project --state-dir /path/to/private-state from the product environment. Inspect the returned plan and diff, then use migrate-apply with --plan, --root and --state-dir. Both ledgers are checked before either write. An interruption can be resumed with the same plan or recovered with migrate-rollback and its --receipt; recovery requires --apply to write. Later file or permission changes cause a conflict and remain intact. These commands need only the product code and Python standard library. Startup does not migrate existing ledgers automatically.

Native account instructions​

Ordinary startup discovers installed Claude, Codex and Antigravity CLIs and runs the native setup bundled in Agent Asian. It initializes absent global instructions and updates only unchanged owned policy blocks. The configured Claude and Codex account directories are respected. Unowned instructions, edited blocks, overrides and size-limit conflicts remain visible for review. Native permission settings, credentials and hooks stay intact.

Private install receipts and pending pointers allow interrupted setup to resume. An active receipt supports recovery while preserving later text outside the owned block. Setup records file integrity at startup; it does not prove native loading, behavior or the file's later content. Each task retains that distinction in its resource evidence. Cortex can edit these known instruction files with counts, validation and history. Editing a managed block creates a review conflict for automatic upgrades; edit shared policy through bundled governance when a change should reach every profile.

Advisory Claude hooks​

Claude feedback ships with Agent Asian and uses its existing Python runtime. Session start supplies a bounded memory reminder. File-tool and shell edits are checked through Git status and file metadata, including untracked files. Known memory documents receive format and changed-prose checks. Source contents and transcripts are not collected. Limited or unavailable inspection is reported for manual review.

Final feedback is a user-facing warning at most once per session. It cannot block completion, start another model turn or replace the requested artifact. Native permissions remain unchanged. The bundled hook setup and rollback commands retain unrelated settings and extra hooks; reviewed legacy advisory entries have private recovery evidence. Cortex lists configuration and implementation hashes separately from execution proof.

Policy identity is visible in rendered text because native readers can remove comments. A file hash, a supplied native instruction and a successful standalone read remain distinct evidence. A denied native read stays unverified.