Repository navigation
feat(app): reference sessions from the composer - #54466
kitlangton wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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
| ) | ||
| } | ||
|
|
||
| const bareSessionID = /(?<![A-Za-z0-9_])ses_[A-Za-z0-9]{26}(?![A-Za-z0-9_])/g |
There was a problem hiding this comment.
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?
| sessionID: session.id, | ||
| name: command.command, | ||
| text: command.arguments, | ||
| text: [command.arguments, ...request.sessions.map(formatSessionReference)].filter(Boolean).join("\n"), |
There was a problem hiding this comment.
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)?
3a9d4fb to
5db13d4
Compare
5db13d4 to
9920356
Compare
|
Superseded by #57480, which shipped @-mentioning sessions with linked chips. |



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
@to find other open session tabs and running sessions on the current server, by title or session ID.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
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