Pin a task to one worker
Status: Ready
Article ID: 035
Truth label: Limited
Audience: Fleet operator
Reader outcome: Pin work to the worker that can reach its literal project path and verify that the stored assignment matches the request.
Related articles: 012, 034, 064
Target week: 14
Last verified: 2026-09-13
Technical reviewer: Codex source audit
Editorial reviewer: Codex editorial audit
Start from literal paths
A registered project stores the path string that workers receive. Forge does not translate a Windows path into a macOS or Linux path, or map one machine's checkout to another. The task must reach a worker where that literal path is valid and points to the intended repository.
In a mixed fleet, worker pinning is the current routing control for that constraint.
Use the correct request field
The create-task request field is assigned_worker_id. The returned and stored
task field is assigned_worker. This difference matters because unknown
request fields are currently ignored by the model parser.
If a caller sends assigned_worker by mistake, Central can create an unpinned
task rather than rejecting the request. Always inspect the response and confirm
that assigned_worker contains the intended worker id before execution.
Prove worker and path together
Before creating consequential work:
- identify the worker by its persisted id, hostname, and instance name
- confirm it is online and advertises the requested engine
- verify the project path on that worker
- create a narrow read-only task with
assigned_worker_id - confirm the returned
assigned_worker - confirm the claim and run history name the same worker
Do not rely only on a familiar hostname. Multiple instances can run on one host and each has its own worker identity.
Understand retry behavior
When a task is claimed, Central records the assigned worker. An opted-in automatic retry keeps that assignment so the new attempt returns to the same machine. This supports literal paths and any recorded CLI session resume.
If the machine is unavailable, the pinned task waits. After the configured
grace period Central reports it as stranded through GET /alerts and the
Cortex alert bar, because a task pinned before any claim has no lease to
expire and would otherwise wait with every counter reading healthy.
Reassigning it without proving another checkout can change the files and
evidence the task sees.
Combine pinning with other constraints
A pin does not bypass engine, capability, parent dependency, credential, or permission checks. It narrows worker identity. Keep the engine and required capabilities accurate, and set a permission ceiling that matches the work.
For a future portable fleet, per-worker reachable-root mapping should replace manual path knowledge. That mechanism is not implemented today.
Current limits
Pinning is an operator-managed workaround for literal paths, not automatic cross-platform routing. Unknown task fields can be silently dropped, so the response must be checked. A pin does not prove repository identity, filesystem isolation, or worker health at execution time.
Next lesson
Continue with Use sessions for related work.
Derivative map
- Weekly package: WEEK-14
- Long video: VIDEO-W14-LONG
- Shorts: SHORT-W14-PROBLEM, SHORT-W14-MECHANISM, SHORT-W14-WARNING
- Email: EMAIL-W14
- LinkedIn: LI-W14-A, LI-W14-B
- X: X-W14-A, X-W14-B
- Visual: VISUAL-W14
Review record
- Literal path, request-field, persisted pin, routing, and retry behavior checked against current source.
- Unknown-field, portability, repository-identity, isolation, and liveness limits reviewed.
- Procedure verifies the returned assignment before work begins.
- Internal links and repository voice reviewed.
Review completed: 2026-08-27
Re-audited against the running product: 2026-09-13