refactor: auto-managed turn order + dormant state + identity injection

Turn system redesign:
- Turn order auto-populated from config bindings (all bot accounts)
- No manual turnOrder config needed
- Humans (humanList) excluded from turn order automatically
- Dormant state: when all agents NO_REPLY in a cycle, currentSpeaker=null
- Reactivation: any new message wakes the system
  - Human message → start from first in order
  - Bot not in order → start from first
  - Bot in order → next after sender
- Skip already-NO_REPLY'd agents when advancing

Identity injection:
- Group chat prompts now include agent identity
- Format: '你是 {name}(Discord 账号: {accountId})'

Other:
- Remove turnOrder from ChannelPolicy (no longer configurable)
- Add TURN-WAKEUP-PROBLEM.md documenting the NO_REPLY wake-up challenge
- Update message_received to call onNewMessage with proper human detection
- Update message_sent to call onSpeakerDone with NO_REPLY tracking
This commit is contained in:
zhi
2026-02-27 23:27:36 +00:00
parent 1d8881577d
commit 476308d0df
4 changed files with 377 additions and 131 deletions

View File

@@ -17,8 +17,6 @@ export type ChannelPolicy = {
humanList?: string[];
agentList?: string[];
endSymbols?: string[];
/** Ordered list of Discord account IDs for turn-based speaking */
turnOrder?: string[];
};
export type Decision = {