Repository navigation
ref(annotations): Stop changing Annotations when a provider object changes - #4334
Merged
BYK merged 14 commits intoNov 25, 2026
Merged
Conversation
An Annotation now stores the subject of its object, in the Inbox form (`<plugin>:<kind>` or a core kind), and what the Conversation did to it: created, changed, or attached. Tool and hook results name the subject and the action, with the kinds that the plugin registers in `inboxSubjects`. The subject replaces `objectId`, and the Inbox owner lookup reads it. A trigger fills both columns for rows that old workers write, and for objects whose provider id is not known. Also adds the Annotations design doc and its terms. Co-Authored-By: BYK <[email protected]>
…' into feat/annotation-subjects Co-Authored-By: BYK <[email protected]>
Cards read the object live, so a merge, a close, or a new pull request body changes no Annotation. The GitHub plugin no longer updates the status of pull request and issue cards, or their preview images, from webhooks and the daily reconcile. A conversation change batch now holds only Inbox item closes. Co-Authored-By: BYK <[email protected]>
…' into feat/annotation-no-status-writes
A core Annotation, such as an Automation card, stores its subject kind without a plugin prefix, so listing it dropped the subject.
Sidebar chips, the Conversation detail, and Slack card details now read each object's title and state live, through the same subject-to-link-to- card resolver as the Inbox. A viewer who cannot read the object, or a failed read, gets only the stored label and link. A delivered Message card reads its object once with the access of the person who started the Conversation, and falls back to the saved facts. The dashboard drops its client-side annotation overlays and renders the server's cards. Preview images come from the live card. Co-Authored-By: BYK <[email protected]>
…' into feat/annotation-live-cards Co-Authored-By: BYK <[email protected]> # Conflicts: # packages/junior/tests/integration/annotation-cards.test.ts
Co-Authored-By: BYK <[email protected]>
…ved label A card no longer shows an Annotation's stored label. It shows the label of the live card, or, when Junior cannot read the object, the label that its link type makes from the link. Link types get an optional `label(url)` method. GitHub issue and pull request links make `owner/repo#n`. A link type without one shows the host of the link. Co-Authored-By: BYK <[email protected]>
… feat/annotation-no-status-writes Co-Authored-By: BYK <[email protected]>
…e detail ETag Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 similar comment
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Cards read their object live, so a merge wrote nothing and an open page kept the old card. Plugins now report a changed object with ctx.annotations.objectChanged(subject). Core moves detail_version of each Conversation that annotates it, so the detail ETag and the versions poll change. It writes no Annotation. GitHub calls it from issue and pull request webhooks when the cached object changed. The detail annotation tests move to their own file. Co-Authored-By: BYK <[email protected]>
A check event marks the checks pending, a review clears the cached decision, and a patch fills in merge state and check counts. Each now calls objectChanged when it changes the entry, as pull request and issue webhooks do. The patch read asks GitHub for the pull request id.
BYK
approved these changes
Nov 25, 2026
Base automatically changed from
feat/annotation-live-cards
to
feat/github-issue-assignee-items
November 25, 2026 21:53
…' into feat/annotation-no-status-writes # Conflicts: # packages/junior-github/src/pull-request-outcomes/apply.ts # packages/junior/tests/integration/api/conversations/detail.test.ts
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 344ea5c. Configure here.
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.

Cards now read their object live (#4332), so a merge or close at the provider no longer needs to touch the Annotation. This PR deletes those writes. A change at the provider now writes nothing to Annotations.
Removed
pull-request-outcomes/apply.ts,reconcile.tsandapply-task.tsno longer update the GitHub Annotation's status.webhooks/issue-outcome.tsand its call inwebhooks/handler.ts.webhooks/pull-request-preview.ts. The live PR card already includes the preview images from the PR body.updateGitHubAnnotations,githubAnnotationChangeandgithubStatusAnnotationfromjunior-github/src/annotations.ts.ConversationChangeBatch.annotationsandConversationAnnotationChangefrom the plugin API, and the core code that applied them (chat/plugins/conversation-changes.ts). The batch section ofbuild-a-plugin.mdis updated.Open pages stay current
Before, the webhook write moved the Conversation's version, so an open page and the versions poll read the new state. Without the write, they kept the old card.
ctx.annotations.objectChanged(subject). Core movesdetail_versionof each Conversation that annotates that subject (touchAnnotatedConversations, which uses the subject index). The detail ETag and the versions token then change, and the page reads the live card again. It writes no Annotation.issuesandpull_requestwebhooks, with GitHub's id from the payload, only when the cached object changed. A redelivery moves nothing.linksubjects) aren't matched until the rename backfill gives them one.build-a-plugin.mddocuments the call next tocacheCards: false.Also
annotationFromRowreturns the subject of core Annotations (automation) too. It used to drop it because theirsubject_kindhas no plugin prefix.detail-annotations.test.ts, to keepdetail.test.tsunder the file length limit.The saved JSON copy stays until the facts-drop PR, so the "keeps a copy" Gap line stays for now.
via @BYK.
--
View Session [Sentry]