feat: keep typing during scheduled tasks and tell waiting users

A group-context scheduled task occupies the room queue, so a human message
sent meanwhile waited silently (up to the whole task run) with no typing
indicator; the room looked unresponsive.

- Scheduled tasks (not CI watchers) hold the room's typing indicator for
  their whole run (DiscordChannel.setTypingHold: typing stays on while any
  hold is active, independent of message-turn setTyping(false)).
- A human message that has to wait behind a running scheduled task gets a
  one-time notice per wait: "지금 예약 작업을 진행하고 있습니다. 이 작업을
  마친 뒤 바로 답변드리겠습니다." (GroupQueue.claimScheduledTaskWaitNotice,
  reset when the waiting messages run).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-10-27 23:12:00 +09:00
parent fdfdd384bf
commit fdd98e9eb8
14 changed files with 323 additions and 1 deletions

View File

@@ -218,6 +218,18 @@ export class GroupQueue {
);
}
/**
* True once per wait: a scheduled task occupies this room's queue, so a new
* human message has to wait for it. Reset when the waiting messages run.
*/
claimScheduledTaskWaitNotice(groupJid: string): boolean {
const state = this.getGroup(groupJid);
if (state.runPhase !== 'running_task') return false;
if (state.scheduledTaskWaitNoticeSent) return false;
state.scheduledTaskWaitNoticeSent = true;
return true;
}
registerProcess(
groupJid: string,
proc: ChildProcess,
@@ -540,6 +552,7 @@ export class GroupQueue {
const runId = this.createRunId();
state.currentRunId = runId;
state.pendingMessages = false;
state.scheduledTaskWaitNoticeSent = false;
state.startedAt = Date.now();
transitionRunPhase(state, groupJid, 'running_messages', { runId, reason });
assertRunPhaseInvariants(state, groupJid);