@cmach_socket/opencode-qq-bot 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/session/manager.ts +2 -2
package/package.json
CHANGED
package/src/session/manager.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto"
|
|
2
1
|
import type { Plugin } from "@opencode/plugin"
|
|
2
|
+
import { SessionMessage } from "@opencode/schema"
|
|
3
3
|
import { Mutex } from "async-mutex"
|
|
4
4
|
import { type ChatTarget, isTargetEnabled, parseTargetKey, targetKey, targetLabel } from "../chat"
|
|
5
5
|
import type { QQBotConfig } from "../config"
|
|
@@ -319,7 +319,7 @@ export class SessionManager {
|
|
|
319
319
|
/** 收到一条消息:先入队,再尝试投递;上游忙时留在队列里。 */
|
|
320
320
|
async enqueue(target: ChatTarget, turn: Turn): Promise<void> {
|
|
321
321
|
const state = this.state(target)
|
|
322
|
-
const queued = turn.id ? turn : { ...turn, id:
|
|
322
|
+
const queued = turn.id ? turn : { ...turn, id: SessionMessage.ID.create() }
|
|
323
323
|
await this.targetMutex(target).runExclusive(async () => {
|
|
324
324
|
this.pushBuffered(state, queued)
|
|
325
325
|
await this.drain(state)
|