Skip to content

feat(spaces): Let a Space's Lead move Conversations when a person asks - #4411

Merged
dcramer merged 1 commit into
mainfrom
feat/lead-move-conversation
Nov 26, 2026
Merged

dcramer merged 1 commit into
mainfrom
feat/lead-move-conversation

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

A Space's Lead had no way to move a Conversation. When a member asked it to move related work into the Space, it started a separate Conversation to do the move.

The Lead now lists moveConversationToSpace. It's the same tool that root Conversations already have from #4282, and it calls the same setConversationSpaceForViewer → setConversationSpace path as the dashboard's Move to Space. So the existing rules still apply:

  • The person must take part in the Conversation and be a member of each Space involved.
  • Only a public Conversation joins a Space, and a Conversation in a private Space stays there.
  • A Slack Conversation can't join a private Space.

Other changes:

  • When space is omitted, the tool uses the Space of the calling Conversation, which it reads from the runtime. A Lead moves work into its own Space without copying an ID. null still takes a Conversation out of its Space.
  • A Lead Turn that no person sent, such as a Watch Event or a message from another agent, now has settings: false. The Lead's tool list stays the same, so the prompt cache holds, but moveConversationToSpace and setConfiguration are disabled on those Turns. Before this change, setConfiguration was usable on them.

Coordination with Lead-children (agents/lead-children): this PR is based on main, not stacked on that branch. The Lead calls the shared setConversationSpaceForViewer, which that branch changes so a move sets parent_id and root_conversation_id to the Lead. So the Lead's moves pick up those semantics with no rework. The only overlap is one line in LEAD_TOOLS.

The eval fixture gets createOtherSpace(name), which makes a Space as a second dashboard person through POST /api/spaces. The Lead evals use it to ask the Lead to move work into a Space the person is not in.

via @dcramer.

--

View Session [Sentry]

The Lead now lists moveConversationToSpace, the same tool and move path
as the dashboard's Move to Space. With no Space named, the tool moves
the Conversation into the Space of the calling Conversation, so a Lead
moves work into its own Space without copying an ID.

A Lead Turn that no person sent, such as a Watch Event, now has no
settings tools, so it cannot move work or change configuration.

Co-Authored-By: David Cramer <[email protected]>
@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 26, 2026 2:57am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

1 screenshot change — 1 changed · 0 added · 0 removed

Review screenshots in Frameshift

Conversation Unsent Answers · Desktop
Conversation Unsent Answers · Desktop
Changed

@dcramer
dcramer marked this pull request as ready for review November 26, 2026 03:10
@sentry-junior
sentry-junior Bot requested a review from dcramer November 26, 2026 03:10
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 26, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 317ecd2. Configure here.

@dcramer
dcramer merged commit 4982da4 into main Nov 26, 2026
68 of 69 checks passed
@dcramer
dcramer deleted the feat/lead-move-conversation branch November 26, 2026 03:27
dcramer added a commit that referenced this pull request Nov 26, 2026
…n see (#4414)

Stacked on #4411. Review only the top commit,
`feat(spaces): Add a listSpaces tool…`. It targets `main` because CI
runs only on PRs to `main`. Once #4411 merges, the diff
shrinks to this commit.

Agents had no tool to find a Space. To move work, the person had to
paste a Space link. `listSpaces` is a new deferred, read-only tool in
the `spaces` source, next to `moveConversationToSpace`. It uses the
access rules that `listSpaces` in `chat/spaces/store.ts` already has. It
returns each Space's id, name, description, visibility, whether the
person is a member, and a dashboard link. It leaves out archived Spaces,
and `membership: "member"` keeps only the person's own Spaces.

Following `policies/conversation-access.md`, a private Space's data
stays with its members. So the tool lists every public Space, but a
private Space only from a Conversation in it. From anywhere else, a
person who wants to move work into a private Space still passes its
link.

Every Turn lists the tool, and the Lead gets it in `LEAD_TOOLS`.

## Lead tools

- **Today on `main`:** `startConversation`, `messageAgent`,
`searchConversations`, `searchConversationEvents`,
`readConversationEvent`, `searchInboxItems`, `searchEventTypes`,
`watchEvents`, `watchTimer`, `listWatches`, `stopWatchingResources`,
`systemTime`, `updateUserCustomization`, `setConfiguration`, `noReply`.
- **These two PRs add:** `moveConversationToSpace`
(#4411) and `listSpaces` (this PR).
- **Lead-children (`agents/lead-children`) adds:** `startAgent`,
`listAgents`, `stopAgent`, and `archiveAgent`, in place of
`startConversation`. Space Conversations become the Lead's children, so
archive and stop for them come from that PR, not from new code here.
- **Still left out:** sandbox, skills, MCP and provider tools (such as
GitHub PR state), automations, `updateTodos`, `addInboxItem`, and
`updateInboxItem`. This is on hold until the Lead-prompt overhaul
recommends the Lead's tool set.

<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A4946035b4db5727d7b5a1fcd -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3A4946035b4db5727d7b5a1fcd)
[[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A4946035b4db5727d7b5a1fcd/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>
dcramer added a commit that referenced this pull request Nov 26, 2026
…se (#4422)

The Lead eval case "moves the Conversation" from #4411
failed even when the Lead moved the work. The Lead ran
`moveConversationToSpace` inside a `codemode` script, and a script call
records no tool output, so the case read `undefined`.

The case now reads the moved Conversation's Space from its dashboard
page, as the person sees it, instead of the tool output. The eval
fixture gets a `readConversationSpace` helper for this, which calls `GET
/api/conversations/:id` as the web person.

<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A4946035b4db5727d7b5a1fcd -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3A4946035b4db5727d7b5a1fcd)
[[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A4946035b4db5727d7b5a1fcd/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>
@sentry-junior sentry-junior Bot mentioned this pull request Nov 26, 2026
2 of 12 tasks
dcramer added a commit that referenced this pull request Nov 26, 2026
…ead design (#4428)

States where Spaces and the Lead are heading. A Space uses the core
Conversation tree (parents, roots, Participants, access, stops,
archives, Watches, updates), and only a few Space-specific layers sit on
top of it.

- `design/spaces.md` is rewritten. The Lead is the root of the Space's
tree. Every Space Conversation, whether the Lead starts it, a person
starts it in the Space, or a person moves it in, is a child of the Lead
and has the Lead as its root. Children inherit the Lead's Participants.
Archive and snooze act per child. The file lists the Space layers
explicitly: metadata, membership, configuration, the Lead's prompt and
tools, moves, and rendering (the sidebar, the Threads panel, and
top-level lists).
- `design/lead.md` is new. It covers the Lead's role, its curated
manager tool set (it runs Threads, reads, plans, and asks people, and it
never writes or runs code), and the Turn gates: explicit reply on child
and Event Turns, quiet `done` updates, and child results as claims. Gaps
record what is not on main yet.
- `design/agent-teams.md`: a Lead's team is its Space, and the Lead gaps
move to `lead.md`.
- `design/child-agents.md`: removes contradictions with Spaces. A move
changes a child's parent, a moved Conversation delivers to its own
Location, and the 8-child limit does not apply to a Lead's children.
- `TERMINOLOGY.md`: updates Lead, Space, Thread, Team, Delivery, and
Participant, and adds Top-level Conversation (derived, not stored).

Related: #4377 (`thread` kind), #4411
and #4414 (moves), #4416 (Threads
panel).

#4413 edits some of the same lines. After this merges,
it should drop those doc changes and delete only the gaps it closes.

<!-- junior-request-attribution:start -->
via @dcramer.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A56172fc7761dc3a4c09f6bc7 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3A56172fc7761dc3a4c09f6bc7)
[[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A56172fc7761dc3a4c09f6bc7/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 317ecd24 Deployed Nov 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant