Skip to content

Open a peer's shared chat as a local conversation - #1342

Open
Varuas37 wants to merge 30 commits into
mainfrom
cursor/open-shared-chat-4069
Open

Varuas37 wants to merge 30 commits into
mainfrom
cursor/open-shared-chat-4069

Conversation

@Varuas37

@Varuas37 Varuas37 commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Before: A chat a peer has shared sits in the follower's cache, and the conversation list does not open it.

After: The local catalogue owner opens that chat in the existing conversation view and can read the saved transcript, including earlier turns and the files that transcript names, even when this gateway does not have that model. Sending a message is refused and does not reach the grantor. Anyone else is told the chat is not there.

Closes #890

Background

A follower keeps a private cache of the granted conversations it chose to follow. The poller fills that cache. The desktop opens a chat by asking the local gateway for the conversation list and then for that conversation's view.

sequenceDiagram
  participant Person
  participant Follower as Follower gateway
  participant Cedar
  participant Cache as Peer cache
  participant Grantor
  Person->>Follower: Open a granted chat
  Follower->>Cedar: owner.read for the catalogue owner
  Cedar-->>Follower: Allow
  Follower->>Cache: Read the saved transcript
  Cache-->>Follower: The projection the conversation view already uses
  Follower-->>Person: The chat, read only
  Person->>Follower: Scroll to earlier turns
  Follower->>Cache: Page the retained history
  Cache-->>Follower: The earlier page
  Person->>Follower: Open a file the transcript names
  Follower->>Grantor: artifact.read for that one range
  Grantor-->>Follower: The bytes
  Follower-->>Person: The file
  Person->>Follower: Send a message
  Follower-->>Person: Refused
  Note over Grantor: A message is not written there
Loading

The problem

The records are already on the follower, and the conversation view never asks for them. An id the peer did not grant has to look the same as a chat that is not there. Unshare has to take the chat off the local list. A message typed on the follower must not be written on the grantor, and the two conversation databases must stay two databases. A principal who is not the catalogue owner must not learn that the cache holds the chat. An open chat has to move when the cache does, and scrolling back has to read the history the cache already kept. A file the transcript names has to be readable even though the follower has no local conversation row for it.

The solution

conversation.list, conversation.observe, conversation.read, conversation.readEarlier, and the list and conversation subscriptions read the peer cache when the id is not one of this gateway's own conversations. Cedar's owner.list and owner.read admit that read for the registry's catalogue owner. The view is the cache's saved projection, with read-only capabilities. Earlier turns are paged from that same retained fold. When the grantor's model is not in this catalog, the transcript still renders and the saved selection is kept; the runtime display facts the catalog would have supplied are left off. A command that would change a chat the caller may read is refused before anything is saved, and nothing is sent to the grantor. A caller Cedar does not admit is answered as if the conversation were missing. A paired device of the follower, and the owner phone, do not receive these rows.

artifact.read for one of these chats fetches that range from the granting peer. A local conversation still uses its local hold. A file the peer does not hold is attachment_not_found.

A peer cache that cannot be read leaves the page incomplete, so a chat it holds is not treated as gone. Two peers that grant the same conversation id contribute one row, the first peer's.

Replicas are appended only into the room the list (500) or observe page (256) has left. A remainder leaves the page incomplete. When the local pass has finished and has no cursor, the page carries one in the same incarnation and boundary, one creation later, and the next observe returns the chats that did not fit.

The list and an open view both wake when the poller adds, updates, or withdraws a chat, when a follow rule drops the replica, when the peer enrollment ends, or when a peer is forgotten. An incomplete list counts that peer-cache wake even when the local catalogue head does not move.

This is built on current main. Follow (#1344) is already there: the cache holds the chats the follower chose to follow, and this slice opens those. It does not take the peer-write slice (#891) or the same-person pairing work (#893).

How we checked it

  • Two gateways: a Claude chat and a Codex chat are granted, followed, opened from the follower's cache, and named in the list. An unknown id is absent. After unshare, the withdrawn chat leaves the list and cannot be opened. The follower's files do not gain a conversation row, and the grantor's saved records are unchanged. A finished cache read reports the list complete.
  • The owner's product socket: conversation.read returns that view, including its title, with sending turned off. The same read still returns the transcript when the catalog has no agents. conversation.readEarlier returns the retained page for a point in that history, and a point that is not in it is invalid_request. A missing id is not found. Send and create are refused and do not write a local conversation.
  • artifact.read on a granted chat returns the range the peer holds. A file that chat does not hold is attachment_not_found. An id the cache does not hold is not that file.
  • Another principal, with the conversation grants, is told the granted chat is not found, including on conversation.readEarlier. A send on it gets the same refusal as a send on an id that is not there. The list does not name it.
  • A finished 256-row observe page does not grow when one shared chat is waiting. It returns a cursor, and the next observe is that chat and is complete, including when the walk already holds a local cursor. A page with room keeps the chat and stays complete. An incomplete list frame changes when the peer cache wakes and the local head does not.
  • Two replicas of one conversation id become one row, the first peer's. A catalogue read that missed a peer cache stays incomplete even when the rows that were read fit.
  • The pre-push check (pnpm check) passed on this push. The conversation stress plan adds sharedChat (default 1, after the shuffle). The step opens the granted chat in the window, expects capabilities_refused on a composed message, checks that text is not on the grantor, and waits for unshare to drop the row. That step runs in the conversation-stress CI job. It was not run in this environment.
  • The peer-gateway state chart was not revised. Enroll, follow, read, and forget are unchanged. The new read is the existing conversation methods consulting the cache that lifecycle already writes, plus one artifact.read range to the granting peer. docs/design/access-grants.md records that this slice is implemented.

Tradeoffs and follow-ups

The open view is re-read when the peer cache changes. It does not follow the grantor's live subscription frame by frame. A shared chat whose model is not installed here has no context-window or display-name facts. An earlier page's tool cards do not look up MCP tool UIs. Each file range dials the granting peer again. Peer comment and drive stay #891.

Rollout

Nothing special. Alpha has no migration. An older grant store is still refused at startup, as the access-grant refactor already requires.

Open in Web Open in Cursor 

cursoragent and others added 2 commits November 14, 2026 19:11
The owner's conversation list and read serve the cache the poller already
keeps. A write on that chat is refused and is not sent to the grantor.
The conversation metadata file stays separate from the grantor's.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>
The catalogue walk is a while-let. The test double is compiled only for tests.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b5025aeb-2e12-47e7-a23a-37d6b9145d71
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@cursor

cursor Bot commented Nov 14, 2026

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T10:59:15.950966Z 306b20b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4dfb2c86f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

cursoragent and others added 2 commits November 17, 2026 21:26
Cedar's owner.read and owner.list decide who may open a granted chat
from the peer cache. A list or observe page keeps its bound, and the
stress step opens that chat, refuses a composed message, and drops it
when the grantor unshares.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>
Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d3db292ca8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A view subscription wakes when the peer cache changes, and
conversation.readEarlier reads that retained history instead of the
local metadata.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34022a6cac

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…nt ends

A retained transcript still renders when its model is not in the local
catalog. Ending the peer enrollment wakes the list and the open view.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: e9d5f35306

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The stress step asked whether the browser had reconnected after the
restart observation had already ended, so the window never counted as
back and the refused socket stayed on the console check.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbe61acb5c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A later step was taking the first active peer, which can be a grantor
from an earlier step. The step now waits for its own enrollment and
forgets that peer when it finishes.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d78ca9d44

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The last local page was incomplete and had no cursor, so the desktop stopped before the granted chat. The next observe returns the chats that did not fit. An incomplete list also changes when only the peer cache does.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1aed1071af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

artifact.read for a chat that exists only in the peer cache now fetches that range from the peer, after Cedar admits the catalogue owner. A local conversation still uses its local hold.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e82cc26155

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A transcript saved before the read budget ends is already readable, and the failure still backs off.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f97083fbbe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Resetting the offset left the desktop holding a withdrawn chat and then calling the walk complete.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 4441bf4dc4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The credential was not on the follower within ten seconds after the peer step had just restarted linking.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a65df66e15

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The owner check hides the file, because a peer signs in as its own gateway principal.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 16c33861a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

The API list names it before the window subscription does, and the open click only waits fifteen seconds.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6db9a2b67a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

cursoragent and others added 2 commits November 18, 2026 09:27
The poller was applying the same failure list again, so the two copies could drift.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>
The discovery test and the granted-chat test both stay at the end of the peer reading file.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>
@cursor

cursor Bot commented Nov 18, 2026

Copy link
Copy Markdown

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cdf687d541

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

A second 32 KiB ceiling would keep rejecting a range after the published bound moved.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4eac28cb80

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

cursoragent and others added 2 commits November 18, 2026 10:37
The fallback list was a second copy of the mode set, so a new persisted mode could be omitted.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>
A later peer's copy of the same id is not a substitute for the catalogue row that won.

Co-authored-by: Saurav  <saurav.panthee@gmail.com>

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 306b20bcc0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

Open a peer's shared chat as a local conversation

2 participants