Skip to content

[Feature Request] Group chat support + per-chat session isolation (一个群聊一个会话,多会话并行互不干扰) #1

Description

@olaycc37-cyber

Feature Request: Group Chat Support + Per-Chat Session Isolation

Problem / Current Limitation

LarkRemote currently works great for single-user private chat with the bot. However, it has two architectural limitations that prevent team/multi-session workflows:

1. Observation & Takeover states are global singletons

The following state files are shared across ALL chats (not isolated per chat_id):

  • observation.json — only ONE session can be observed at a time, globally
  • takeover.json — only ONE session can be taken over at a time, globally
  • handoff.json — single global handoff state

This means:

  • If I'm observing session A in private chat, and a colleague (or myself in a group) tries to observe session B, it overwrites my observation of session A.
  • Cannot run multiple parallel observations/takeovers for different Codex sessions simultaneously.

2. No group chat support

  • The bot can technically be added to a Feishu group (it receives a chat_id), but the permission model is based on senderId (user-level), not designed for multi-user group scenarios.
  • There's no mechanism to bind one group/thread to one specific Codex session.

Desired Behavior

Goal: One group chat (or thread) = One Codex session, fully isolated.

Similar to how lark-coding-agent-bridge works (but that project only supports Codex CLI, not Codex Desktop):

  1. Bot can be added to a Feishu group

    • The group is bound to a specific project (working directory)
    • Optionally: within a group, each thread (话题) maps to an independent Codex session
  2. Per-chat state isolation

    • Each chat_id (private chat, group, or thread) has its OWN independent:
      • observation.json → which session this chat is observing
      • takeover.json → which session this chat has taken over
      • message routing state
    • User A in private chat observing session X does NOT conflict with Group B observing session Y
  3. Auto-create dedicated chat for a task (optional stretch goal)

    • Command like /new-chat <task-name> creates a new Feishu group/chat dedicated to one Codex session
    • All progress notifications for that session go to that dedicated chat
    • Users can jump into any chat to interact with that specific session

Use Cases

  1. Parallel task monitoring: I run 3 Codex Desktop sessions on 3 different projects. I want to create 3 Feishu groups, each receiving notifications from ONE session, so I can check each task's status without mixing them up.

  2. Team collaboration: Team lead adds the bot to a project group. Multiple team members can see the Codex session progress in that group. The session binding is stable and doesn't get hijacked by other chats.

  3. Per-task dedicated channel: For a long-running refactor task, I create a dedicated Feishu group "refactor-auth-module". All notifications about that task go there. When the task completes/pauses/errors, the notification appears in that group with full context.

Technical Analysis / Suggested Implementation

I've reviewed the source code (v0.2.6) and believe the change scope is manageable:

Key files to modify:

  1. src/observer.mjsCodexSessionObserver currently loads/saves a single global observation.json. Change to per-chat storage:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions