fix(plugins): export waitForAbortSignal from plugin-sdk#30059
fix(plugins): export waitForAbortSignal from plugin-sdk#30059kevinWangSheng wants to merge 8 commits intoopenclaw:mainfrom
Conversation
Add allowMissingTarget option to assertPathSafety for write, mkdirp, and rename operations. This fixes the regression where creating new files fails with 'cannot create directories' error, even when the workspace has rw access. The issue occurs because assertPathSafety was checking for file existence before allowing directory creation, but for new files the parent directory may not have the target file yet. Fixes openclaw#28734
Add allowMissingTarget option to assertPathSafety for write, mkdirp, and rename operations. This fixes the regression where creating new files fails with 'cannot create directories' error, even when the workspace has rw access. The issue occurs because assertPathSafety was checking for file existence before allowing directory creation, but for new files the parent directory may not have the target file yet. Fixes openclaw#28734
Export waitForAbortSignal from the plugin SDK so extensions can import it from 'openclaw/plugin-sdk' instead of using a relative path that breaks in the built project. Fixes openclaw#30057
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6c4053650c
ℹ️ 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".
| * Response behavior when an unpaired (unauthorized) user sends a message. | ||
| * @default "silent" | ||
| */ | ||
| unpairedResponse?: UnpairedResponseMode; |
There was a problem hiding this comment.
Register unpairedResponse in config validation schemas
channels.defaults.unpairedResponse is added to the public config types here, but the runtime validator still rejects it: ChannelsSchema.defaults is .strict() and only permits groupPolicy/heartbeat in src/config/zod-schema.providers.ts:27-33. In practice, any user who sets unpairedResponse in their config will fail loadConfig with an unknown-key validation error, so the new behavior cannot be enabled in real deployments.
Useful? React with 👍 / 👎.
| code, | ||
| mode: getUnpairedResponseMode(cfg), | ||
| }) | ||
| : "Pairing already requested. Ask the bot owner to approve your code."; |
There was a problem hiding this comment.
Respect silent mode for repeat Discord pairing requests
When dmPolicy is pairing and a request already exists (created === false), this branch hardcodes a non-null reply string, so the later responseText !== null guard still sends a message even if unpaired response mode is silent. That means unauthorized users who message twice will still get a response, which breaks the documented "do not respond" behavior for silent mode.
Useful? React with 👍 / 👎.
| const dmAuthorized = await enforceTelegramDmAccess({ | ||
| isGroup: event.isGroup, | ||
| dmPolicy, | ||
| unpairedResponse: getUnpairedResponseMode(loadConfig()), |
There was a problem hiding this comment.
Honor Telegram account unpairedResponse overrides
The Telegram account type now exposes unpairedResponse, but this call site always passes getUnpairedResponseMode(loadConfig()), and that helper only reads cfg.channels.defaults.unpairedResponse (src/pairing/unpaired-response.ts:9-10). As a result, channels.telegram.accounts.<id>.unpairedResponse is never used, so per-account overrides silently do nothing.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR exports What's included (but not mentioned in PR description):
Issues Found:
Verification:
Confidence Score: 3/5
Last reviewed commit: 6c40536 |
| const dmAuthorized = await enforceTelegramDmAccess({ | ||
| isGroup: event.isGroup, | ||
| dmPolicy, | ||
| unpairedResponse: getUnpairedResponseMode(loadConfig()), |
There was a problem hiding this comment.
Account-level unpairedResponse override not being used. The code should check telegramCfg.unpairedResponse first before falling back to the global default, similar to how dmPolicy is handled on line 616:
| unpairedResponse: getUnpairedResponseMode(loadConfig()), | |
| unpairedResponse: telegramCfg.unpairedResponse ?? getUnpairedResponseMode(loadConfig()), |
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/telegram/bot-handlers.ts
Line: 1371
Comment:
Account-level `unpairedResponse` override not being used. The code should check `telegramCfg.unpairedResponse` first before falling back to the global default, similar to how `dmPolicy` is handled on line 616:
```suggestion
unpairedResponse: telegramCfg.unpairedResponse ?? getUnpairedResponseMode(loadConfig()),
```
How can I resolve this? If you propose a fix, please make it concise.| !(await enforceTelegramDmAccess({ | ||
| isGroup, | ||
| dmPolicy, | ||
| unpairedResponse: getUnpairedResponseMode(loadConfig()), |
There was a problem hiding this comment.
Account-level unpairedResponse override not implemented here. The Telegram config type defines this field with fallback to global defaults, but this function doesn't have access to the telegram account config to check the account-level setting. Consider passing telegramCfg to this function to support the account-level override.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/telegram/bot-message-context.ts
Line: 281
Comment:
Account-level `unpairedResponse` override not implemented here. The Telegram config type defines this field with fallback to global defaults, but this function doesn't have access to the telegram account config to check the account-level setting. Consider passing `telegramCfg` to this function to support the account-level override.
How can I resolve this? If you propose a fix, please make it concise.|
This pull request has been automatically marked as stale due to inactivity. |
Summary
waitForAbortSignalfrom the plugin SDK so extensions can import it fromopenclaw/plugin-sdkinstead of using a relative path that breaks in the built project.Fixes #30057
Problem
The nextcloud-talk extension fails when using the built version because it imports
waitForAbortSignalfrom a relative path that doesn't exist in the compiled output:Changes
src/plugin-sdk/index.ts— ExportwaitForAbortSignalfrom../infra/abort-signal.jsextensions/nextcloud-talk/src/channel.ts— ImportwaitForAbortSignalfromopenclaw/plugin-sdkinstead of the relative pathTest plan