Skip to content

Conversation

@chris-freeman-glean
Copy link
Contributor

Summary

  • Adds a new migration guide for customers using custom frontends to adopt deep-linked (direct-quote) citations in their Chat API implementations
  • Updates sidebar navigation to include the new guide under Guides > Chat

Content Overview

The guide covers:

  • Overview: What deep-linked citations are and backward compatibility
  • Prerequisites: Agentic Loop runtime and supported LLM configurations
  • Response Format: Baseline structure and new referenceRanges[].snippets[] field
  • Migration Options: Minimal (just update types) vs Full (render hover previews)
  • Code Examples: TypeScript/React implementation with pseudocode alternative
  • UX Guidelines: When users see snippets, limitations, graceful fallback
  • Backward Compatibility: Chat V2 → Agentic Loop migration context
  • Migration Checklist: Step-by-step adoption guide

Test plan

  • Run pnpm start and verify the page loads at /guides/chat/deep-linked-citations
  • Verify sidebar navigation shows "Deep Linked Citations" under Chat
  • Review code examples for accuracy
  • Verify all MDX components render correctly (Cards, Steps, Tabs)

🤖 Generated with Claude Code

Add documentation for customers using custom frontends to adopt
deep-linked (direct-quote) citations in their Chat API implementations.

The guide covers:
- Overview of deep-linked citations feature
- Prerequisites (Agentic Loop, supported LLM configs)
- Response format changes (new referenceRanges[].snippets[] field)
- Minimal migration (backward compatibility)
- Full migration with code examples (TypeScript/React)
- Fetching document content via /getdocuments API
- UX guidelines and limitations
- Migration checklist

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@vercel
Copy link

vercel bot commented Dec 16, 2025

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

Project Deployment Review Updated (UTC)
glean-developer-site Ready Ready Preview, Comment Dec 17, 2025 4:02pm

Move deep-linked citations guide from Chat to a new Migration Guides
category under Guides, providing a dedicated section for migration
documentation.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
chris-freeman-glean and others added 2 commits December 16, 2025 13:32
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@david-hamilton-glean
Copy link
Member

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

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.

ℹ️ 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 on lines 123 to 125
| `snippets[]` | **New**: An array of direct-quote snippets from the source document that support the statement. |
| `snippet.text` | The quoted text from the source document. |
| `snippet.pageNumber` | Optional page number where the snippet appears. |

Choose a reason for hiding this comment

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

P2 Badge Remove undocumented snippet.pageNumber guidance

The new guide tells integrators that referenceRanges[].snippets[] include snippet.pageNumber and recommends regenerating client types to pick it up, but the published SearchResultSnippet schema (e.g., openapi/client/split-apis/chat-api.yaml) does not define a pageNumber property at all—rg "pageNumber" openapi returns no matches—so generated clients will not expose this field and the sample code/type hints here will fail. Please drop or update the pageNumber reference until the API schema actually includes it.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review, but this feedback is incorrect — the pageNumber field does exist in the SearchResultSnippet schema.

Evidence:

  1. Generated Java Client (SearchResultSnippet.java):

    public static final String SERIALIZED_NAME_PAGE_NUMBER = "pageNumber";
    @SerializedName(SERIALIZED_NAME_PAGE_NUMBER)
    private Integer pageNumber;
  2. Generated Go Model (model_search_result_snippet.go):

    PageNumber int32 `json:"pageNumber,omitempty"`
  3. PR that added this field: #176488 - Add page number field to rest_api.SearchResultSnippet

  4. Unit tests confirm usage: TestGetSnippetsFromResult_WithPageNumber and TestGetSnippetsToAttach_WithPageNumbers

The rg "pageNumber" openapi search may have run against a limited subset of files. The field is legitimately part of the schema and actively used in production.

Copy link
Member

@david-hamilton-glean david-hamilton-glean left a comment

Choose a reason for hiding this comment

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

This looks great. Thanks @chris-freeman-glean. There's some feedback inline but the most important one is to get some 👀 from the endpoint owners.

Choose a reason for hiding this comment

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

@chris-freeman-glean if you haven't already, let's get this reviewed by folks who own the endpoint.

- Add release version info (Q4 2025, REST API in Beta)
- Make Agentic Loop prerequisite actionable (set agentConfig.agent)
- Specify supported LLM models (OpenAI/Claude, not Gemini)
- Restructure JSON example with elision for readability
- Fix table path consistency (prefix all with referenceRanges[])
- Fix voice consistency in Full Migration section
- Remove redundant Backward Compatibility section

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

3 participants