Repository navigation
feat(annotations): Find Annotations by subject in search and filters - #4340
Merged
BYK merged 4 commits intoNov 25, 2026
Merged
Conversation
Dashboard search matches the stored title, key, and link of an Annotation. A typed `<repository>#<number>` reference, or a link that a plugin link type names that way, resolves to a code change subject through the code change records, which follow repository renames. So a renamed repository's pull request is found by its new name without a provider call. The searchConversations and Slack message search `annotation` filters use the same resolution. Plugin `conversations.search` takes the object's subject instead of a key, and github_getPullRequest finds related conversations by the pull request's GitHub id. Co-Authored-By: BYK <[email protected]>
…' into feat/annotation-subject-search Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A word that every link holds, such as pull or github.com, matched each annotated Conversation.
BYK
approved these changes
Nov 25, 2026
…' into feat/annotation-subject-search # Conflicts: # packages/junior-plugin-api/src/tools.ts
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f256fe0. Configure here.
BYK
pushed a commit
that referenced
this pull request
Nov 25, 2026
…4386) Follow-up to #4340. `github_getPullRequest` finds `related_conversations` by the pull request's subject (`github:pull_request` + GitHub's id). A card attached from a pasted link can lack GitHub's id, so its Annotation's subject is the core `link` kind with the link. Those Conversations dropped out of `related_conversations`, even when the repository name did not change. Plugin `conversations.search` now also takes the object's `url`. Core matches it, case-insensitively, against the stored link and the key, in addition to the subject. `github_getPullRequest` passes the pull request's `html_url`. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3Acc073f0ef328a6593b0845d156272adf --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3Acc073f0ef328a6593b0845d156272adf) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Acc073f0ef328a6593b0845d156272adf/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
BYK
added a commit
that referenced
this pull request
Nov 26, 2026
Fixes #4374 Live object cards now read through one HTTP cache that core owns. Before, each provider cached in its own way. A card that a cache serves after its TTL, because a read failed, shows "Last fetched …" again. ## HTTP cache in core `chat/egress/http-cache.ts` keeps provider GET responses in the state adapter. - **Key:** each entry is keyed by credential scope, URL, and `Accept`. Egress entries use the egress credential context as the scope, so a viewer never gets another viewer's entry, and the system Actor never shares one with a viewer. Viewers do share the system Actor's entry for app-credential reads, because those reads are the same for everyone. - **Fresh entries:** within its TTL, an entry serves with no request. - **Stale entries:** an entry past its TTL asks the provider again with `If-None-Match` / `If-Modified-Since`. A `304` stores the entry again. - **Errors:** a network error or 5xx serves the last entry when the link type allows stale. Any other non-200 deletes the entry, so a credential that lost access can never be served it later. - **Limits:** entries stay for TTL + 6 h, and bodies over 256 KiB are not saved. - **Link types:** each link type sets `httpCache: { ttlMs, staleIfError? }` on its definition. The default is 60 s with stale on error. - **Access checks:** `resolveObjectLinkNow` and `viewerCanViewPluginLink` read with TTL 0 and no stale, so a change of access counts at once. The module header states what a breach of this store exposes: up to 6 h of provider reads (card data and plugin webhook reads such as pull requests, commit authors, and collaborator roles), and no token. ## Plugin API - `RouteRegistrationHookContext.httpCache` (`PluginHttpCache`) is for reads with a token that the plugin minted, such as webhook reads. Plugin scopes are namespaced per plugin and never serve stale. - `cacheCards` flips from an opt-out (`false`) to an opt-in (`true`). Only link types that read their provider without egress keep the per-viewer card cache: Slack and Conversation in core, Notion, and Linear (through `viewerMcp`). ## GitHub - Webhook reads go through `ctx.httpCache` with scope `installation:<id>`, TTL 0, and no stale (`installation-http-cache.ts`). `conditional-requests.ts` is deleted. Token narrowing does not change. - GitHub cards read with HTTP TTL 0 and no stale. The object cache and its webhook invalidation stay the freshness layer, so a stale body never gets stored as a fresh object entry. An object-cache entry served after its TTL also sets `fetchedAt`. ## "Last fetched" - `OwnedObjectAnnotation.fetchedAt` is set only when a cache served an entry past its TTL. Its value is the oldest such entry's store time. - The full card footer shows "Last fetched …" when `fetchedAt` is set, so the client needs no TTLs. | | Light | Dark | | --- | --- | --- | | Desktop |  |  | | Mobile |  |  | (Mock dashboard, Notion page card served with a 3-hour-old `fetchedAt`.) ## Linear Whichever of this PR and #4331 landed second adds the `cacheCards` opt-in for Linear's link type. #4331 landed first, so this PR adds it in its own commit, with a stale-on-error test. ## Base This PR targets `feat/github-issue-assignee-items`, because the Annotations stack (#4334, #4340, #4351, #4356) and Linear live cards (#4331) are merged there. It brings that branch in with a merge commit. <!-- junior-request-attribution:start --> via @BYK. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A405f29e35c9132aca395b41d3747e969 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A405f29e35c9132aca395b41d3747e969) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A405f29e35c9132aca395b41d3747e969/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: BYK <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Search and object filters now find an Annotation by its subject, so a pull request in a renamed repository is still found by its new name.
Search text to subject
resolveAnnotationFilter(chat/conversations/sql/annotation-filter.ts) turns text that names an object into a filter, without a provider call:label(url)names the object from the link alone, such asowner/repo#12.<repository>#<number>reference, typed or from a link label, is looked up in the code change records. Webhooks and the name repair keep the repository name current there, so the result is the code change's provider id. That is the subject id of eachcodeChangesubject kind of the plugin (github:pull_request).No new plugin hook: the code change records and the link labels already hold what is needed.
Where it applies
api/conversations/list.ts) matches the stored title, key, and link (no longerlabel), or the resolved subjects. The stored title and link are read throughstoredAnnotationTitle/storedAnnotationUrl, so a later change can point them at columns.searchConversationsand the Slack message searchannotationfilter match the key (exact, or nested children after#), the stored link, or the resolved subjects. The param names stay the same. Their descriptions now say that a link works too.conversations.searchtakes{ subject }in place of{ annotation }and matches(subject_kind, subject_id).github_getPullRequestpasses the pull request's GitHub id, sorelated_conversationssurvives a repository rename.codeChangeSubjectKindsmoved from the Inbox search tosubject-links.tsso both searches use it.findObjectLinkTypeis now generic over the link type shape.Left as is
api/objects/attach.tsstill deduplicates an attach by key or link. A card read from a link has no provider id (the object cache does not keep one), so it cannot compare subjects.cards.ts,pending-cards.ts) and the Annotation upsert and remove use the key, because that is the Annotation's identity inside one Conversation, not an object lookup.Limits
A GitHub issue, or a pull request that Junior did not record as a code change, has no entry in the code change records. Without a provider read, a renamed repository's issue is found only by its old key, link, or title.
PluginConversationToolContext.searchis a breaking change for plugins that call it withannotation. The only caller in this repo isgithub_getPullRequest.via @BYK.
--
View Session [Sentry]