Skip to content

feat(app): list sessions started from a session under it - #7450

Open
reachjalil wants to merge 1 commit into
devfrom
feat/sub-sessions-and-side-chats
Open

reachjalil wants to merge 1 commit into
devfrom
feat/sub-sessions-and-side-chats

Conversation

@reachjalil

Copy link
Copy Markdown
Member

What is this about?

Side chats and sessions the agent starts are now listed under the session they came from, and a session the agent started reports back when it finishes.

What problem does it solve?

Work started from a session lost its connection to it. You could not see which sessions belonged together, and an agent that started sessions had to keep checking on them.

What was the situation before?

A side chat was hidden from the sidebar while attached and became an unrelated row once detached. Sessions an agent started appeared as separate top-level rows, and the agent polled them with session.read.

How is this implemented?

  • Behind sessionTree (cloud and self-hosted, off). Safe to kill: the sidebar goes flat again and every session keeps its row. Doc: docs/features/session-tree/README.md.
  • A started session records openworkSessionLink in the OpenCode session's metadata (packages/types/src/session-link.ts). sidebar/session-tree.ts builds the tree for the list, Pinned and the Feed.
  • The server cannot read features, so session.create asks the app's new session.tree query before linking.
  • links/session-report-bridge.tsx adds a note to the parent, in the engine's sub-agent format, when a started session finishes a turn.
  • links/selection-side-chat.tsx: selected reply text offers "Start a side chat".

What else changed?

  • A prompt an agent sends with session.create or session.send on v2 records the sending session in the message's metadata, with or without the feature. Nothing displays it.

Release note

none

Evidence

No E2E; unit tests, typecheck and server bundle only: apps/app/tests/session-tree*.test.ts[x] and apps/server/test/host-response.test.ts. Not yet run in the desktop app, so there is no screenshot.

Design: P5, P11, S5, S7, C1, C3, V5

A session can start other sessions: a side chat the person opens beside it,
or sessions its agent starts with session.create. Nothing recorded where they
came from. A side chat was a local split-pane pairing, hidden from the list
while attached, and a session the agent started was one more unrelated row
the agent had to poll with session.read.

Behind `sessionTree` (cloud and self-hosted, off):

- A session started from another records `openworkSessionLink`
  ({ kind: side | sub, parentID }) in the OpenCode session's metadata when it
  is created, so every window agrees. The engine copies metadata to sub-agent
  sessions and forks, so the app honors the key only on a top-level session.
  v2 engine only, same workspace, two levels deep.
- The sidebar lists those sessions under their parent with a rail, in the
  Workspaces view, Pinned and the Feed. The Feed keeps a parent and its
  sessions together as rows of its own virtual list. A nested session's
  header leads back to its parent.
- The server cannot read features, so before creating sessions it asks the
  app's `session.tree` query whether the calling session can be a parent. The
  app registers the query only while the feature is on. A linked result says
  so and tells the agent a report will come.
- When a session an agent started finishes a turn, the app adds a note to
  its parent in the engine's own shape for a finished background sub-agent.
  The note's id comes from the engine's record of when the run ended, so two
  windows add one note. It starts the parent's next turn only for a turn the
  parent's agent asked for, once no other session it started is running, at
  most 12 times an hour.
- Selecting text in a reply offers "Start a side chat", which opens a side
  chat draft with the text quoted.

A prompt an agent sends with session.create or session.send on v2 now
records the sending session in the message's metadata, whether or not the
feature is on. Nothing shows it; reports use it to tell a turn the parent
asked for from one the person typed.

Turning the feature off flattens the sidebar again. Every session keeps a
row and nothing is deleted.

Signed-off-by: Jalil <reachjalil@gmail.com>
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
openwork-app Ready Ready Preview Nov 16, 2026 10:59pm UTC
openwork-den Ready Ready Preview Nov 16, 2026 10:59pm UTC
openwork-landing Ready Ready Preview, v0 Nov 16, 2026 10:59pm UTC

Request Review

This branch was successfully deployed

3 active deployments
Preview – openwork-den — 6bb6be69 Deployed Nov 16, 2026 by vercel[bot]
Preview – openwork-app — 6bb6be69 Deployed Nov 16, 2026 by vercel[bot]
Preview – openwork-landing — 6bb6be69 Deployed Nov 16, 2026 by vercel[bot]
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.

1 participant