feat: plugin-provided session store adapter#3
Closed
davidrudduck wants to merge 1078 commits intomainfrom
Closed
Conversation
…allback The cron delivery path short-circuits with an error when `toCandidate` is falsy (line 151), before reaching `resolveOutboundTarget()` which provides the `plugin.config.resolveDefaultTo()` fallback. The direct send path in `targets.ts` already uses this fallback correctly. Remove the early `!toCandidate` exit so that `resolveOutboundTarget()` can attempt the plugin-provided default. Guard the WhatsApp allowFrom override against falsy `toCandidate` to maintain existing behavior when a target IS resolved. Fixes openclaw#32355 Signed-off-by: HCL <[email protected]>
… at lifecycle start When the Discord gateway completes its READY handshake before `runDiscordGatewayLifecycle` registers its debug event listener, the initial "WebSocket connection opened" event is missed. This leaves `connected` as undefined in the channel runtime, causing the health monitor to treat the channel as "stuck" and restart it every check cycle. Check `gateway.isConnected` immediately after registering the debug listener and push the initial connected status if the gateway is already connected. Co-Authored-By: Claude Opus 4.6 <[email protected]>
When abortSignal is already aborted at lifecycle start, onAbort() fires synchronously and pushes connected: false. Without a lifecycleStopping guard, the subsequent gateway.isConnected check could push a spurious connected: true, contradicting the shutdown. Adds !lifecycleStopping to the isConnected guard and a test verifying no connected: true is emitted when the signal is pre-aborted. Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ication spam (openclaw#31580) * fix(feishu): skip typing indicator keepalive re-adds to prevent notification spam The typing keepalive loop calls addTypingIndicator() every 3 seconds, which creates a new messageReaction.create API call each time. Feishu treats each re-add as a new reaction event and fires a push notification, causing users to receive repeated notifications while waiting for a response. Unlike Telegram/Discord where typing status expires after a few seconds, Feishu reactions persist until explicitly removed. Skip the keepalive re-add when a reaction already exists (reactionId is set) since there is no need to refresh it. Closes openclaw#28660 * Changelog: note Feishu typing keepalive suppression --------- Co-authored-by: yuxh1996 <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
- Pass gfm:true + breaks:true explicitly to marked.parse() so table support is guaranteed even if global setOptions() is bypassed or reset by a future refactor (defense-in-depth) - Add display:block + overflow-x:auto to .chat-text table so wide multi-column tables scroll horizontally instead of being clipped by the parent overflow-x:hidden chat container - Add regression tests for GFM table rendering in markdown.test.ts
Take the safe, tested subset from openclaw#32367:\n- per-channel startup connect grace in health monitor\n- tool-context channel-provider fallback for message actions\n\nCo-authored-by: Munem Hashmi <[email protected]>
…w#32360) * Plugin SDK: add run and tool call fields to tool hooks * Agents: propagate runId and toolCallId in before_tool_call * Agents: thread runId through tool wrapper context * Runner: pass runId into tool hook context * Compaction: pass runId into tool hook context * Agents: scope after_tool_call start data by run * Tests: cover run and tool IDs in before_tool_call hooks * Tests: add run-scoped after_tool_call collision coverage * Hooks: scope adjusted tool params by run * Tests: cover run-scoped adjusted param collisions * Hooks: preserve active tool start metadata until end * Changelog: add tool-hook correlation note
…gins ## Overview This PR enables external channel plugins (loaded via Plugin SDK) to access advanced runtime features like AI response dispatching, which were previously only available to built-in channels. ## Changes ### src/gateway/server-channels.ts - Import PluginRuntime type - Add optional channelRuntime parameter to ChannelManagerOptions - Pass channelRuntime to channel startAccount calls via conditional spread - Ensures backward compatibility (field is optional) ### src/gateway/server.impl.ts - Import createPluginRuntime from plugins/runtime - Create and pass channelRuntime to channel manager ### src/channels/plugins/types.adapters.ts - Import PluginRuntime type - Add comprehensive documentation for channelRuntime field - Document available features, use cases, and examples - Improve type safety (use imported PluginRuntime type vs inline import) ## Benefits External channel plugins can now: - Generate AI-powered responses using dispatchReplyWithBufferedBlockDispatcher - Access routing, text processing, and session management utilities - Use command authorization and group policy resolution - Maintain feature parity with built-in channels ## Backward Compatibility - channelRuntime field is optional in ChannelGatewayContext - Conditional spread ensures it's only passed when explicitly provided - Existing channels without channelRuntime support continue to work unchanged - No breaking changes to channel plugin API ## Testing - Email channel plugin successfully uses channelRuntime for AI responses - All existing built-in channels (slack, discord, telegram, etc.) work unchanged - Gateway loads and runs without errors when channelRuntime is provided
* Feishu: cache failing probes * Changelog: add Feishu probe failure backoff note --------- Co-authored-by: bmendonca3 <[email protected]> Co-authored-by: Tak Hoffman <[email protected]>
Merged via squash. Prepared head SHA: 612ecc0 Co-authored-by: Mylszd <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
…ng truncation (openclaw#20076) Merged via squash. Prepared head SHA: 6edebf2 Co-authored-by: jlwestsr <[email protected]> Co-authored-by: jalehman <[email protected]> Reviewed-by: @jalehman
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: da2f8f6 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: b99ad80 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 9917165 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
…law#33032) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: f77e3d7 Co-authored-by: mbelinky <[email protected]> Co-authored-by: mbelinky <[email protected]> Reviewed-by: @mbelinky
…eaks (openclaw#33169) * fix: stabilize telegram draft stream message boundaries * fix: suppress NO_REPLY lead-fragment leaks * fix: keep underscore guard for non-NO_REPLY prefixes * fix: skip assistant-start rotation only after real lane rotation * fix: preserve finalized state when pre-rotation does not force * fix: reset finalized preview state on message-start boundary * fix: document Telegram draft boundary + NO_REPLY reliability updates (openclaw#33169) (thanks @obviyus)
Extends the plugin API with registerSessionStoreAdapter(), allowing plugins to provide custom session store backends (Redis, DynamoDB, etc.). When session.storeAdapter is "plugin", reads are served from the plugin adapter and writes go to both the plugin adapter and filesystem. The adapter is activated during gateway boot after plugins load. Adds optional toRecord() and warmCache() to SessionStoreAdapter for efficient bulk reads and pre-population on activation.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review infoConfiguration used: Organization UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (299)
📝 WalkthroughWalkthroughBroad multi-platform refactor adding OpenClawKit utilities and migrating platform code to shared helpers; expands gateway discovery (incl. Tailscale Serve), keychain migrations, UI componentization, CI/workflow/cache tuning, Docker/compose enhancements with healthchecks and sandbox wiring, extensive Android/iOS/macOS app updates, and wide documentation refresh. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor App as macOS App
participant GDM as GatewayDiscoveryModel
participant TS as TailscaleServeGatewayDiscovery
participant TSCLI as Tailscale CLI
participant Host as Candidate Host
App->>GDM: refreshRemoteFallbackNow()
GDM->>TS: discover(timeout)
TS->>TSCLI: tailscale status (exec)
TSCLI-->>TS: JSON status
loop candidates
TS->>Host: WS probe (timeout)
Host-->>TS: connect.challenge or timeout
end
TS-->>GDM: Beacons (reachable)
GDM->>GDM: Map/Dedupe/Combine results
GDM-->>App: Updated discovered gateways
Estimated code review effort🎯 5 (Critical) | ⏱️ ~150 minutes Possibly related PRs
✨ Finishing Touches
🧪 Generate unit tests (beta)
|
Owner
Author
|
Recreating — base branch was out of sync |
davidrudduck
pushed a commit
that referenced
this pull request
Mar 31, 2026
* feat: add QQ Bot channel extension * fix(qqbot): add setupWizard to runtime plugin for onboard re-entry * fix: fix review * fix: fix review * chore: sync lockfile and config-docs baseline for qqbot extension * refactor: 移除图床服务器相关代码 * fix * docs: 新增 QQ Bot 插件文档并修正链接路径 * refactor: remove credential backup functionality and update setup logic - Deleted the credential backup module to streamline the codebase. - Updated the setup surface to handle client secrets more robustly, allowing for configured secret inputs. - Simplified slash commands by removing unused hot upgrade compatibility checks and related functions. - Adjusted types to use SecretInput for client secrets in QQBot configuration. - Modified bundled plugin metadata to allow additional properties in the config schema. * feat: 添加本地媒体路径解析功能,修正 QQBot 媒体路径处理 * feat: 添加本地媒体路径解析功能,修正 QQBot 媒体路径处理 * feat: remove qqbot-media and qqbot-remind skills, add tests for config and setup - Deleted the qqbot-media and qqbot-remind skills documentation files. - Added unit tests for qqbot configuration and setup processes, ensuring proper handling of SecretRef-backed credentials and account configurations. - Implemented tests for local media path remapping, verifying correct resolution of media file paths. - Removed obsolete channel and remind tools, streamlining the codebase. * feat: 更新 QQBot 配置模式,添加音频格式和账户定义 * feat: 添加 QQBot 频道管理和定时提醒技能,更新媒体路径解析功能 * fix * feat: 添加 /bot-upgrade 指令以查看 QQBot 插件升级指引 * feat: update reminder and qq channel skills * feat: 更新remind工具投递目标地址格式 * feat: Refactor QQBot payload handling and improve code documentation - Simplified and clarified the structure of payload interfaces for Cron reminders and media messages. - Enhanced the parsing function to provide clearer error messages and improved validation. - Updated platform utility functions for better cross-platform compatibility and clearer documentation. - Improved text parsing utilities for better readability and consistency in emoji representation. - Optimized upload cache management with clearer comments and reduced redundancy. - Integrated QQBot plugin into the bundled channel plugins and updated metadata for installation. * OK apps/macos/Sources/OpenClaw/HostEnvSecurityPolicy.generated.swift > [email protected] check:bundled-channel-config-metadata /Users/yuehuali/code/PR/openclaw > node --import tsx scripts/generate-bundled-channel-config-metadata.ts --check [bundled-channel-config-metadata] stale generated output at src/config/bundled-channel-config-metadata.generated.ts ELIFECYCLE Command failed with exit code 1. ELIFECYCLE Command failed with exit code 1. * feat: 添加 QQBot 渠道配置及相关账户设置 * fix(qqbot): resolve 14 high-priority bugs from PR openclaw#52986 review DM routing (7 fixes): - #1: DM slash-command replies use sendDmMessage(guildId) instead of sendC2CMessage(senderId) - #2: DM qualifiedTarget uses qqbot:dm:${guildId} instead of qqbot:c2c:${senderId} - #3: sendTextChunks adds DM branch - #4: sendMarkdownReply adds DM branch for text and Base64 images - #5: parseAndSendMediaTags maps DM to targetType:dm + guildId - #6: sendTextToTarget DM branch uses sendDmMessage; MessageTarget adds guildId field - #7: handleImage/Audio/Video/FilePayload add DM branches Other high-priority fixes: - #8: Fix sendC2CVoiceMessage/sendGroupVoiceMessage parameter misalignment - #9: broadcastMessage uses groupOpenid instead of member_openid for group users - #10: Unify KnownUser storage - proactive.ts delegates to known-users.ts - #11: Remove invalid recordKnownUser calls for guild/DM users - #12: sendGroupMessage uses sendAndNotify to trigger onMessageSent hook - #13: sendPhoto channel unsupported returns error field - #14: sendTextAfterMedia adds channel and dm branches Type fixes: - DeliverEventContext adds guildId field - MediaTargetContext.targetType adds dm variant - sendPlainTextReply imgMediaTarget adds DM branch * fix(qqbot): resolve 2 blockers + 7 medium-priority bugs from PR openclaw#52986 review Blocker-1: Remove unused dmPolicy config knob - dmPolicy was declared in schema/types/plugin.json but never consumed at runtime - Removed from config-schema.ts, types.ts, and openclaw.plugin.json - allowFrom remains active (already wired into framework command-auth) Blocker-2: Gate sensitive slash commands with allowFrom authorization - SlashCommand interface adds requireAuth?: boolean - SlashCommandContext adds commandAuthorized: boolean - /bot-logs set to requireAuth: true (reads local log files) - matchSlashCommand rejects unauthorized senders for requireAuth commands - trySlashCommandOrEnqueue computes commandAuthorized from allowFrom config Medium-priority fixes: - #15: Strip non-HTTP/non-local markdown image tags to prevent path leakage - openclaw#16: applyQQBotAccountConfig clears clientSecret when setting clientSecretFile and vice versa - openclaw#17: getAdminMarkerFile sanitizes accountId to prevent path traversal - openclaw#18: URGENT_COMMANDS uses exact match instead of startsWith prefix match - openclaw#19: isCronExpression validates each token starts with a cron-valid character - openclaw#20: --token format validation rejects malformed input without colon separator - openclaw#21: resolveDefaultQQBotAccountId checks QQBOT_APP_ID environment variable * test(qqbot): add focused tests for slash command authorization path - Unauthorized sender rejected for /bot-logs (requireAuth: true) - Authorized sender allowed for /bot-logs - Non-requireAuth commands (/bot-ping, /bot-help, /bot-version) work for all senders - Unknown slash commands return null (passthrough) - Non-slash messages return null - Usage query (/bot-logs ?) also gated by auth check * fix(qqbot): align global TTS fallback with framework config resolution - Extract isGlobalTTSAvailable to utils/audio-convert.ts, mirroring core resolveTtsConfig logic: check auto !== 'off', fall back to legacy enabled boolean, default to off when neither is set. - Add pre-check in reply-dispatcher before calling globalTextToSpeech to avoid unnecessary TTS calls and noisy error logs when TTS is not configured. - Remove inline as any casts; use OpenClawConfig type throughout. - Refactor handleAudioPayload into flat early-return structure with unified send path (plugin TTS → global fallback → send). * fix(qqbot): break ESM circular dependency causing multi-account startup crash The bundled gateway chunk had a circular static import on the channel chunk (gateway -> outbound-deliver -> channel, while channel dynamically imports gateway). When two accounts start concurrently via Promise.all, the first dynamic import triggers module graph evaluation; the circular reference causes api exports (including runDiagnostics) to resolve as undefined before the module finishes evaluating. Fix: extract chunkText and TEXT_CHUNK_LIMIT from channel.ts into a new text-utils.ts leaf module. outbound-deliver.ts now imports from text-utils.ts, breaking the cycle. channel.ts re-exports for backward compatibility. * fix(qqbot): serialize gateway module import to prevent multi-account startup race When multiple accounts start concurrently via Promise.all, each calls await import('./gateway.js') independently. Due to ESM circular dependencies in the bundled output, the first import can resolve transitive exports as undefined before module evaluation completes. Fix: cache the dynamic import promise in a module-level variable so all concurrent startAccount calls share the same import, ensuring the gateway module is fully evaluated before any account uses it. * refactor(qqbot): remove startup greeting logic Remove getStartupGreetingPlan and related startup greeting delivery: - Delete startup-greeting.ts (greeting plan, marker persistence) - Delete admin-resolver.ts (admin resolution, greeting dispatch) - Remove startup greeting calls from gateway READY/RESUMED handlers - Remove isFirstReadyGlobal flag and adminCtx * fix(qqbot): skip octal escape decoding for Windows local paths Windows paths like C:\Users\1\file.txt contain backslash-digit sequences that were incorrectly matched as octal escape sequences and decoded, corrupting the file path. Detect Windows local paths (drive letter or UNC prefix) and skip the octal decoding step for them. * fix bot issue * feat: 支持 TTS 自动开关并清理配置中的 clientSecretFile * docs: 添加 QQBot 配置和消息处理的设计说明 * rebase * fix(qqbot): align slash-command auth with shared command-auth model Route requireAuth:true slash commands (e.g. /bot-logs) through the framework's api.registerCommand() so resolveCommandAuthorization() applies commands.allowFrom.qqbot precedence and qqbot: prefix normalization before any handler runs. - slash-commands.ts: registerCommand() now auto-routes by requireAuth into two maps (commands / frameworkCommands); getFrameworkCommands() exports the auth-required set for framework registration; bot-help lists both maps - index.ts: registerFull() iterates getFrameworkCommands() and calls api.registerCommand() for each; handler derives msgType from ctx.from, sends file attachments via sendDocument, supports multi-account via ctx.accountId - gateway.ts (inbound): replace raw allowFrom string comparison with qqbotPlugin.config.formatAllowFrom() to strip qqbot: prefix and uppercase before matching event.senderId - gateway.ts (pre-dispatch): remove stale auth computation; commandAuthorized is true (requireAuth:true commands never reach matchSlashCommand) - command-auth.test.ts: add regression tests for qqbot: prefix normalization in the inbound commandAuthorized computation - slash-commands.test.ts: update /bot-logs tests to expect null (command routed to framework, not in local registry) * rebase and solve conflict * fix(qqbot): preserve mixed env setup credentials --------- Co-authored-by: yuehuali <[email protected]> Co-authored-by: walli <[email protected]> Co-authored-by: WideLee <[email protected]> Co-authored-by: Frank Yang <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
registerSessionStoreAdapter()for custom session store backends"plugin"option tosession.storeAdapterconfigMotivation
Deployments that need external session storage (Redis, DynamoDB, etc.) can now provide a plugin adapter without modifying core session store logic. The write-through pattern ensures filesystem backup is always maintained.
Changes
src/config/sessions/adapter.ts— New file:SessionStoreAdapterinterface with optionaltoRecord()andwarmCache()src/plugins/types.ts— AddedregisterSessionStoreAdaptertoOpenClawPluginApisrc/plugins/registry.ts— Added adapter registration storage andgetPluginSessionStoreAdapter()accessorsrc/config/sessions/store.ts— Added plugin adapter routing in load/save pathssrc/config/zod-schema.session.ts— Added"plugin"to storeAdapter enumsrc/config/types.base.ts— AddedstoreAdapterfield toSessionConfigTypeScript typesrc/gateway/server.impl.ts— Plugin adapter activation after plugin loadsrc/plugin-sdk/index.ts— ExportedSessionStoreAdapterandSessionEntrytypesextensions/lobster/src/lobster-tool.test.ts— Addedas OpenClawPluginApicast to fix type narrowing withPartial<>spreadTest plan
pnpm tsgopasses (only pre-existingextensions/tlonerrors remain)storeAdapter: "plugin", verify reads/writes route through adapterSummary by CodeRabbit
New Features
Improvements
Bug Fixes
Documentation
Version