Skip to content

feat: unify team engineering on the session forest - #24

Merged
wangyuahn merged 8 commits into
masterfrom
cursor/unify-session-team-engineering-3730
Sep 19, 2026
Merged

wangyuahn merged 8 commits into
masterfrom
cursor/unify-session-team-engineering-3730

Conversation

@wangyuahn

@wangyuahn wangyuahn commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

Related Issue

Unify durable Team Engineering collaborators onto Session. Durable members were dual-written as an empty child Session (map card) plus a parent-session kind:'team' Agent (work, chat, Discuss). The map, sidebar, inspector, and TUI then disagreed about who existed.

Problem

Hiring created two identities. The GUI only painted Sessions, while work, sibling chat, and meetings stayed on the parent-session Team Agent. The result: fewer map cards than meeting participants, empty child workspaces, missing department chat, /map requiring a shadow agent, and models forbidden from changing Session topology.

After the forest landed, the TUI still assembled department state three ways: syncRuntimeState merged graph + metadata, but /team and /map replaced teamAgents with graph-only rows (dropping live Discuss and reports). Chat was wired to a same-session agent view that no longer exists, so Ctrl-Y on the lead was empty and opening a member switched Sessions without the department pane.

What changed

Durable collaborators are Sessions only. Team Engineering is a capability on that Session (parent_session_id + identity + cwd + main).

  • Hire: TeamCreate / map create-child only create and resume a mounted child Session. Work and tools run on child.main. Nested hire parents under the hiring Session. attachMountedTeamMember is leftover-shadow cleanup, not the hire path.
  • Addressing: TeamCreate/Chat/DM/Status/Assign/Dismiss/Discuss use session id (or display name). Discuss participants are the parent’s direct child Sessions.
  • Migration: Existing mounted_session_id team agents copy transcript/chat into the child, then the parent-session shadow is dropped. True ghosts materialize as child Sessions first, inheriting cwd from the parent, host, leftover homedir, or the user home directory. Discuss participant ids are rewritten to the child Session.
  • One forest: Web map, sidebar, inspector chat/meeting, identity fill, approval jumps, and TUI /map / /team all read the same Session forest. Opening a card or a /team row opens that Session. listAgents no longer synthesizes children as parent-session team nodes. The map no longer overlays CachedMapAgent / agent: extras.
  • Map ops: Parent Session can fill a child’s identity (name/role/mandate). Spawn offsets sibling cards. Dead Sessions prune local edges. Alt+click disconnects; right-click Stop ends work. Models get SessionSearch / SessionMount / SessionUnmount / SessionGraph.
  • Gap fill after re-audit: Work-edge identity uses the same Prompt / Ask-parent / Save remount path as create. TeamChat resolves @name mentions to sibling session ids on the mounted forest (and leftover shadow) path. TeamAssign no longer copies the parent lead’s tool set onto a durable child Session. TeamStatus is auto-approved. System prompts inventory Session* topology tools.
  • Isolated mock flows: Every Team* and Session* tool has its own mocked schema, execute wiring, and SessionSubagentHost path (hire, dismiss, update, assign, broadcast, DM, chat, status, discuss invite/kick/decide/speak, search/mount/unmount/graph).
  • TUI forest snapshot: /team, /map, and syncRuntimeState share buildDepartmentSnapshot (forest members + metadata Discuss + live reports). Opening a /team row only resumeSessions that child; a discussion row opens the pane. Ctrl-Y Chat reads this session’s lead (main). A mounted child without its own department points Chat back to the parent. Footer shows the mounted session title instead of a leftover same-session agent badge. TeamCreate snapshot ids prefer session_id.
  • Docs / tests: Team-engineering guides, ADR current-status, tools reference, and README no longer describe dual-write as the product model. Session topology tools are on bundled profiles and covered by host, builtin, permission, map, inspector, and TUI forest tests. Keyboard / slash-command copy matches Chat-on-lead.
  • CI: Follow-up commits close typecheck, lint, build, and tests that still assumed parent-session team shadows or grabbed the first session.meta.updated frame.

The Agent class remains a standalone LLM runner (root AGENTS.md). One-shot Task sub-agents are still not map nodes. /map and /team stay separate commands (topology vs department roster). Changeset is minor; protocol fields such as mounted_session_id remain during migration and are not bumped major without confirmation.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.
Open in Web Open in Cursor 

cursoragent and others added 8 commits September 19, 2026 03:12
Hire, chat, Discuss, and the conversation map now treat mounted child sessions as the only durable members. Drop parent-session team-agent shadows after migration, address Team* tools by session id, and align Web/TUI surfaces on the same forest.

Co-authored-by: Suddenness <wangyuahn@users.noreply.github.com>
TeamCreate now parents nested members under the hiring session itself
instead of always the root, and first-time mount writes a display name
from the session title. Tests follow the session-id TeamStatus and
prompt wording.
Add SessionSearch/Mount/Unmount/Graph to bundled profiles and tests.
Drop the unused pendingAgentOpen path so approval and map opens stay
on the Session itself.
Map cards, inspector chat/meeting, listAgents, and TUI /team now read mounted child Sessions only. Leftover parent-session team shadows are migrated or ignored, and ghost members inherit cwd from the parent, host, or home directory.
Annotate department/topology runtimes, pin map lookups and force pins,
and align mount tests with the Session forest instead of parent team shadows.
TeamChat now delivers @mentions by sibling display name on the mounted
forest path, work-edge identity uses the same Prompt / parent-fill /
save remount as create, and TeamAssign no longer copies the parent lead
tool set onto a durable child Session.
Each Team* and Session* tool now has its own mocked schema, execute
wiring, and SessionSubagentHost path so hire, chat, Discuss, and
topology contracts cannot hide behind a lumped smoke test.
/team and /map now merge the live forest instead of replacing it, Chat
loads on the lead session, and opening a member only resumes that Session.
@wangyuahn
wangyuahn marked this pull request as ready for review September 19, 2026 11:38
@wangyuahn
wangyuahn merged commit e0f47af into master Sep 19, 2026
8 checks passed
@wangyuahn
wangyuahn deleted the cursor/unify-session-team-engineering-3730 branch September 19, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants