Skip to content

feat: add enabled flag for compaction config#1

Closed
davidrudduck wants to merge 1078 commits intomainfrom
feat/enabled-flag-compaction-decay
Closed

feat: add enabled flag for compaction config#1
davidrudduck wants to merge 1078 commits intomainfrom
feat/enabled-flag-compaction-decay

Conversation

@davidrudduck
Copy link
Copy Markdown
Owner

@davidrudduck davidrudduck commented Mar 3, 2026

Summary

  • Adds an optional enabled boolean to the compaction configuration
  • When enabled: false, all compaction paths are disabled (safeguard extension, direct compaction, extension factory)
  • Default behaviour unchanged — compaction is enabled when the flag is omitted

Motivation

Plugins that manage the context budget externally (via before_context_send) need the ability to disable built-in compaction. This gives plugin authors a clean config flag rather than requiring workarounds.

Changes

  • src/config/types.agent-defaults.ts — Added enabled?: boolean to AgentCompactionConfig
  • src/config/zod-schema.agent-defaults.ts — Added enabled to compaction Zod schema
  • src/agents/pi-extensions/compaction-safeguard-runtime.ts — Added enabled to runtime value type
  • src/agents/pi-extensions/compaction-safeguard.ts — Early cancel when enabled === false
  • src/agents/pi-embedded-runner/compact.ts — Early return in direct compaction path
  • src/agents/pi-embedded-runner/extensions.ts — Gate safeguard factory on enabled !== false

Test plan

  • Verify pnpm tsgo passes
  • Verify existing compaction tests still pass
  • Manual: set compaction.enabled: false, verify compaction doesn't fire
  • Manual: omit enabled flag, verify default behaviour unchanged

Config example

```yaml
agents:
defaults:
compaction:
enabled: false # external plugin manages context budget
mode: safeguard
```

Summary by CodeRabbit

  • New Features
    • Optional sandboxed Docker runtime with guided setup.
    • Tailscale-based gateway discovery alongside Bonjour.
    • CLI: config file path and validate (incl. JSON) commands.
    • Camera/photo/clip capture pipelines revamped for reliability (iOS/macOS).
    • macOS UI polish: reusable status cards, selectable rows, dialog builder.
  • Improvements
    • Docker images add OCI labels and healthchecks; compose gains healthcheck and safer defaults.
    • Faster, leaner CI with sticky disk caches, Windows 32‑vCPU runner, and unified Docker builder.
    • Keychain-backed storage for gateway settings and TLS pins.
    • Voice: automatic fallback when PCM is unsupported.
  • Documentation
    • Expanded channel guides, new hook events, updated webhooks, and pairing/device command updates.
    • CI docs and security hardening guidance refreshed.

hclsys and others added 30 commits March 3, 2026 01:09
…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]>
jlwestsr and others added 24 commits March 3, 2026 08:11
…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)
Adds an optional `enabled` boolean to the compaction config, allowing
compaction to be completely disabled when external plugins manage the
context budget. Belt-and-suspenders: the safeguard extension, direct
compaction path, and extension factory registration all check the flag.

Default behaviour is unchanged (enabled when omitted).
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 3, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Broad updates across CI workflows, Docker tooling (sandbox, healthchecks), shared OpenClawKit utilities, and platform apps (Android, iOS, macOS). Significant refactors centralize common logic (UI, permissions, discovery, keychain, logging), add new protocol models (secrets), and migrate storage. Numerous tests updated and new utilities introduced.

Changes

Cohort / File(s) Summary
Containerization & Sandbox
.dockerignore, Dockerfile, docker-compose.yml, docker-setup.sh
Add OCI labels and healthcheck; compose gains healthcheck, secure opts, and network_mode; setup script introduces optional sandbox mode with Docker CLI install, socket handling, overlay compose, and gating.
CI/CD Workflows & Actions
.github/... (workflows/*, actions/*, actionlint.yaml)
Refactor scope detection; expand Windows matrix (32 vCPU); add sticky-disk cache options; introduce Docker builder setup; gating via changed-scope; cache branching in pnpm-store action.
Shared Kit: Camera/Location/Web/Network
apps/shared/OpenClawKit/Sources/OpenClawKit/... (CameraAuthorization.swift, CameraCapturePipelineSupport.swift, CameraSessionConfiguration.swift, CaptureRateLimits.swift, LocationCurrentRequest.swift, LocationServiceSupport.swift, WebViewJavaScriptSupport.swift, LocalNetworkURLSupport.swift, LoopbackHost.swift, NetworkInterfaceIPv4.swift, NetworkInterfaces.swift, ThrowingContinuationSupport.swift, BonjourServiceResolverSupport.swift)
New public utilities for camera/session setup, capture rate limits, location request orchestration, WKWebView JS helpers, loopback/local network checks, IPv4 enumeration, continuation helpers, and NetService resolution.
Shared Kit: Gateway/Protocol
.../GatewayChannel.swift, .../GatewayConnectChallengeSupport.swift, .../GatewayNodeSession.swift, .../GatewayTLSPinning.swift, .../GenericPasswordKeychainStore.swift, .../OpenClawProtocol/GatewayModels.swift
Centralize device auth dict, nonce parsing, waiter draining; migrate TLS fingerprints to Keychain; add generic Keychain store; add secrets resolve/reload models; rename ExecApprovalRequestParams field.
Android App
apps/android/... (Manifest, CameraCaptureManager.kt, ScreenRecordManager.kt, Motion/Device handlers, Contacts/Canvas/UI chat files, tests, README, build files)
Adopt JSON parsing helpers; unify permission checks; bitmap scaling helper; contacts query helper; UI image decode state; test harness refactors; version/permission updates.
iOS App
apps/ios/... (CameraController.swift, Gateway*, Device*, Screen*, Status UI, Voice/Talk, Onboarding, builders, Keychain store, Info.plists, project.yml)
Move to CameraCapturePipelineSupport; thread-safe TLS probe; discovery/browser abstractions; Keychain-backed last-connection; builders for status/actions; @MainActor annotations; TTS PCM fallback handling; deep link prompt coalescing; multiple UI refactors.
macOS App (Core/UI)
apps/macos/Sources/OpenClaw/... (OverlayPanelFactory.swift, Menu*, Settings*, Gateway*, Discovery*, Permissions*, TrackingAreaSupport.swift, Selection row/colors, MicRefreshSupport, Duration/Text utils, Exec*, Voice*, FileWatchers)
Centralize overlays/animations; new sidebar scaffolding; selection row chrome/colors; push subscription helper; permission monitoring; CLI/JSON extractors; task helpers; file watcher wrapper; platform label formatting; tailscale fallback discovery; various logic moved to shared helpers.
macOS Discovery & CLI
OpenClawDiscovery/... (GatewayDiscoveryModel.swift, TailscaleNetwork.swift, TailscaleServeGatewayDiscovery.swift), OpenClawMacCLI/... (ConnectCommand.swift, WizardCommand.swift, CLIArgParsingSupport.swift)
Add Tailscale serve discovery with probing; simplify tailnet detection; factor CLI arg parsing; reuse gateway endpoint/auth helpers.
Tests (Android)
apps/android/app/src/test/...
Adopt base Robolectric test class; broaden gateway session tests; refactor capability/commands tests; helper utilities added.
Tests (macOS & Shared)
apps/macos/Tests/..., apps/shared/OpenClawKit/Tests/...
Replace custom WS fakes with standardized test sessions; add async wait helpers; numerous helper-based refactors; new discovery tests; updated signatures/import order; added FS helpers.
Docs
docs/...
Update CI runner docs; add hook events; webhook response code; channel docs expanded (Discord, Telegram, Feishu, etc.); CLI docs add config file/validate; security notes added.
Prompts/Policies
.pi/prompts/landpr.md, SECURITY.md, AGENTS.md
Squash preferred in merge guidance; expanded security hardening and delegation policies; GitHub search pagination note.
PI Extensions (Dev UI)
.pi/extensions/... (files.ts, diff.ts, ui/paged-select.ts, prompt-url-widget.ts)
Replace custom TUI pickers with paged-select component; centralize prompt widget metadata render.
Misc Config
.gitignore, changelog/fragments/*, assets/chrome-extension/background.js
Ignore updates; remove changelog fragments; Chrome extension improves relay handling and attach retry.

Sequence Diagram(s)

sequenceDiagram
  actor Operator as Operator
  participant Setup as docker-setup.sh
  participant Docker as Docker Engine
  participant Sandbox as Sandbox Image
  participant Compose as docker-compose
  participant Gateway as Gateway Container

  Operator->>Setup: Run with OPENCLAW_SANDBOX
  Setup->>Setup: Parse env, detect DOCKER_SOCKET_PATH
  Setup->>Docker: Build Sandbox (args: OPENCLAW_INSTALL_DOCKER_CLI)
  Docker-->>Sandbox: Image ready
  Setup->>Compose: Generate overlay (sandbox config)
  Setup->>Compose: up -d (base + sandbox)
  Compose->>Docker: Create/Start containers
  Docker-->>Gateway: Start
  Setup->>Gateway: Probe /healthz
  Gateway-->>Setup: 200 OK
Loading

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/enabled-flag-compaction-decay

davidrudduck pushed a commit that referenced this pull request Mar 3, 2026
… and docs (openclaw#16761)

Add inline file attachment support for sessions_spawn (subagent runtime only):

- Schema: attachments[] (name, content, encoding, mimeType) and attachAs.mountPath hint
- Materialization: files written to .openclaw/attachments/<uuid>/ with manifest.json
- Validation: strict base64 decode, filename checks, size limits, duplicate detection
- Transcript redaction: sanitizeToolCallInputs redacts attachment content from persisted transcripts
- Lifecycle cleanup: safeRemoveAttachmentsDir with symlink-safe path containment check
- Config: tools.sessions_spawn.attachments (enabled, maxFiles, maxFileBytes, maxTotalBytes, retainOnSessionKeep)
- Registry: attachmentsDir/attachmentsRootDir/retainAttachmentsOnKeep on SubagentRunRecord
- ACP rejection: attachments rejected for runtime=acp with clear error message
- Docs: updated tools/index.md, concepts/session-tool.md, configuration-reference.md
- Tests: 85 new/updated tests across 5 test files

Fixes:
- Guard fs.rm in materialization catch block with try/catch (review concern #1)
- Remove unreachable fallback in safeRemoveAttachmentsDir (review concern #7)
- Move attachment cleanup out of retry path to avoid timing issues with announce loop

Co-authored-by: Tyler Yust <[email protected]>
Co-authored-by: napetrov <[email protected]>
@davidrudduck
Copy link
Copy Markdown
Owner Author

Recreating — base branch was out of sync

@davidrudduck davidrudduck deleted the feat/enabled-flag-compaction-decay branch March 3, 2026 22:41
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.