Skip to content

feat(github): Show pasted GitHub issue and pull request links as cards - #3429

Merged
BYK merged 3 commits into
mainfrom
feat/github-issue-pr-link-cards
Nov 14, 2026
Merged

BYK merged 3 commits into
mainfrom
feat/github-issue-pr-link-cards

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

The GitHub plugin had a link type only for profile links. A pasted github.com/<owner>/<repo>/issues/<n> or /pull/<n> link fell through to the generic Open Graph web page card, so it looked like any other link. Objects that a GitHub tool had read showed the issue or pull request card.

This adds link types for issue and pull request URLs. They return the same card as github_getIssue and github_getPullRequest: label owner/repo#n, state (open, closed, draft, or merged), and facts such as author, branches, diff stats, assignees, and labels. In running text, the link shows as "Title (#n)" with the card on hover. A link alone on its line shows the full card. It works for pasted links in user messages, for links in replies, and for the owner/repo#n links that formatMarkdown makes. Attaching one of these links also tells the next Turn to read it with github_getIssue or github_getPullRequest.

Access. The App reads the object only after the viewer's linked GitHub account passes the collaborator-permission check for the repository. A transferred issue or a renamed repository redirects, so the repository in the response's html_url must pass the check too. That check moved out of images.ts into repository-access.ts, so description images and cards share one check and one 10-minute cache. A viewer with no linked account or no access gets the public web page card, as before (webPageFallback). Object reads are cached for 60 seconds, the same as the card cache. A 404 or 410 means no card.

Pull requests at issue URLs. GitHub opens a pull request at /issues/<n> too, and formatMarkdown links every owner/repo#n to /issues/<n>. Core requires a link type to return its declared object type, so the issue link type cannot return a pull request card. For a pull request at an issue URL, canView returns false and the link keeps the web page card it shows today. Open decision: showing the pull request card there too would need core to allow more than one object type per link type. I left that out of this PR.

Screenshot from dashboard mock mode, with a local mock link that is not in this PR. A user message pastes https://github.com/getsentry/junior/issues/2188, and the mock API resolves it to the card that this link type returns. The card component did not change.

Pasted GitHub issue link with its hover card

via @BYK.

--

View Session [Sentry]

@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 14, 2026 4:13pm UTC

Request Review

@blacksmith-sh

blacksmith-sh Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Found 4 test failures on Blacksmith runners:

Failures

Test View Logs
[chromium] › packages/junior-dashboard/e2e/
conversation-object-links.spec.ts:728:1 › a hover card opens only after a short delay
View Logs
[chromium] › packages/junior-dashboard/e2e/
conversations-event-log.spec.ts:532:1 › mounts only the event log rows near the viewpor
t
View Logs
[chromium] › packages/junior-dashboard/e2e/
conversations.spec.ts:560:1 › shows personal spend and groups profile and session actio
ns
View Logs
packages/junior-dashboard/e2e/conversation-object-links.spec.ts/
a hover card opens only after a short delay
View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

Copy link
Copy Markdown
Contributor

20 screenshot changes — 20 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Conversation Attachment · Desktop
Conversation Attachment · Desktop
Changed
Conversation Child Agents · Desktop
Conversation Child Agents · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Event Log Virtual · Mobile
Conversation Event Log Virtual · Mobile
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Show 12 more changed screenshots
Conversation Memory List Jump · Desktop
Conversation Memory List Jump · Desktop
Changed
Conversation Memory List Jump · Mobile
Conversation Memory List Jump · Mobile
Changed
Conversation Object Links · Desktop
Conversation Object Links · Desktop
Changed
Conversation Object Links Light · Desktop
Conversation Object Links Light · Desktop
Changed
Conversation Question Picks And Text · Desktop
Conversation Question Picks And Text · Desktop
Changed
Conversation Question Stepper · Desktop
Conversation Question Stepper · Desktop
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Conversation Task Line · Desktop
Conversation Task Line · Desktop
Changed
Conversation Text Attachment · Desktop
Conversation Text Attachment · Desktop
Changed
Conversations Pinned · Desktop
Conversations Pinned · Desktop
Changed
Conversations Pinned Light · Desktop
Conversations Pinned Light · Desktop
Changed
Conversations Sections Collapsed · Desktop
Conversations Sections Collapsed · Desktop
Changed

2 more changed screenshots in Frameshift.

@BYK
BYK marked this pull request as ready for review November 14, 2026 19:15
@sentry-junior
sentry-junior Bot requested a review from BYK November 14, 2026 19:15
@BYK
BYK merged commit 2cd9a28 into main Nov 14, 2026
66 of 68 checks passed
@BYK
BYK deleted the feat/github-issue-pr-link-cards branch November 14, 2026 19:16
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 14, 2026

@cursor cursor 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.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit da56508. Configure here.


async function canViewLink(ctx: ObjectLinkContext, url: URL): Promise<boolean> {
const link = parseLink(url);
if (!link || !(await viewerCanSeeRepository(ctx, link))) return false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Renamed repo links skip issue cards

Medium Severity

The collaborator check on a pasted link's owner and repo does not follow GitHub redirects, so a renamed or transferred repository's old URL returns 301 and is treated as no access. readObject never runs, and viewers who can see the new repository keep the generic web page card instead of the issue or pull request card.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit da56508. Configure here.

BYK added a commit that referenced this pull request Nov 14, 2026
## Problem

#3429 added GitHub fakes to
`packages/junior/tests/integration/api/objects.test.ts` that read route
params with dot access, such as `params.login` and `params.number`. The
repository's strict TypeScript settings require index access for
properties that come from an index signature, so `main` no longer
compiles. That blocks every open pull request.

## Fix

Read the 5 params with index access, such as `params["login"]` and
`params["number"]`. Nothing else in the test changes.

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Ab784a61e6351b98fecdafda6e0e72301 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ab784a61e6351b98fecdafda6e0e72301)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ab784a61e6351b98fecdafda6e0e72301/?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]>
sentry-junior Bot added a commit that referenced this pull request Nov 14, 2026
Keep this branch's deletions of NavRail, ConversationSidebar, WaitingChip,
ReviewDeskSidebar, ReviewItemView and review-desk.spec, which main only
touched for strict TS. Apply main's strict TS, type-aware Oxlint and
oxfmt rules to this branch's code. Add its new e2e files to the
type-check coverage baseline with the other dashboard e2e files.

Also index the route params in api/objects.test.ts, which #3429 left
failing the strict typecheck on main.

Co-Authored-By: BYK <[email protected]>
BYK added a commit that referenced this pull request Nov 14, 2026
…k cards (#3441)

Follow-up to #3429. GitHub references already became
links in replies, and the dashboard resolved those links through the
GitHub link types. Two paths still left that system:

- **References in a person's message.** `formatConversationEventText`
ran plugin `formatMarkdown` only on Junior's replies and on provider
Event summaries. User text showed as written, so a typed
`getsentry/sentry#123` stayed plain text with no card, while a pasted
URL in the same message got one. Now a person's message gets the same
formatting as a reply. Raw Event text still shows as written, and only
replies get the bare `@U123` Slack mention rewrite.
- **Pull requests at issue URLs.** `formatMarkdown` links every
`owner/repo#N` to `/issues/N`, because it cannot tell an issue from a
pull request without an API call. A link type could return only its one
declared `objectType`, so for a pull request the issue link type gave up
and the link showed the web page card. Link types now declare
`objectTypes`. The GitHub issue link type declares `["task",
"code_change"]`. When the issues API says the number is a pull request,
it reads the pulls API and returns the pull request card, with its draft
and merge state. `readTool` then names `github_getPullRequest` for that
card.

**Breaking plugin API change.** `PluginObjectLinkDefinition.objectType`
is now `objectTypes`, a non-empty list. Core rejects a card whose type
is not in the list. The Google, Notion, Sentry, and GitHub link types
and the plugin docs are updated. A third-party plugin with `objectLinks`
must rename the field.

This also fixes a strict TypeScript index access (`params.number`) in
the GitHub link card test from #3429.

A person's message that types `#3429`, which is a pull
request, shows the pull request card on hover. The screenshot is from
dashboard mock mode, with a local mock message and card that are not in
this PR:

![Typed PR reference in a user message with its pull request
card](https://junior-prod.sentry.dev/public/artifacts/9ff4ec37-14fb-4f1c-8fe1-4fa3ba12cdff.png)

<!-- junior-request-attribution:start -->
via @BYK.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:local%3Aweb%3A15475efa0b5de36b2fadafd7 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/local%3Aweb%3A15475efa0b5de36b2fadafd7)
[[Sentry]](https://sentry.sentry.io/explore/conversations/local%3Aweb%3A15475efa0b5de36b2fadafd7/?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

1 active deployment
Preview – junior-docs — da56508f Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant