Skip to content

🔀 feat: Show the Conversation Pull Request in the Chat Header - #16794

Merged
berry-13 merged 4 commits into
devfrom
berry-13/pull-request-chip
Oct 6, 2026
Merged

berry-13 merged 4 commits into
devfrom
berry-13/pull-request-chip

Conversation

@berry-13

@berry-13 berry-13 commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The backend can now say which pull request a code conversation opened, but nothing shows it. This adds the pull request to the chat header for a conversation whose branch has one.

Desktop. A chip sits with the left header controls, right after the model selector: the agent's picture with a CI status dot on its corner (green passing, red failing, amber running, none when the repository has no checks), the pull request icon, and the truncated title. The icon is green for an open pull request with no conflicts, red for one with merge conflicts, and neutral for a draft, with their own icons for merged and closed. When the agent has no picture the dot sits on the icon. Hovering or focusing the chip opens a card to its right that slides in from the left (it only fades under reduced motion). The card shows the number, added and removed lines, an "Open in GitHub" link (target=_blank, rel="noopener noreferrer"), and State and Checks badges. It stays open while the pointer or focus is inside it and closes shortly after both leave.

Small screens. There is no room for the chip, so the pull request is an entry in the header's three-dots menu, in its own group before Share and Export. It opens the same card in a dialog and follows the dialog-item contract (hideOnClick: false, item ref, button render, dialog triggerRef), so focus returns to the entry on close.

The header renders nothing while loading, for a conversation without a pull request, with the feature off, or when the first lookup fails, so it never shifts. If a later refresh fails, the last known pull request stays and the card says so with a retry button. Colors are semantic status-* roles only, and state is also written in text so color is never the only signal. Polling is every 20 seconds while checks run or mergeability is unknown, every minute otherwise, and stops for merged or closed pull requests. It is not shown on subagent threads.

It does nothing until endpoints.agents.pullRequests is enabled and a worker reports a branch.

Type of change

  • Feature

Testing

Tested environments/configuration:

  • Browser: headless Chromium (Playwright) against the dev server from lc run, logged in as the dev account, at 1280x720 and 390x844, light and dark, on head 6dc3fd86d.
  • Stubbed in the browser: the pull request endpoint, the startup config's pullRequestsEnabled flag, and one agent with a picture (so the avatar layout is exercised). No real worker or GitHub token was involved.

Checked in the browser:

  • Desktop: the chip is 224x36 and sits with the left header controls. The card opens to its right (x=850, chip ends at x=841), is absent before hover, and is gone after the pointer leaves. The overflow menu is not visible at this width.
  • Avatar and dot: with an agent picture the chip shows the 24x24 picture with an 8x8 CI dot on its corner, green for passing, red for failing, amber for running, and no dot for no checks, merged or closed.
  • Icon colors from computed styles: green for open and ready, red for merge conflicts, neutral for draft and merged.
  • Small screen: no chip in the header. The three-dots menu has a PR #1234 entry, the dialog shows the card with the GitHub link, and Escape closes it.

Automated tests: the header, menu, chip, card, status and query specs pass under both NODE_ENV=development (what CI runs) and test. npx tsc --noEmit in client exits 0, lc lint is clean, npm run static-checks -- --against origin/dev passes, and CI is green at this head. Mutation checks on the placement, menu entry, hover and focus behavior, polling, badges and tooltip layer each failed their intended test. Only English strings were added.

Screenshots / recordings

Captured from the running app with the endpoint, startup flag and agent stubbed. Each desktop image shows the chip and its open card; the mobile images show the menu entry and the dialog.

Risk / compatibility

None for existing chats while endpoints.agents.pullRequests stays off: the startup config then does not advertise the feature and the client never calls the endpoint. Not checked: a real worker and token, a touch device, and the screenshots by eye (the numbers above come from computed styles and element boxes).

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors
  • User-facing or complex behavior is documented where necessary
  • Required dependency changes have been merged/published
  • Required documentation PR: N/A

Desktop, light: open, no conflicts, checks passing (green icon, green dot on the agent picture), card open to the right

Desktop, dark: open, no conflicts, checks passing

Desktop, light: merge conflicts (red icon), checks failing (red dot)

Desktop, dark: merge conflicts, checks failing

Desktop, light: draft (neutral icon), checks running (amber dot)

Desktop, dark: draft, checks running

Small screen, light: PR entry in the three-dots menu

Small screen, dark: PR entry in the three-dots menu

Small screen, light: the card in a dialog

Small screen, dark: the card in a dialog

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-06T09:27:27.527553Z 6dc3fd8 New commits
🔒 Security Review ✅ Completed 2026-10-05T21:43:34.069051Z 8fe2cba PR opened
ℹ️ 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.

@codegraph-librechat codegraph-librechat Bot added the 🗺️ Chat Frontend codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) label Oct 5, 2026
@berry-13
berry-13 added this pull request to stack #16796 October 5, 2026 21:57
@berry-13
berry-13 force-pushed the berry-13/pull-request-chip branch from 8fe2cba to 5f42256 Compare October 5, 2026 22:02
Copilot AI balanced review requested due to automatic review settings October 5, 2026 22:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Lighthouse CI failed. The last 80 log lines contain the measured budgets and assertion failures.


[WebServer] 2026-10-05 22:04:29 warn: RAG API is either not running or not reachable at http://127.0.0.1:8791, you may experience errors with file uploads.

[WebServer] 2026-10-05 22:04:30 info: [StreamServices] Created in-memory stream services

[WebServer] 2026-10-05 22:04:30 info: [GenerationJobManager] Configured with in-memory stores

[WebServer] 2026-10-05 22:04:30 info: HTTP server timeout configuration

[WebServer] 2026-10-05 22:04:30 info: Server listening at http://localhost:3080

[WebServer] 2026-10-05 22:04:30 info: [MCPServersRegistry] Creating new instance

[WebServer] 2026-10-05 22:04:30 info: OAuth reconnect manager initialized successfully.

[WebServer] 2026-10-05 22:04:30 info: Created collection: projects

🤖: global setup has been started
🤖: using baseURL http://localhost:3080
🤖: using E2E user: testuser@example.com
[WebServer] 2026-10-05 22:04:33 info: [agent-triggers] durable delivery engine started

[WebServer] 2026-10-05 22:04:33 info: [schedules] engine started

[WebServer] 2026-10-05 22:04:33 info: Server readiness checks passing.

🤖: 🗝  authenticating user: testuser@example.com
🤖: ✔️  localStorage: set Nav as Visible /home/runner/work/LibreChat/LibreChat/e2e/storageState.json
🤖: ✔️  user successfully registered
[WebServer] 2026-10-05 22:04:46 info: [Login] [Login successful] [Username: testuser@example.com] [Request-IP: ::1] {"requestId":"d64dc948-92a5-40ea-a7e5-ce6defcf3aa3","request_id":"d64dc948-92a5-40ea-a7e5-ce6defcf3aa3","request_method":"POST","request_path":"/api/auth"}

🤖: ✔️  user successfully authenticated
🤖: ✔️  authentication state successfully saved in /home/runner/work/LibreChat/LibreChat/e2e/storageState.json
🤖: global setup has been finished

Running 1 test using 1 worker

[1/1] [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets
[chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets
Lighthouse run 1/3 attempt 1 did not complete, retrying: Command failed: /opt/hostedtoolcache/node/24.16.0/x64/bin/node /home/runner/work/LibreChat/LibreChat/node_modules/lighthouse/cli/index.js http://localhost:3080/c/16390000-0000-4000-8000-000000000001 --quiet --preset=desktop --throttling-method=provided --only-categories=performance --chrome-flags=--headless=new --extra-headers={"Cookie":"token_provider=librechat; refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhYzQxZWZhODEzMzNjNGQ3NzlhYWZhYyIsInNlc3Npb25JZCI6IjZhYzQxZjAyODEzMzNjNGQ3NzlhYWZjZCIsImlzc3VlZEF0TXMiOjE3OTEyMzc4OTAzMjcsImlhdCI6MTc5MTIzNzg5MCwiZXhwIjoxNzkxMjQxNDkwfQ.55IGzYKq8fRsTpHNK7EBQdh2m8_NYhQ3rEZAn5p6ysE"} --output=json --output=html --output-path=/home/runner/work/LibreChat/LibreChat/.lighthouse/lhr-1

  1) [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets 

    Error: Command failed: /opt/hostedtoolcache/node/24.16.0/x64/bin/node /home/runner/work/LibreChat/LibreChat/node_modules/lighthouse/cli/index.js http://localhost:3080/c/16390000-0000-4000-8000-000000000001 --quiet --preset=desktop --throttling-method=provided --only-categories=performance --chrome-flags=--headless=new --extra-headers={"Cookie":"token_provider=librechat; refreshToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjZhYzQxZWZhODEzMzNjNGQ3NzlhYWZhYyIsInNlc3Npb25JZCI6IjZhYzQxZjAyODEzMzNjNGQ3NzlhYWZjZCIsImlzc3VlZEF0TXMiOjE3OTEyMzc4OTAzMjcsImlhdCI6MTc5MTIzNzg5MCwiZXhwIjoxNzkxMjQxNDkwfQ.55IGzYKq8fRsTpHNK7EBQdh2m8_NYhQ3rEZAn5p6ysE"} --output=json --output=html --output-path=/home/runner/work/LibreChat/LibreChat/.lighthouse/lhr-1
    Runtime error encountered: Something went wrong with recording the trace over your page load. Please run Lighthouse again. (NO_NAVSTART)


    attachment #1: screenshot (image/png) ──────────────────────────────────────────────────────────
    e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/test-failed-1.png
    ────────────────────────────────────────────────────────────────────────────────────────────────

    Error Context: e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/error-context.md

    attachment #3: trace (application/zip) ─────────────────────────────────────────────────────────
    e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/trace.zip
    Usage:

        npx playwright show-trace e2e/lighthouse/.test-results/load-serial-database-latency-stays-within-web-vitals-budgets-chrome/trace.zip

    ────────────────────────────────────────────────────────────────────────────────────────────────


🤖: global teardown has been started
2026-10-05 22:06:04 �[32minfo�[39m: �[32mMongo Connection options�[39m
2026-10-05 22:06:04 �[32minfo�[39m: �[32m{�[39m
�[32m  "bufferCommands": false�[39m
�[32m}�[39m
🤖:  ✅  Connected to Database
🤖:  ✅  Found user in Database
🤖:  ✅  Deleted 1 convos & 2 messages
🤖:  ✅  Deleted user from Database
🤖: global teardown has been started
2026-10-05 22:06:05 �[32minfo�[39m: �[32mMongo Connection options�[39m
2026-10-05 22:06:05 �[32minfo�[39m: �[32m{�[39m
�[32m  "bufferCommands": false�[39m
�[32m}�[39m
🤖:  ✅  Connected to Database
🤖:  ⚠️  User not found in Database
  1 failed
    [chrome] › e2e/lighthouse/load.spec.ts:10:5 › serial database latency stays within web-vitals budgets 

Open the full run

@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: 5f42256192

ℹ️ 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".

Comment thread client/src/data-provider/PullRequest/queries.ts
Comment thread client/src/data-provider/PullRequest/queries.ts Outdated
Comment thread client/src/components/Chat/PullRequest/Card.tsx Outdated
Comment thread client/src/components/Chat/PullRequest/Card.tsx
@berry-13
berry-13 force-pushed the berry-13/pull-request-chip branch from 5f42256 to b5080c3 Compare October 6, 2026 07:52
Base automatically changed from berry-13/pull-request-backend to dev October 6, 2026 07:56
A header chip shows the pull request a code conversation opened: the agent picture with a CI status dot, the pull request icon and a truncated title. It opens a card with the number, added and removed lines, a link to GitHub, and state and checks badges. The chip renders nothing while loading, when there is no pull request, or when the first lookup fails.
@berry-13
berry-13 force-pushed the berry-13/pull-request-chip branch from b5080c3 to 7492a35 Compare October 6, 2026 07:56
…It to the Overflow Menu on Small Screens

On desktop the chip sits with the left header controls and its card opens to the right as an Ariakit hovercard that slides in from the left, on hover or keyboard focus. Small screens offer the same card from the header overflow menu through a dialog, following the dialog-item contract.
…tip Layering

Advertise pullRequestsEnabled in the startup config and skip the lookup without it, keep polling a finished pull request while its checks run, render the card badges with the shared Chip, and portal the GitHub tooltip into the card's own layer.

@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: f0f90fac20

ℹ️ 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".

Comment thread client/src/components/Chat/PullRequest/menu.tsx Outdated
Comment thread client/src/components/Chat/PullRequest/menu.tsx Outdated
Comment thread client/src/components/Chat/PullRequest/Chip.tsx Outdated
…and Chip

Scope the mobile dialog to the conversation it opened for and expose dialog semantics on its menu entry, only use the chat agent's avatar for the routed conversation, and make the hover tests move the pointer the way a browser does so they pass under NODE_ENV=development as CI runs them.
@berry-13
berry-13 merged commit abed1a2 into dev Oct 6, 2026
45 checks passed
@berry-13
berry-13 deleted the berry-13/pull-request-chip branch October 6, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗺️ Chat Frontend codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants