Skip to content

docs: product version badges, section-aware GitHub stars, OG cards, Python SDK#7

Merged
khaliqgant merged 3 commits into
mainfrom
docs/relayfile-versions-python-sdk
Jun 24, 2026
Merged

docs: product version badges, section-aware GitHub stars, OG cards, Python SDK#7
khaliqgant merged 3 commits into
mainfrom
docs/relayfile-versions-python-sdk

Conversation

@khaliqgant

@khaliqgant khaliqgant commented Jun 24, 2026

Copy link
Copy Markdown
Member

Follows up the Relayfile/Relayloop docs with versioning, header/OG accuracy, and the Python SDK.

Changes

  • Sidebar version badge per product section — Relayfile v0.10.12, Relayloop v0.3.6 (latest ai-hist release). Sourced from the actual repos.
  • Section-aware GitHub stars in the docs header — AgentWorkforce/relayfile under /docs/file, AgentWorkforce/relayhistory under /docs/loop, agentworkforce/relay everywhere else. Counts fetched server-side (1h revalidate); a client component picks by path. The ~17 marketing pages keep the default badge.
  • Product OG cards/docs/file/* and /docs/loop/* now render their own Open Graph cards (Relayfile/Relayloop eyebrow + doc title) instead of inheriting the site-wide "Headless Slack for Agents" default.
  • Python SDK page — documents the real, now-published relayfile-sdk (v0.2.1 on PyPI): RelayFileClient / AsyncRelayFileClient reads & writes and the on_write subscription helper.

Notes

  • The Relayfile Python SDK was published to PyPI as relayfile-sdk 0.2.1 (via the repo's Publish Python SDK workflow) — this PR documents it.

🤖 Generated with Claude Code


Summary by cubic

Adds per-product version badges, section-aware GitHub stars, and product OG cards, plus a new Python SDK page for relayfile-sdk. The TOC shows product versions and hides the Agent Relay switcher; the Relayfile intro connect example now follows the Language toggle with a Python tab.

  • New Features
    • Show product versions in the sidebar and TOC (Relayfile v0.10.12, Relayloop v0.3.6); hide the Agent Relay version switcher on /docs/file/* and /docs/loop/*.
    • Header GitHub stars switch by section: AgentWorkforce/relayfile under /docs/file, AgentWorkforce/relayhistory under /docs/loop, agentworkforce/relay elsewhere (server-fetched, 1h cache).
    • Product OG cards for /docs/file/* and /docs/loop/* with a section eyebrow and doc title.
    • Python SDK: new docs for relayfile-sdk (v0.2.1) covering RelayFileClient, AsyncRelayFileClient, and on_write; the Relayfile intro connect example now follows the Language toggle (TypeScript/Python).

Written for commit e8605ba. Summary will update on new commits.

Review in cubic

…hon SDK

- Sidebar version badge per product section: Relayfile v0.10.12,
  Relayloop v0.3.6 (from the latest ai-hist release)
- GitHub stars badge follows the active docs section: relayfile under
  /docs/file, relayhistory under /docs/loop, relay elsewhere
- Product docs get their own OG cards (Relayfile/Relayloop eyebrow)
  instead of inheriting the "Headless Slack for Agents" default
- Add Relayfile Python SDK page (relayfile-sdk, RelayFileClient + on_write)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@khaliqgant, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 54 minutes and 12 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 35abc61a-2dca-42c7-bad8-82894edafe5f

📥 Commits

Reviewing files that changed from the base of the PR and between 6615aa5 and e8605ba.

📒 Files selected for processing (1)
  • web/content/docs/file/introduction.mdx
📝 Walkthrough

Walkthrough

This PR adds statically generated Open Graph image routes and metadata for file and loop doc pages, introduces a section-aware GitHub Stars badge that replaces the single-repo badge in the docs layout, adds version pill badges in the sidebar and table of contents, registers a Python SDK nav entry with icon, and publishes the Python SDK documentation page.

Changes

Docs Enhancements: OG images, stars badge, version badges, Python SDK

Layer / File(s) Summary
ProductDocSection version field and Python SDK nav entry
web/lib/product-docs-nav.ts
Adds optional version field to ProductDocSection, sets '0.10.12' for fileSection and '0.3.6' for loopSection, and adds a python-sdk nav item to the file section.
Python SDK documentation content
web/content/docs/file/python-sdk.mdx
New MDX page covering installation, RelayFileClient/AsyncRelayFileClient construction, read/write APIs with optimistic concurrency, on_write subscriptions, path helpers, and "Where to go next" navigation cards.
Version badge UI in DocsNav and TableOfContents
web/components/docs/docs.module.css, web/components/docs/DocsNav.tsx, web/components/docs/TableOfContents.tsx
Adds .versionStatic and .productHeaderVersion CSS classes, registers the SiPython icon for python-sdk, conditionally renders a version badge in the product header, and replaces the unconditional DocsVersionSelect in the TOC with a static version display when productSection.version exists.
Per-section GitHub Stars badge
web/components/DocsGitHubStarsBadge.tsx, web/components/GitHubStars.tsx, web/app/docs/layout.tsx
Introduces DocsStarRepo type and DocsGitHubStarsBadge client component that selects the active repo by pathname; parameterizes getGitHubStars for multiple repos; adds DocsGitHubStarsBadgeServer that fetches counts in parallel; wires it into the docs layout replacing GitHubStarsBadge.
Static OG image route handlers
web/app/docs/file/[slug]/og.png/route.tsx, web/app/docs/loop/[slug]/og.png/route.tsx
Adds force-static Node.js OG image routes for both doc sections, precomputing static params per slug and returning ImageResponse with DefaultVariant using brand fonts, doc title/description, and section eyebrow.
OG and Twitter metadata in doc pages
web/app/docs/file/[slug]/page.tsx, web/app/docs/loop/[slug]/page.tsx
Extends generateMetadata in both page routes to include openGraph and twitter fields using the per-doc og.png path via the ogImage helper.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 Hop hop, the docs are dressed to impress,
OG images baked with static finesse,
A Python SDK guide joins the crew,
Version badges glinting, shiny and new,
Stars count per section, each repo in line—
The warren of docs is looking just fine! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main docs updates: version badges, section-aware stars, OG cards, and the Python SDK page.
Description check ✅ Passed The description is clearly aligned with the changeset and matches the documented docs updates in the PR.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/relayfile-versions-python-sdk

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Preview deployed!

Environment URL
Web https://d4117c40-agentrelay-web.agent-workforce.workers.dev

This is a Cloudflare Workers preview version of this PR's build.

@agent-relay-code

Copy link
Copy Markdown
Contributor

pr-reviewer could not complete review for #7 in AgentWorkforce/agentrelay.com.
The review harness exited with code 137.
No review was posted; this needs operator attention.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Review of PR #7docs/relayfile-versions-python-sdk

This is a docs/web PR for agentrelay.com. It adds: per-doc OG cards for Relayfile/Relayloop docs (og.png route handlers), a section-aware GitHub stars badge in the docs header, sidebar version badges, a Python SDK doc page, and the python-sdk nav entry/icon.

What I verified against the current checkout

  • OG route → metadata path consistency. New routes live at web/app/docs/file/[slug]/og.png/route.tsx and web/app/docs/loop/[slug]/og.png/route.tsx. The page metadata builds ogPath = /docs/${SECTION_ID}/${slug}/og.png, where SECTION_ID is fileSection.id ('file') / loopSection.id ('loop') — so the emitted OG URLs map exactly onto the new route segments. ✅
  • Helper imports. DefaultVariant, loadBrandFonts, OG_SIZE exist in web/lib/og/template.tsx; ogImage in web/lib/og-meta.ts; getProductDoc/getProductDocSlugs in web/lib/product-docs.ts; fileSection/loopSection/productSections/getProductSectionForPath in web/lib/product-docs-nav.ts. All resolve. ✅
  • Stars badge wiring. DocsGitHubStarsBadgeServer (server) fetches per-section counts and hands DocsStarRepo[] to the client DocsGitHubStarsBadge; count: counts[i] (string | null) matches the DocsStarRepo.count type. The CSS classes it uses (badge, meta, divider, count) all exist in github-stars.module.css. The old GitHubStarsBadge is still exported and still consumed by ~18 other pages, so swapping only the docs layout doesn't break them. ✅
  • SiPython icon is imported in DocsNav.tsx:34 and used at DocsNav.tsx:63 for the new python-sdk slug. ✅
  • version? field is optional and rendered conditionally (productSection.version && …), so other sections without it are unaffected. ✅
  • MDX uses Note/CardGroup/Card (already standard in this docs set) and links only to slugs present in fileSection.nav. ✅
  • Typecheck: npx tsc --noEmit passed cleanly across the project with the PR in place.

No code edits were required; the working tree is unchanged (nothing to discard).

Build status (could not complete in sandbox)

The PR's CI check is npm run cf:build (OpenNext → next build). I ran next build --webpack and it was killed (exit 137 / OOM) at the "Creating an optimized production build" webpack step, identically at 8 GB and 16 GB Node heap — i.e. an external cgroup memory limit in this sandbox, not a code error (it dies before reaching route render / page-data generation). I could not verify the full production build here. tsc --noEmit is the best available proxy and it passed.

Addressed comments

  • No bot or human review comments were present in .workforce/context.json or the PR metadata, so there are no review threads to account for.

Advisory Notes

  • None. The diff is self-contained and on-purpose; I found no out-of-scope changes to flag.

I am not printing READY: the canonical CI build (cf:build / next build) could not be run to completion in this environment (OOM-killed), so I cannot confirm the required check passes, and PR mergeability/check status are post-harness signals I can't observe here.

khaliqgant and others added 2 commits June 24, 2026 20:23
The right-hand TOC panel rendered the Agent Relay version switcher
(v8.0.0 ↔ v7.1.1) on every docs page, including Relayfile/Relayloop
where it is meaningless. Hide it on product sections and show the
section's own version (Relayfile v0.10.12, Relayloop v0.3.6) instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Connect-a-provider block mixed CLI + SDK tabs, so the global Language
selector (which only drives language-labeled tabs) did nothing. Split the
CLI command into its own block and make the SDK example a language-only
CodeGroup (TypeScript + Python) that follows the selector. The Python tab
reflects the data-plane-only Python SDK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (2)
web/content/docs/file/python-sdk.mdx (1)

63-68: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

token is undefined in the async example.

The async snippet passes token without showing where it comes from, unlike the sync example which constructs the callable inline. Consider mirroring the sync example (or a brief token = os.environ[...]) so it stands alone.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/content/docs/file/python-sdk.mdx` around lines 63 - 68, The async example
in AsyncRelayFileClient currently uses an undefined token, so update the snippet
to make the token source explicit and self-contained. Mirror the sync example
pattern in python-sdk.mdx by constructing the token inline or add a brief token
assignment before the async with block, and keep the example aligned with
AsyncRelayFileClient and read_file so readers can run it without extra context.
web/components/GitHubStars.tsx (1)

23-40: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Add a request timeout to the GitHub fetch.

getGitHubStars runs during the docs layout render (server component) and DocsGitHubStarsBadgeServer now awaits Promise.all over multiple repos. Without a timeout, a slow/hanging GitHub response blocks rendering of the entire docs layout until the platform default kicks in. An AbortSignal.timeout bounds the worst case while preserving the existing null-on-failure behavior via the catch.

♻️ Proposed change
     const response = await fetch(`https://api.github.com/repos/${repo}`, {
       headers: {
         Accept: 'application/vnd.github+json',
         'User-Agent': 'agentrelay-web',
       },
       next: { revalidate: 3600 },
+      signal: AbortSignal.timeout(5000),
     });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/components/GitHubStars.tsx` around lines 23 - 40, Add a timeout to the
GitHub request in getGitHubStars so a slow or hanging fetch doesn’t block docs
rendering. Update the fetch options in getGitHubStars to use an AbortSignal
timeout, and keep the existing null-on-failure behavior by letting the timeout
fall into the current catch path. Use the getGitHubStars function and its fetch
call as the place to apply the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/content/docs/file/python-sdk.mdx`:
- Around line 18-25: Add the missing os import in the Python SDK example so the
RelayFileClient snippet can be run as-is without a NameError. Update the example
near RelayFileClient and the lambda using os.environ["RELAYFILE_TOKEN"] to
include the required import before the client initialization.

---

Nitpick comments:
In `@web/components/GitHubStars.tsx`:
- Around line 23-40: Add a timeout to the GitHub request in getGitHubStars so a
slow or hanging fetch doesn’t block docs rendering. Update the fetch options in
getGitHubStars to use an AbortSignal timeout, and keep the existing
null-on-failure behavior by letting the timeout fall into the current catch
path. Use the getGitHubStars function and its fetch call as the place to apply
the change.

In `@web/content/docs/file/python-sdk.mdx`:
- Around line 63-68: The async example in AsyncRelayFileClient currently uses an
undefined token, so update the snippet to make the token source explicit and
self-contained. Mirror the sync example pattern in python-sdk.mdx by
constructing the token inline or add a brief token assignment before the async
with block, and keep the example aligned with AsyncRelayFileClient and read_file
so readers can run it without extra context.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 628d73bf-f781-4acc-9af3-5729665b5d77

📥 Commits

Reviewing files that changed from the base of the PR and between 5b7cfd3 and 6615aa5.

📒 Files selected for processing (12)
  • web/app/docs/file/[slug]/og.png/route.tsx
  • web/app/docs/file/[slug]/page.tsx
  • web/app/docs/layout.tsx
  • web/app/docs/loop/[slug]/og.png/route.tsx
  • web/app/docs/loop/[slug]/page.tsx
  • web/components/DocsGitHubStarsBadge.tsx
  • web/components/GitHubStars.tsx
  • web/components/docs/DocsNav.tsx
  • web/components/docs/TableOfContents.tsx
  • web/components/docs/docs.module.css
  • web/content/docs/file/python-sdk.mdx
  • web/lib/product-docs-nav.ts

Comment on lines +18 to +25
```python
from relayfile import RelayFileClient

client = RelayFileClient(
"https://api.relayfile.dev",
lambda: os.environ["RELAYFILE_TOKEN"],
)
```

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Add the missing import os to the example.

The snippet references os.environ["RELAYFILE_TOKEN"] but never imports os, so a copy-paste run raises NameError.

📝 Proposed fix
+import os
 from relayfile import RelayFileClient
 
 client = RelayFileClient(
     "https://api.relayfile.dev",
     lambda: os.environ["RELAYFILE_TOKEN"],
 )
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```python
from relayfile import RelayFileClient
client = RelayFileClient(
"https://api.relayfile.dev",
lambda: os.environ["RELAYFILE_TOKEN"],
)
```
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/content/docs/file/python-sdk.mdx` around lines 18 - 25, Add the missing
os import in the Python SDK example so the RelayFileClient snippet can be run
as-is without a NameError. Update the example near RelayFileClient and the
lambda using os.environ["RELAYFILE_TOKEN"] to include the required import before
the client initialization.

@agent-relay-code

Copy link
Copy Markdown
Contributor

ℹ️ pr-reviewer: review only — no file changes were applied to the PR (nothing to commit after review). The notes below are advisory and were not pushed.

Working tree is clean (only the pre-existing untracked memory/ remains; I made no source edits).

Review of PR #7docs/relayfile-versions-python-sdk

A docs-site (Next.js) PR adding: per-doc OG cards for Relayfile/Relayloop, a section-aware GitHub stars badge, product version badges (sidebar + TOC), a Python SDK nav icon, and a new python-sdk.mdx page. I traced every changed symbol across its callers and types.

What I verified

  • New OG routes (web/app/docs/{file,loop}/[slug]/og.png/route.tsx) — imports (DefaultVariant, loadBrandFonts, OG_SIZE, getProductDoc, getProductDocSlugs, fileSection/loopSection) all resolve. They are byte-for-byte structurally identical to the already-shipping web/app/docs/[slug]/og.png/route.tsx, so the pattern is proven.
  • OG path wiringogPath = /docs/${SECTION_ID}/${slug}/og.png with SECTION_ID = fileSection.id ('file') / loopSection.id ('loop') correctly matches the route handler locations. No mismatch.
  • ogImage / og-meta — signature (path, alt) matches both call sites; twitter.images correctly uses absoluteUrl(ogPath).
  • GitHubStars refactorDocsGitHubStarsBadgeServer fetches all section repos server-side and hands DocsStarRepo[] (count: string | null) to the client DocsGitHubStarsBadge; types align. The original GitHubStarsBadge is still imported by ~15 other pages, so it is not dead.
  • SiPython — imported from react-icons/si and used in both nav-icon maps (lines 63, 117).
  • CSS classesversionStatic, productHeaderVersion added; versionControl/versionLabel pre-existed. All referenced classes present.
  • python-sdk.mdx + nav entry (slug: 'python-sdk') — slug aligns with the nav item and getProductDocSlugs.

Verification results

  • tsc --noEmit (full project, strict: true) — exit 0, no errors. This is the typecheck next build runs.
  • vitest run8 files / 21 tests passed.
  • next build — repeatedly SIGKILL'd during webpack compilation at every heap size tried. System has 601 GiB free; this is a sandbox per-process cgroup limit / environmental OOM, not a code defect. I could not complete the full production build here; the type-level and unit verification above is clean.

Addressed comments

  • No bot or human review comments were present in .workforce/ (only pr.diff, changed-files.txt, context.json). Nothing to reconcile.

Findings

  • No semantic, safety, lifecycle, or fail-open concerns in scope — this PR is purely docs-site presentation/metadata.
  • No mechanical/lint/typo issues found that warranted an auto-edit. Import ordering in the new/edited files matches the repo's existing convention (e.g. the sibling og route and DocsNav). No files were edited.

Advisory Notes

  • None.

I did not run the full next build to green because it is killed by an environmental memory limit in this sandbox (not a code issue), so I cannot assert the required CI build check passes. Per instructions, I am not printing READY while a required check is unverified.

@khaliqgant khaliqgant merged commit 0c1d50a into main Jun 24, 2026
3 checks passed
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.

1 participant