Skip to content

fix(build): add missing keyed-async-queue entry to tsdown config#32901

Closed
efe-arv wants to merge 1 commit into
openclaw:mainfrom
efe-arv:fix/matrix-keyed-async-queue
Closed

fix(build): add missing keyed-async-queue entry to tsdown config#32901
efe-arv wants to merge 1 commit into
openclaw:mainfrom
efe-arv:fix/matrix-keyed-async-queue

Conversation

@efe-arv

@efe-arv efe-arv commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The bundled Matrix plugin fails to load because a declared package export has no corresponding build output.

Root Cause

package.json exports map declares ./plugin-sdk/keyed-async-queue pointing to dist/plugin-sdk/keyed-async-queue.{js,d.ts}, but tsdown.config.ts doesn't include keyed-async-queue.ts as a build entry — so the files are never generated.

The Matrix plugin's send-queue.ts imports KeyedAsyncQueue from this subpath (correctly per the exports map), but fails at runtime:

Cannot find module '.../dist/plugin-sdk/keyed-async-queue'

Fix

Add one entry block to tsdown.config.ts — identical pattern to the existing account-id.ts entry:

{
  entry: "src/plugin-sdk/keyed-async-queue.ts",
  outDir: "dist/plugin-sdk",
  env,
  fixedExtension: false,
  platform: "node",
},

Files Changed

  • tsdown.config.ts — 7 lines added (1 new entry block)

Testing

  • Verified on 3 separate machines (Linux x64, Linux Mint, SteamOS/Steam Deck)
  • 6 Matrix accounts across 2 OpenClaw instances responding correctly after fix
  • Multi-account routing (different bot identities per room) working
  • Cross-machine communication via Tailscale mesh verified

Notes

  • Source file src/plugin-sdk/keyed-async-queue.ts already exists with tests
  • vitest.config.ts already has an alias for this module
  • The account-id subpath follows the exact same pattern and works correctly
  • This is simply a missing build entry — code, tests, and exports map are all already correct

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: baaa22a16a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread tsdown.config.ts
platform: "node",
},
{
entry: "src/plugin-sdk/keyed-async-queue.ts",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove unresolved entrypoint from build config

Adding src/plugin-sdk/keyed-async-queue.ts as a direct tsdown entry breaks the build because that source file is not present in this commit, so tsdown cannot resolve the entry when pnpm build (or tsdown) runs. This makes the change regress from a successful build to a deterministic build failure until the file is added or the entry is removed.

Useful? React with 👍 / 👎.

@efe-arv

efe-arv commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

@chatgpt-codex-connector The source file src/plugin-sdk/keyed-async-queue.ts exists on upstream main — it was added in a prior commit. This PR's base is openclaw:main, not the fork's stale main.

You can verify:

gh api repos/openclaw/openclaw/contents/src/plugin-sdk/keyed-async-queue.ts --jq '.name'
# → keyed-async-queue.ts

The fork's main is behind upstream (can't sync via API due to workflow scope limitation), but the PR diff is correct — it only adds the tsdown entry block for a source file that already exists with tests and a vitest alias.

The account-id.ts entry in the same config follows the identical pattern and works correctly.

All CI checks pass, including build-artifacts — confirming the build succeeds with this change. Please re-review against the upstream base.

@greptile-apps

greptile-apps Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR attempts to fix a missing build output for a keyed-async-queue plugin-sdk subpath by adding an entry to tsdown.config.ts. However, the fix is incomplete and will break the build as submitted.

Critical issues:

  • Missing source file: src/plugin-sdk/keyed-async-queue.ts does not exist in the repository. The PR description claims it "already exists with tests", but the directory listing confirms it is absent. tsdown will fail when it cannot locate the entry point.
  • Missing package.json exports map entry: The PR description states that package.json already declares ./plugin-sdk/keyed-async-queue, but the actual file only exports ".", "./plugin-sdk", "./plugin-sdk/account-id", and "./cli-entry". Without an exports map entry, Node.js will refuse the subpath import regardless of whether the dist/ file is generated.
  • Missing vitest alias: The PR description mentions that vitest.config.ts already has an alias for this module — it does not. Only openclaw/plugin-sdk and openclaw/plugin-sdk/account-id are aliased.
  • No actual consumer: A repository-wide search finds only this one tsdown.config.ts line. The Matrix plugin send-queue.ts the description references does not import from this subpath.

Confidence Score: 0/5

  • This PR will break the build due to a missing source file and incomplete configuration.
  • The PR adds a build entry for src/plugin-sdk/keyed-async-queue.ts which does not exist in the repository. When tsdown attempts to build this missing entry, the entire build will fail. Additionally, the supporting infrastructure (exports map entry and vitest alias) that would be needed to make this subpath import work are missing, and there is currently no consumer code using this module. The PR claims all these pieces already exist, but verification shows they do not.
  • tsdown.config.ts requires critical fixes before this PR can be merged: the referenced source file must be added, the package.json exports map must be updated, and the vitest configuration must be extended.

Last reviewed commit: baaa22a

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 file reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment thread tsdown.config.ts
platform: "node",
},
{
entry: "src/plugin-sdk/keyed-async-queue.ts",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Source file does not exist — build will fail

The entry "src/plugin-sdk/keyed-async-queue.ts" does not exist in the repository. A listing of src/plugin-sdk/ confirms that keyed-async-queue.ts is absent. Adding this build entry will cause tsdown to error out when it cannot find the source file, breaking the entire build.

The PR description states "Source file src/plugin-sdk/keyed-async-queue.ts already exists with tests", but this is not accurate based on the current state of the repository. The source file (and any accompanying tests) must be committed alongside this config change for the fix to work.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tsdown.config.ts
Line: 48

Comment:
Source file does not exist — build will fail

The entry `"src/plugin-sdk/keyed-async-queue.ts"` does not exist in the repository. A listing of `src/plugin-sdk/` confirms that `keyed-async-queue.ts` is absent. Adding this build entry will cause `tsdown` to error out when it cannot find the source file, breaking the entire build.

The PR description states "Source file `src/plugin-sdk/keyed-async-queue.ts` already exists with tests", but this is not accurate based on the current state of the repository. The source file (and any accompanying tests) must be committed alongside this config change for the fix to work.

How can I resolve this? If you propose a fix, please make it concise.

Comment thread tsdown.config.ts
platform: "node",
},
{
entry: "src/plugin-sdk/keyed-async-queue.ts",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Source file does not exist — build will fail

The entry "src/plugin-sdk/keyed-async-queue.ts" references a file that does not exist in the repository. A check of src/plugin-sdk/ confirms that keyed-async-queue.ts is absent. When tsdown attempts to build this entry, it will error out and fail the entire build.

The PR description states "Source file src/plugin-sdk/keyed-async-queue.ts already exists with tests", but the current state of the repository does not include this file. The source file (and any accompanying tests) must be committed alongside this config change for the fix to work.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tsdown.config.ts
Line: 48

Comment:
**Source file does not exist — build will fail**

The entry `"src/plugin-sdk/keyed-async-queue.ts"` references a file that does not exist in the repository. A check of `src/plugin-sdk/` confirms that `keyed-async-queue.ts` is absent. When `tsdown` attempts to build this entry, it will error out and fail the entire build.

The PR description states "Source file `src/plugin-sdk/keyed-async-queue.ts` already exists with tests", but the current state of the repository does not include this file. The source file (and any accompanying tests) must be committed alongside this config change for the fix to work.

How can I resolve this? If you propose a fix, please make it concise.

Comment thread tsdown.config.ts
Comment on lines +47 to +53
{
entry: "src/plugin-sdk/keyed-async-queue.ts",
outDir: "dist/plugin-sdk",
env,
fixedExtension: false,
platform: "node",
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing package.json exports map entry and vitest alias

For this entry to be usable as a subpath import (e.g. import ... from "openclaw/plugin-sdk/keyed-async-queue"), two other pieces need to be in place that the PR description claims already exist but do not:

  1. package.json exports map — The current exports map only declares ".", "./plugin-sdk", "./plugin-sdk/account-id", and "./cli-entry". There is no "./plugin-sdk/keyed-async-queue" entry. Without it, Node.js will refuse the subpath import even after the build file is generated.

  2. vitest.config.ts alias — The config only contains aliases for "openclaw/plugin-sdk/account-id" and "openclaw/plugin-sdk". There is no alias for "openclaw/plugin-sdk/keyed-async-queue", so any tests that import from this subpath would fail under vitest.

Additionally, a repository-wide search finds that keyed-async-queue is referenced only in this tsdown.config.ts line added by this PR. The Matrix plugin send-queue.ts mentioned in the PR description does not actually import from this subpath. The fix as submitted is incomplete and will not resolve the described runtime error on its own.

Prompt To Fix With AI
This is a comment left during a code review.
Path: tsdown.config.ts
Line: 47-53

Comment:
**Missing `package.json` exports map entry and `vitest` alias**

For this entry to be usable as a subpath import (e.g. `import ... from "openclaw/plugin-sdk/keyed-async-queue"`), two other pieces need to be in place that the PR description claims already exist but do not:

1. **`package.json` exports map** — The current exports map only declares `"."`, `"./plugin-sdk"`, `"./plugin-sdk/account-id"`, and `"./cli-entry"`. There is no `"./plugin-sdk/keyed-async-queue"` entry. Without it, Node.js will refuse the subpath import even after the build file is generated.

2. **`vitest.config.ts` alias** — The config only contains aliases for `"openclaw/plugin-sdk/account-id"` and `"openclaw/plugin-sdk"`. There is no alias for `"openclaw/plugin-sdk/keyed-async-queue"`, so any tests that import from this subpath would fail under vitest.

Additionally, a repository-wide search finds that `keyed-async-queue` is referenced only in this `tsdown.config.ts` line added by this PR. The Matrix plugin `send-queue.ts` mentioned in the PR description does not actually import from this subpath. The fix as submitted is incomplete and will not resolve the described runtime error on its own.

How can I resolve this? If you propose a fix, please make it concise.

@efe-arv

efe-arv commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

@greptile-apps Same clarification as above — src/plugin-sdk/keyed-async-queue.ts exists on openclaw:main (the PR base). Both bots appear to be checking the fork's stale main which is behind upstream.

Proof:

  • File exists: gh api repos/openclaw/openclaw/contents/src/plugin-sdk/keyed-async-queue.ts
  • It has tests: src/plugin-sdk/keyed-async-queue.test.ts
  • vitest already aliases it: vitest.config.ts
  • build-artifacts CI check: passed
  • install-smoke CI check: passed

The .d.ts generation is handled by tsdown automatically (same as account-id.ts which follows the identical pattern).

All 14 CI checks green. No build breakage.

@greptile-apps

greptile-apps Bot commented Mar 3, 2026

Copy link
Copy Markdown
Contributor

You're absolutely right. I apologize for the incorrect review comments.

I've now verified against openclaw:main (the PR base):

Source file exists: src/plugin-sdk/keyed-async-queue.ts
Exports map configured: package.json line 40-43
vitest alias configured: vitest.config.ts line 17-20
CI checks passed: All 14 checks green

The previous comments were based on checking the wrong branch. Your PR is correct - it's simply adding the missing tsdown build entry to match the already-declared export. This is a valid fix for the runtime module resolution error you described.

Thank you for the clarification and for providing the evidence. The PR looks good to merge.

@efe-arv

efe-arv commented Mar 3, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of a comprehensive Matrix multi-account + security hardening PR that includes this fix alongside 7 others.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant