Skip to content

[0.9.1] apply() runs on an inactive fiber — every effect-creating call throws cannot create effect on inactive context #535

Description

@gogoashan-bot

中文摘要:DSH Desktop 0.9.1(core 0.1.5-rc.2)上,第三方外掛的 apply() 執行時 fiber 已是 inactive 狀態,導致 ctx.on / ctx.inject / ctx.tools.register / ctx.effect 全部被 Fiber.assertActive 拒絕。外掛靜默失效,宿主不中斷。0.6.3 上無此問題。


Environment

Item Value
DSH Desktop 0.9.1 (Windows 10/11 x64)
Harness core (@deepseek-ai/*) 0.1.5-rc.2
@deepseek-ai/cordis 4.0.2
Node v24.9.0
Previous working version 0.6.3 (core 0.1.1-rc.2)
Profile web
Onset Immediately after updating 0.6.3 → 0.9.1

Summary

On every launch of the web profile, several third-party plugins fail their apply() with:

Error: cannot create effect on inactive context

The thrown frames are always inside cordis:

at Fiber.assertActive (…/@deepseek-ai/cordis/lib/index.js:1132:9)
at Proxy.on            (…/@deepseek-ai/cordis/lib/index.js:373:18)   // ctx.on(...)

and the same happens for ctx.inject(...), ctx.tools.register(...), ctx.effect(...).

The plugin's own fiber is already inactive while its apply() is running.

Impact

  • Affected plugins load but register nothing — silent, complete loss of function.
  • dsh-vision-router (never modified by the reporter) loses all vision routing.
  • dsh-context loses tool attribution.
  • @liustack/modlens loses its modlens_read_image tool.
  • dsh-my-guardian also cannot initialise and says so explicitly.

Each boot emits 12 × cannot create effect on inactive context.

Reproduction

  1. Fresh DSH Desktop 0.9.1 on Windows.
  2. Launch the web profile containing third-party plugins.
  3. Observe %APPDATA%\dsh-desktop\logs\harness.log:
[2026-09-23T05:04:54.482Z] +6125ms [stderr] [modlens] modlens_read_image registration skipped:
                                              Error: cannot create effect on inactive context
[2026-09-23T05:04:54.485Z] +6128ms [stderr] [harness-log] error dsh-context:
                                              Error: cannot create effect on inactive context
[2026-09-23T05:04:54.485Z] +6128ms [stderr] [harness-log]       at Fiber.assertActive
                                              (…/@deepseek-ai/cordis/lib/index.js:1132:9)
[2026-09-23T05:04:54.485Z] +6128ms [stderr] [harness-log]       at Proxy.on
                                              (…/@deepseek-ai/cordis/lib/index.js:373:18)
[2026-09-23T05:04:54.485Z] +6128ms [stderr] [harness-log]       at createToolAttribution
                                              (…/dsh-context/lib/index.js:2045:6)
[2026-09-23T05:04:54.485Z] +6128ms [stderr] [harness-log]       at new apply
                                              (…/dsh-context/lib/index.js:3458:22)
[2026-09-23T05:04:54.485Z] +6128ms [stderr] [harness-log]       at Fiber.execute
                                              (…/@deepseek-ai/cordis/lib/index.js:1067:24)
[2026-09-23T05:04:54.485Z] +6128ms [stderr] [harness-log]       at file:///…/profiles/web/#dsh-context
[2026-09-23T05:04:54.485Z] +6128ms [stderr] [harness-log]       at file:///…/profiles/web/#include

Also emitted on every boot:

warn hmr: Error: failed to apply loader entry dsh-context (dsh-context): cannot create effect on inactive context
warn hmr: Error: failed to apply loader entry vision-router (dsh-vision-router): cannot create effect on inactive context
warn root: [dsh-my-guardian] loader/timer 服务尚未就绪 — guardian 等待局部 inject;本次 apply 暂不初始化(不 fatal)

Expected

A plugin's apply() should run on an active fiber, so that ctx.on / ctx.inject / ctx.tools.register create their effects normally. Registering a service consumer during apply must not be refused.

Hypotheses already tested and falsified (please skip these)

I spent significant effort ruling these out. None of them changed the outcome:

# Hypothesis How it was falsified
1 Plugin-specific bug in @liustack/modlens dsh-vision-router — never modified — fails identically
2 .generations-deferred.json blocking the generation migration The error first appeared at 02:59:26; the deferred file was first written at 04:45:18 — an hour later
3 The tool-registration call site itself Wrapping it changed the error's line number but not the outcome — it is a symptom
4 Third-party bundles disabling core rows (id: workspace, `id: ui-sidebar``, …) Removing the two offending bundles made patch: entry ui-settings-unarchive-sessions not found go to 0, but the inactive-context errors were unchanged
5 plugin node_modules entries being junctions into .generations/live/ vs. real directories Intervention test: replaced the junctions with real directories (verified byte-for-byte preservation of the generation targets). Result was identical, item for item
6 Duplicate loader entry ids / double mounting No real duplicates; every plugin appears exactly once in dsh.profile.bundles; no insert: in the profile patch
7 Generation closure bundling a second copy of @deepseek-ai/cordis The generation's node_modules contains no @deepseek-ai packages at all
8 timer service missing It is a readiness-timing message, not a missing service; cordis-plugin-timer is present in core

Intervention experiments 4 and 5 are the important ones: changing the hypothesised cause did not change the symptom at all. This strongly suggests the cause is inside cordis's fiber lifecycle during the bundle/plugin tree apply, not in any plugin or profile configuration.

Request

Please confirm whether include / bundle rows on 0.1.5-rc.2 are meant to apply plugins on a fiber that is still active, and whether the loader expects ctx.inject during a bundle apply to be deferred rather than refused.

Happy to provide the full harness.log, the profile's package.json / cordis.patch.yml, or to run any instrumented build you suggest.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions