Skip to content

fix(file-transfer): share the workspace command module import - #192382

Closed
RomneyDa wants to merge 1 commit into
mainfrom
fix/forward-port-1010-file-transfer
Closed

RomneyDa wants to merge 1 commit into
mainfrom
fix/forward-port-1010-file-transfer

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Nov 3, 2026

Copy link
Copy Markdown
Member

Problem

Concurrent memory and skills commands can race while importing the same workspace command module.

Solution

Use the existing SDK createLazyRuntimeModule owner for one shared import. No new loader or public API.

Independent split of #191830, directly against main; no sibling PR is required. Original release provenance is preserved in commit bodies. Scope excludes every other forward-port group.

Evidence

  • Original proof limitation retained: Vitest module caching cannot reproduce the loader race. Combined branch core and extension typechecks passed.
  • Product/test changes cherry-picked cleanly; original evidence is retained evidence, not a new split-head run.
  • Focused split-head validation and local review are in progress; this PR remains draft until the results are recorded.
  • Broad type/build/CI coverage is delegated to PR CI.

Reviewed candidate: 981ff366df913e6ce7509bed02349f80c41eccb5.

… and skills

The first turn invokes workspace.memory and workspace.skills together, and
both handlers lazily imported the same node-host module. When the plugin
loads from TypeScript source, two concurrent on-demand imports of that
module can race: the second caller received it before its imports were
bound and failed with "Cannot read properties of undefined (reading
'readWorkspaceSkillsRequest')". Built dist output uses static chunk
imports and is unaffected.

Load the module once through the SDK lazy-runtime loader. Unlike the
release-line helper, a rejected load stays cached (createLazyRuntimeModule
semantics); a bundled local module that fails to import fails permanently
anyway. The loader-level race remains a follow-up.

Forward-port of d562323 from release/2026.10.10.
@clawsweeper

clawsweeper Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@RomneyDa

RomneyDa commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Closing this split as already fixed on main by #174252 (515b3c409583b17f942260767bb6be51640fe355). The existing plugin source loader caches each dynamic-import promise before evaluation and isolates legacy transform caches under settled-imports.

Independent verification traced both plugin loaders to that owner and ran the preserved settles concurrent first imports regression: 2/2 passed (cold and legacy-cache), with the loader and file-transfer sources unchanged from main 34007820fa2c. The proposed plugin-local cache is therefore redundant and is omitted from the #191830 split campaign. No branch deletion or merge.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant