User report
[需求 4] Project 与 Session 映射。定义 Clarus Project、Runtime Task、Synergy Session 和本地目录之间的关系。每个 Project 应有稳定的 Project Session 和 workspace;Runtime Task 可创建独立执行 Session。还需要明确普通消息、mention 和 task 的路由及唤醒策略,以及 Project 是否可以指定不同的 Primary Agent。
Reporter: Feishu:ou_25b44caac15ab235465df821bd7c8f2a
Source: feishu:oc_46d261becbf063b7e0b667667d210297; message:om_x100b6a7ac5d70c7cc42f17e2290d1c1
Triage
- Type: feature_request
- Target repo: SII-Holos/synergy
- Related area: area/session
Deduplication
No duplicate found in recent open/closed issues. Issue #512 (Super Loop orchestration) and Issue #523 (Agent Organization Runtime) touch on multi-session orchestration but do not define the fundamental Project→Session mapping relationship. No existing issue defines the routing strategy for messages/mentions/tasks in the Clarus Project context.
Static inspection
packages/synergy/src/session/ — the session runtime system. Currently sessions are created per-conversation (via frontend, channel, or session_control tool) without a stable "Project Session" concept.
packages/synergy/src/session/inbox.ts — message inbox handling with agent name resolution via Agent.defaultAgent().
packages/synergy/src/session/input.ts — input routing based on agent name and channel type.
packages/synergy/src/task/ — task execution, which creates sub-sessions.
packages/synergy/src/tool/session-control.ts — session_control tool, which creates sessions with optional directory binding.
packages/synergy/src/runtime/reload.ts — runtime reload, includes default_agent watch.
Expected behavior
- Each Clarus Project should have a stable "Project Session" — a persistent session tied to the project lifecycle, not to individual user conversations.
- The Project Session has a dedicated workspace directory (see Issue 3).
- Runtime Tasks can create independent execution sessions (sub-sessions) distinct from the stable Project Session.
- Clear routing and wake-up strategy:
- Normal messages in a project context → routed to Project Session
- @mention of a specific agent → routed to that agent's session or sub-session
- Task execution → creates independent sub-session in project workspace
- Projects should be able to specify a different Primary Agent (via
default_agent override at project level).
- The mapping between entity types (Project, Runtime Task, Session, Directory) should be formally defined.
Actual behavior
- No stable "Project Session" concept exists — sessions are created per interaction.
- Routing is based on channel message metadata and agent mention, not on project membership.
- No formal mapping between projects, tasks, sessions, and directories.
Proposed fix
- Define a data model for the Project→Session mapping, including:
ProjectSession — a persistent session associated with a Clarus Project
TaskSession — an execution sub-session created by a Runtime Task
Directory — the project workspace path
- Implement a Project Session lifecycle:
- Created when the project is first accessed
- Persists across user conversations
- Tied to the project workspace directory
- Stops when project is archived/deleted
- Define routing rules:
- Messages in project scope → Project Session with project's assigned Primary Agent
- @agent → route to that agent (sub-agent or primary)
- Task tool → create TaskSession in project workspace
- Allow project-level
default_agent override (new config field in project metadata).
- Document the formal entity relationship.
Suggested labels: enhancement, area/session
User report
Reporter: Feishu:ou_25b44caac15ab235465df821bd7c8f2a
Source: feishu:oc_46d261becbf063b7e0b667667d210297; message:om_x100b6a7ac5d70c7cc42f17e2290d1c1
Triage
Deduplication
No duplicate found in recent open/closed issues. Issue #512 (Super Loop orchestration) and Issue #523 (Agent Organization Runtime) touch on multi-session orchestration but do not define the fundamental Project→Session mapping relationship. No existing issue defines the routing strategy for messages/mentions/tasks in the Clarus Project context.
Static inspection
packages/synergy/src/session/— the session runtime system. Currently sessions are created per-conversation (via frontend, channel, orsession_controltool) without a stable "Project Session" concept.packages/synergy/src/session/inbox.ts— message inbox handling with agent name resolution viaAgent.defaultAgent().packages/synergy/src/session/input.ts— input routing based on agent name and channel type.packages/synergy/src/task/— task execution, which creates sub-sessions.packages/synergy/src/tool/session-control.ts— session_control tool, which creates sessions with optional directory binding.packages/synergy/src/runtime/reload.ts— runtime reload, includesdefault_agentwatch.Expected behavior
default_agentoverride at project level).Actual behavior
Proposed fix
ProjectSession— a persistent session associated with a Clarus ProjectTaskSession— an execution sub-session created by a Runtime TaskDirectory— the project workspace pathdefault_agentoverride (new config field in project metadata).Suggested labels: enhancement, area/session