examples/cli/src/bootstrap.ts:85 awaits options.registerTasks?.() and then, at :99-101 and :110-115, replaces the global model repository and the HFT provider outright. setGlobalModelRepository is registry.registerInstance(MODEL_REPOSITORY, …) (packages/ai/src/model/ModelRegistry.ts:40), and AiProvider.register() (packages/ai/src/provider/AiProvider.ts:205-214) unregisters and terminates any prior worker before re-registering. So a downstream that registers models or a provider in the hook loses them, silently.
Reproduced on @workglow/sec's sec-base: bun src/libs-cli.ts model list → No models found., while probing bootstrapSecRuntime() directly gives size: 3 including claude-sonnet-5. Every AI task in sec-base therefore resolves no model.
The HFT half is worse because it is order-dependent rather than absolute. sec registers a worker that applies patchHftChatTemplateGenerationTags (transformers.js 4.2.0 bundles jinja 0.5.6, which throws Unknown statement type: generation). sec-base registers it in the hook and libs overwrites it; embarc-data-base registers it in a preAction hook and it survives. Verified by dumping WorkerManager.workerFactories before and after. Two binaries, opposite results, decided purely by hook ordering.
Fix: hoist both registrations above the hook, or give them registerIfAbsent semantics. Add a test that runs runWorkglowCli with a hook registering one model and one worker-backed provider and asserts both are still present after boot — there is currently no test that exercises the hook at all.
Found during the 2026-08-24 review. Snapshot: workglow-dev/prd → analysis/grades/2026-08-24/cross-repo-integration.md.
examples/cli/src/bootstrap.ts:85awaitsoptions.registerTasks?.()and then, at:99-101and:110-115, replaces the global model repository and the HFT provider outright.setGlobalModelRepositoryisregistry.registerInstance(MODEL_REPOSITORY, …)(packages/ai/src/model/ModelRegistry.ts:40), andAiProvider.register()(packages/ai/src/provider/AiProvider.ts:205-214) unregisters and terminates any prior worker before re-registering. So a downstream that registers models or a provider in the hook loses them, silently.Reproduced on
@workglow/sec'ssec-base:bun src/libs-cli.ts model list→No models found., while probingbootstrapSecRuntime()directly givessize: 3includingclaude-sonnet-5. Every AI task insec-basetherefore resolves no model.The HFT half is worse because it is order-dependent rather than absolute. sec registers a worker that applies
patchHftChatTemplateGenerationTags(transformers.js 4.2.0 bundles jinja 0.5.6, which throwsUnknown statement type: generation).sec-baseregisters it in the hook and libs overwrites it;embarc-data-baseregisters it in apreActionhook and it survives. Verified by dumpingWorkerManager.workerFactoriesbefore and after. Two binaries, opposite results, decided purely by hook ordering.Fix: hoist both registrations above the hook, or give them
registerIfAbsentsemantics. Add a test that runsrunWorkglowCliwith a hook registering one model and one worker-backed provider and asserts both are still present after boot — there is currently no test that exercises the hook at all.Found during the 2026-08-24 review. Snapshot:
workglow-dev/prd→analysis/grades/2026-08-24/cross-repo-integration.md.