Skip to content

feat(spaces): Add a listSpaces tool that finds the Spaces a person can see - #4414

Merged
dcramer merged 3 commits into
mainfrom
feat/list-spaces-tool
Nov 26, 2026
Merged

dcramer merged 3 commits into
mainfrom
feat/list-spaces-tool

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

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 (feat(spaces): Let a Space's Lead move Conversations when a person asks #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.

via @dcramer.

--

View Session [Sentry]

sentry-junior Bot and others added 2 commits November 26, 2026 02:52
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]>
…n see

Agents had no way to find a Space, so a move needed the person to paste
a Space link. listSpaces lists every public Space and the calling
Conversation's own Space, with the person's membership. A private Space
shows only inside it, so its name stays with its members. The Lead gets
it next to moveConversationToSpace.

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 3:46am UTC

Request Review

@github-actions

github-actions Bot commented Nov 26, 2026 •

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:14
@sentry-junior
sentry-junior Bot requested a review from dcramer November 26, 2026 03:14
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 26, 2026
@dcramer
dcramer enabled auto-merge (squash) November 26, 2026 03:29
Co-Authored-By: David Cramer <[email protected]>

# Conflicts:
#	packages/junior-evals/evals/agent/lead.eval.ts
#	packages/junior/src/chat/conversations/kind-behavior.ts
#	packages/junior/tests/integration/api/spaces.test.ts
@dcramer
dcramer merged commit 91d9aa5 into main Nov 26, 2026
58 of 60 checks passed
@dcramer
dcramer deleted the feat/list-spaces-tool branch November 26, 2026 03:56
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 — ca69a9ef 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