Skip to content

fix(harness): register web::fetch worker in composite entry#203

Merged
andersonleal merged 1 commit into
mainfrom
fix/harness-register-web-worker
May 29, 2026
Merged

fix(harness): register web::fetch worker in composite entry#203
andersonleal merged 1 commit into
mainfrom
fix/harness-register-web-worker

Conversation

@andersonleal
Copy link
Copy Markdown
Collaborator

@andersonleal andersonleal commented May 29, 2026

Summary

The web::fetch worker added in #202 shipped its source files and a standalone src/web/main.ts, but was never wired into src/index.ts — the composite all-in-one entry that pnpm dev:all (bun --watch src/index.ts) and start:all (node dist/index.js) run. As a result the web worker silently never started in the all-in-one process.

This registers it alongside the other 15 workers and backfills the wiring that #202 missed.

Changes

  • src/index.ts: import registerWeb and add the web worker to the WORKERS array. Composite manifest now reports 16 workers (was 15).
  • package.json: add the missing dev:web script + iii-web bin. Also backfill the identical gap for provider-llamacpp (it was in the composite array but had no dev:/iii- entry either).
  • tests/composite-manifest.test.ts (new): regression guard asserting every runnable worker folder (src/*/main.ts) is wired into (a) the composite --manifest, (b) a dev:<name> script, and (c) an iii-<name> bin. This is the check that was missing — per-folder tests existed, but nothing verified composite wiring.

Root cause

#202's diff touched only src/web/* and tests/web/*; src/index.ts was last modified in #195, before the web worker existed. The WORKERS array is a hardcoded list, so any new worker folder must be added manually — and there was no test catching the omission.

Test plan

  • pnpm test — 1033 passing (121 files), including the new composite-manifest test
  • pnpm run typecheck — clean
  • Verified the regression test fails without the fix (flags exactly web and provider-llamacpp) and passes with it
  • bun src/index.ts --manifest lists web

Note: pnpm lint currently fails on a pre-existing biome.json config error (an unrecognized actions key under biome 1.9.4) unrelated to this change — not touched here.

Summary by CodeRabbit

  • New Features

    • Added development scripts for new provider and web components.
    • Added CLI tools for running new services.
  • Tests

    • Added test suite validating system configuration and worker registration consistency.

Review Change Stack

The web::fetch worker (#202) shipped its own files and standalone
main.ts but was never wired into src/index.ts, so `pnpm dev:all` and
`start:all` (which run the composite all-in-one process) never started
it. Add the registration so the worker boots with the rest.

Also backfill the missing dev:web / iii-web wiring in package.json, plus
the same gap for provider-llamacpp, and add a regression test asserting
every runnable worker folder (src/*/main.ts) is wired into the composite
manifest, dev scripts, and bin entries.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workers Ready Ready Preview, Comment May 29, 2026 5:21pm

Request Review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

📝 Walkthrough

Walkthrough

This PR integrates a new web worker into the composite harness by registering it in the main entry point, exposing it through npm dev scripts and CLI binaries in package.json, and adding regression tests to validate the wiring consistency across all three areas.

Changes

Web Worker Integration

Layer / File(s) Summary
Web worker registration in composite entry point
harness/src/index.ts
Imports registerWeb from the web module and adds a web worker definition to the composite WORKERS array, enabling the harness to manage its lifecycle and include it in manifest output.
Package.json scripts and CLI binaries
harness/package.json
Adds dev:provider-llamacpp and dev:web npm scripts and corresponding iii-provider-llamacpp and iii-web CLI executables to expose workers as runnable commands.
Composite manifest wiring validation
harness/tests/composite-manifest.test.ts
Implements test suite that scans for runnable worker folders and validates that each is registered in the composite manifest, has a corresponding dev:<name> script, and has a corresponding iii-<name> bin entry in package.json.

🎯 2 (Simple) | ⏱️ ~10 minutes

A web worker hops into the harness today,
Scripts and bins in perfect array,
Tests ensure nothing goes astray,
Integration flows in every way! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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: registering the web worker in the composite entry point, which is the primary objective of the PR.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/harness-register-web-worker

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 and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

skill-check — worker

0 verified, 13 skipped (no docs/).

Layer Result
structure
vale
ai
render

Note

17 stale rendered artifact(s) detected on main, unrelated to this PR. This PR is fine; the drift was already there. A maintainer should open a chore PR to re-render these.

  • shell/README.md
  • shell/skill.md
  • shell/skills/chmod.md
  • shell/skills/exec.md
  • shell/skills/exec_bg.md
  • shell/skills/grep.md
  • shell/skills/kill.md
  • shell/skills/list.md
  • shell/skills/ls.md
  • shell/skills/mkdir.md
  • shell/skills/mv.md
  • shell/skills/read.md
  • …and 5 more (see the workflow logs)

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
harness/tests/composite-manifest.test.ts (1)

32-36: ⚡ Quick win

Guard the synchronous tsx spawn against Vitest’s default 5s timeout

compositeManifestNames() runs execFileSync(tsxBin, [indexEntry, '--manifest'], { encoding: 'utf8' }) (no timeout). With tsx cold-start/transpile, this can exceed Vitest’s default 5,000ms (Node.js) and make the “registers every runnable worker folder…” test flaky. Add an execFileSync timeout (and/or set a per-test timeout for that it(...) via it(name, { timeout: ... }, fn)).

♻️ Example: explicit timeouts
-function compositeManifestNames(): string[] {
-  const out = execFileSync(tsxBin, [indexEntry, '--manifest'], { encoding: 'utf8' });
+function compositeManifestNames(): string[] {
+  const out = execFileSync(tsxBin, [indexEntry, '--manifest'], {
+    encoding: 'utf8',
+    timeout: 20_000,
+  });
   const manifest = JSON.parse(out) as Array<{ name: string }>;
   return manifest.map((w) => w.name).sort();
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@harness/tests/composite-manifest.test.ts` around lines 32 - 36, The
synchronous spawn in compositeManifestNames() currently calls
execFileSync(tsxBin, [indexEntry, '--manifest'], { encoding: 'utf8' }) with no
timeout and can exceed Vitest's 5s default; fix by adding a timeout option to
that execFileSync call (e.g., include timeout: 30000 in the options object)
and/or set a per-test timeout on the Vitest it(...) that uses
compositeManifestNames (e.g., it(name, { timeout: 30000 }, ...)), referencing
compositeManifestNames, execFileSync, tsxBin and indexEntry so the change is
made where the manifest is spawned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@harness/tests/composite-manifest.test.ts`:
- Around line 32-36: The synchronous spawn in compositeManifestNames() currently
calls execFileSync(tsxBin, [indexEntry, '--manifest'], { encoding: 'utf8' })
with no timeout and can exceed Vitest's 5s default; fix by adding a timeout
option to that execFileSync call (e.g., include timeout: 30000 in the options
object) and/or set a per-test timeout on the Vitest it(...) that uses
compositeManifestNames (e.g., it(name, { timeout: 30000 }, ...)), referencing
compositeManifestNames, execFileSync, tsxBin and indexEntry so the change is
made where the manifest is spawned.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bb2a19fa-644e-431f-9d3b-4d65f8ae7334

📥 Commits

Reviewing files that changed from the base of the PR and between 974dde3 and 00f9fc4.

📒 Files selected for processing (3)
  • harness/package.json
  • harness/src/index.ts
  • harness/tests/composite-manifest.test.ts

@andersonleal andersonleal merged commit 4c02d40 into main May 29, 2026
14 checks passed
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.

2 participants