Skip to content

fix: set explicit workerName matching the manifest name in worker templates#39

Open
sergiofilhowz wants to merge 1 commit into
mainfrom
fix/worker-names-match-manifest
Open

fix: set explicit workerName matching the manifest name in worker templates#39
sergiofilhowz wants to merge 1 commit into
mainfrom
fix/worker-names-match-manifest

Conversation

@sergiofilhowz

@sergiofilhowz sergiofilhowz commented Jul 14, 2026

Copy link
Copy Markdown

Why

The nightly quickstart-validator started failing after the iii 0.21.5 release: iii worker add ./workers/caller-worker times out after 120s with "not registered (engine has no worker under this name)" — even though the worker VM boots, connects, registers math::add_two_numbers, and serves triggers correctly.

Root cause

Since iii 0.21.5 (iii-hq/iii#1949, MOT-3931), iii worker add --wait / status / list trust only the worker names reported by engine::workers::list. A worker that never sets a name falls back to the SDK's hostname:pid default — (none):288 inside a libkrun VM — so it can never match its config.yaml entry name.

The Python math-worker template already passes InitOptions(worker_name="math-worker"), which is why step 3 of the quickstart passes and step 4 (the TypeScript caller-worker, which passed no name) hangs.

Reproduced and verified locally with the released 0.21.5 binaries: before this change iii worker add ./workers/caller-worker times out at 120s while iii trigger math::add_two_numbers a=10 b=20 happily returns {"c":30}; with workerName: 'caller-worker' added, the add completes with ✓ caller-worker ready.

What

Set workerName / WorkerMetadata.name explicitly to the iii.worker.yaml manifest name in every template worker that was missing it:

  • iii/quickstart/workers/caller-worker (the validator failure)
  • iii/multi-worker-orchestration/workers/client
  • iii/multi-worker-orchestration/workers/payment-worker
  • iii/multi-worker-orchestration/workers/compute-worker (Rust — cargo check passes against published iii-sdk 0.20.0)
  • iii/quickstart-ai-agents/workers/account-events (docker-based; attribution/console benefit only)

Python templates already set names; worker-bare already sets my-worker.

Follow-up (in iii-hq/iii)

The systemic fix — propagating III_WORKER_NAME into managed worker VMs and having SDKs default to it — is being prepared in the iii repo so templates/user code never need to repeat the manifest name.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Enhancements
    • Worker registrations now include explicit names for client, compute, payment, account-events, and caller workers.
    • Improved worker identification across orchestration and quickstart workflows.

…plates

Since iii 0.21.5 (iii-hq/iii#1949, MOT-3931), `iii worker add --wait`,
`iii worker status`, and `iii worker list` trust only the names reported
by `engine::workers::list`. Workers that never set a name fall back to
the SDK's `hostname:pid` default ("(none):288" inside a VM), so they can
never match their config.yaml entry — `iii worker add` times out after
120s reporting "not registered" even though the worker is connected and
serving. This broke the quickstart (caller-worker) and the nightly
quickstart-validator.

Set workerName / WorkerMetadata.name explicitly to the iii.worker.yaml
manifest name in every template worker that was missing it.

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

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a21e5a1-4880-44df-94b0-13633dda05ec

📥 Commits

Reviewing files that changed from the base of the PR and between e188f16 and 87a4412.

📒 Files selected for processing (5)
  • iii/multi-worker-orchestration/workers/client/src/worker.ts
  • iii/multi-worker-orchestration/workers/compute-worker/src/main.rs
  • iii/multi-worker-orchestration/workers/payment-worker/src/external-worker.ts
  • iii/quickstart-ai-agents/workers/account-events/src/worker.ts
  • iii/quickstart/workers/caller-worker/src/worker.ts

📝 Walkthrough

Walkthrough

Worker registration is updated across five example workers to provide explicit identities. TypeScript workers pass workerName, while the Rust compute worker passes WorkerMetadata through InitOptions.

Changes

Worker identity registration

Layer / File(s) Summary
TypeScript worker names
iii/multi-worker-orchestration/workers/client/src/worker.ts, iii/multi-worker-orchestration/workers/payment-worker/src/external-worker.ts, iii/quickstart-ai-agents/workers/account-events/src/worker.ts, iii/quickstart/workers/caller-worker/src/worker.ts
Worker registration calls now include explicit workerName values.
Rust worker metadata
iii/multi-worker-orchestration/workers/compute-worker/src/main.rs
The compute worker passes WorkerMetadata { name: "compute-worker" } through InitOptions during registration.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: guibeira

Poem

I’m a bunny with workers in line,
Each one now has a name tag so fine.
Client, payment, compute too,
Account events and caller come through.
Clear identities hop into view!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding explicit worker names in worker templates to match manifest names.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/worker-names-match-manifest

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant