Skip to content

feat(app): reference sessions from the composer - #54466

Closed
kitlangton wants to merge 2 commits into
betafrom
session-tab-mentions
Closed

kitlangton wants to merge 2 commits into
betafrom
session-tab-mentions

Conversation

@kitlangton

@kitlangton kitlangton commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Why

The composer cannot reference another open or running session by title. Pasting its title loses the session identity and leaves no link back to the conversation.

What Changes

  • Type @ to find other open session tabs and running sessions on the current server, by title or session ID.
  • Select a result to insert a session mention. Its readable title updates when the session is renamed, while its stored ID remains stable.
  • Send the prompt, then click the mention in the transcript to open that session. The model receives the referenced session ID.
  • Preserve session mentions through draft persistence, prompt history, and queued-message edits.

For example, selecting @Auth middleware inserts a readable mention backed by ses_00000000000000000000000002. Renaming that session to Auth v2 updates the label without changing its destination.

Demo

session-mentions-side-by-side.mp4

Before (4617210822, left) and after (f22188542d, right), recorded with Browser Control from the production web app. The same deterministic fixture supplies fictional sessions and a simulated server/provider; no model requests are made. The demonstration types @, references another tab, submits, renames the referenced session, and opens it from the message.

The comparison is about 12 seconds at 15 fps. Each 1728-pixel-wide capture is reduced to 1280 pixels for the side-by-side layout; captions are added. This is web-app evidence, not a native Desktop recording.

Scope

Composer session references and user-message navigation. References use the existing prompt metadata field and append their stable IDs to model-visible text; the displayed message keeps the readable title. No server or generated-client changes are required.

Verification

# packages/app
bunx playwright test e2e/regression/composer.spec.ts --workers=1
bun run test

# packages/session-ui
bun run test

# Repository root
bun run lint:changed
bun run check

Verified on Linux: 14 composer E2E tests, 742 app unit tests, 168 app browser tests, and 249 session-ui tests pass. The new session-mention regression fails on the baseline and passes with the change. Changed-file lint and all 36 repository check tasks pass. The regression covers title changes and navigation to the referenced session.


Added by the opencode bot (AI-generated).

Related: #53933

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This works as described. On the base, typing @ in the web app shows nothing for sessions. With this change it lists the other open tab and the running session, inserts the mention, and the sent message shows a clickable link. The 14 composer E2E tests, the composer unit tests, the 249 session-ui tests, and tsgo -b in both packages all pass. Before/after screenshots are below.

The public API is unchanged. This only adds a sessions entry to the app's own prompt metadata and draft storage, with no server, SDK, or plugin changes.

Two points inline: any bare ses_… ID in a user message now becomes a link, which the description doesn't mention, and session reference lines get appended to slash-command arguments.

The model only receives the referenced session's ID. No built-in tool lets it read that session's messages, so the reference is useful mainly as a pointer for now.

Related: #53933

Before

After

After

)
}

const bareSessionID = /(?<![A-Za-z0-9_])ses_[A-Za-z0-9]{26}(?![A-Za-z0-9_])/g

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This turns any bare ses_ + 26-character token in any user message into a navigation button, including messages sent from other clients or pasted logs. The ID may belong to a deleted session or one on another server, and clicking it navigates there anyway. The description only covers mentions inserted from the composer. Could this be limited to the structured sessions metadata, or split into its own change?

Comment thread packages/app/src/composer/submit.ts Outdated
sessionID: session.id,
name: command.command,
text: command.arguments,
text: [command.arguments, ...request.sessions.map(formatSessionReference)].filter(Boolean).join("\n"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Appending Referenced session "…": \ses_…`lines tocommand.argumentschanges what$ARGUMENTS/ positional$1..$n` expand to in command templates. A template that quotes or splits its arguments will get this extra text mixed in. Is this intended, or should references for commands be passed some other way (or dropped)?

@kitlangton

Copy link
Copy Markdown
Contributor Author

Superseded by #57480, which shipped @-mentioning sessions with linked chips.

@kitlangton kitlangton closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant