Skip to content

docs: add a current Observer page built on scoped observer tokens - #44

Open
willwashburn wants to merge 1 commit into
mainfrom
claude/agent-relay-skills-review-a8mgtd
Open

docs: add a current Observer page built on scoped observer tokens#44
willwashburn wants to merge 1 commit into
mainfrom
claude/agent-relay-skills-review-a8mgtd

Conversation

@willwashburn

@willwashburn willwashburn commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

Observer has no page in the current docs. The observer slug appears only in legacyDocsNav and web/content/docs/7.1.1/observer.mdx, so:

  • /docs/observer resolves to v7.1.1 via getDefaultDocsVersionForSlug and redirects into the archive
  • the current docs sidebar never mentions the feature at all

And the archived page documents the only method it knew:

https://agentrelay.com/observer?key=<workspace_key>

A workspace key is an administrative credential — it can send messages, spawn agents, and change workspace settings — and a URL query string is not a place to put one. Current releases ship agent-relay observer, which mints a scoped, expiring, read-only ot_live_ token and builds the link from that.

Changes

  • New web/content/docs/observer.mdx — covers agent-relay observer, narrowing with --channels / --include-dms / --expires, observer list / observer revoke, the get_observer_url MCP tool for orchestrating agents, --observer-url / RELAY_OBSERVER_URL for self-hosted and staging, and a table contrasting what a workspace key can do against what an observer token can do.
  • Registered the slug under Interfaces in docsNav, so the page is reachable and /docs/observer serves current docs instead of redirecting to the archive.
  • Archived page kept, with a warning. It still describes v7.1.1 behaviour accurately, but it's live and indexed, so it now carries a <Note> saying the pattern is unsafe on a current release, linking to the new page.

One subtlety worth flagging for review: that link is written as an absolute URL on purpose. rewriteLegacyDocsLinks (web/lib/docs.ts:139) rewrites bare /docs/… links inside legacy content to /docs/7.1.1/…, so a relative link would have pointed the reader back at the archived page they were already on. I simulated the rewriter against the file to confirm the absolute link passes through untouched while the pre-existing relay-dashboard link is still rewritten as intended.

Depends on agent-relay observer landing in AgentWorkforce/relay#1422 — worth merging after it, since the page documents that command.

Test Plan

  • npx next build --webpack compiles successfully
  • /docs/observer now prerenders — .next/server/app/docs/observer.html exists, where before the slug only redirected
  • Verified the rendered HTML contains every documented command (agent-relay observer, --channels, --include-dms, --expires, --json, observer list, observer revoke, --observer-url)
  • Verified the nav entry renders on other current docs pages (/docs/observer link present in the built quickstart.html)
  • Legacy page still builds and carries the new note
  • Simulated rewriteLegacyDocsLinks against the legacy file to confirm the cross-version link survives
  • npx vitest run — 22 passed, 9 files
  • Reverted unrelated package-lock.json churn from npm install
  • Visual check of the rendered page in a browser — not run

Screenshots

n/a


Generated by Claude Code


Summary by cubic

Add a current Observer docs page that uses scoped, expiring ot_live_ tokens and registers the page in the current docs nav, replacing the old archive-only flow that relied on unsafe workspace key URLs.

  • New Features
    • Added web/content/docs/observer.mdx covering agent-relay observer, narrowing (--channels, --include-dms, --expires), token management (observer list, observer revoke), the get_observer_url MCP tool, and self-hosted settings via --observer-url/RELAY_OBSERVER_URL.
    • Registered the Observer page in docsNav so /docs/observer serves current docs.
    • Kept the v7.1.1 page with a warning and a link to the new docs (absolute URL to avoid the legacy link rewriter).

Written for commit 0f7db55. Summary will update on new commits.

Review in cubic

Observer had no page in the current docs. The slug exists only in the
v7.1.1 archive and the legacy nav, so `/docs/observer` redirects into the
archive and the current sidebar never mentions the feature at all.

The archived page also documents the only method it knew:

    https://agentrelay.com/observer?key=<workspace_key>

A workspace key is an administrative credential — it can send messages,
spawn agents, and change workspace settings — and a query string is not a
place to put one. Current releases ship `agent-relay observer`, which
mints a scoped, expiring, read-only `ot_live_` token and builds the link
from that.

- Adds `web/content/docs/observer.mdx` covering `agent-relay observer`,
  the `--channels` / `--include-dms` / `--expires` narrowing, `observer
  list` / `revoke`, the `get_observer_url` MCP tool, and a capability
  table contrasting a workspace key with an observer token.
- Registers the slug under Interfaces in `docsNav`, so the page is
  reachable and `/docs/observer` resolves to current docs instead of
  redirecting to the archive.
- Leaves the archived v7.1.1 page in place but adds a note that the
  pattern is unsafe on a current release, linking to the new page. The
  link is absolute because `rewriteLegacyDocsLinks` rewrites bare
  `/docs/` links back into `/docs/7.1.1/`, which would have pointed it at
  itself.

Depends on the `agent-relay observer` command in AgentWorkforce/relay#1422.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jmke9G9s7ftrN49opNmdx1
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Added Observer documentation for read-only workspace viewing, scoped observer tokens, security boundaries, deployment configuration, and usage. Added Observer to the Interfaces navigation. Updated versioned documentation with workspace-key warnings.

Changes

Observer documentation

Layer / File(s) Summary
Observer overview and navigation
web/content/docs/observer.mdx, web/lib/docs-nav.ts
Added the Observer overview and added it to the Interfaces navigation group.
Observer CLI and token security
web/content/docs/observer.mdx, web/content/docs/7.1.1/observer.mdx
Documented observer-link creation, token scopes, expiration, listing, revocation, MCP integration, and workspace-key security.
Deployment and usage guidance
web/content/docs/observer.mdx
Documented self-hosted configuration and guidance for choosing Observer or the Relay Dashboard.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Poem

A rabbit reads the workspace bright,
With scoped tokens, brief and light.
No admin keys in links today,
Observer keeps the risk away.
Hop through docs and view the way!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding current Observer documentation based on scoped observer tokens.
Description check ✅ Passed The description directly explains the new Observer page, navigation update, archived-page warning, tests, and dependency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/agent-relay-skills-review-a8mgtd

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.

@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: 0f7db55a7f

ℹ️ 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 +95 to +96
<Card title="CLI reference" href="/docs/reference-cli">
Every `agent-relay` command, including `observer`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add Observer to the linked CLI reference

The linked reference-cli.mdx page describes itself as the complete command matrix but contains no observer command or any of the flags shown here. Readers following this card therefore cannot find the promised reference syntax; update the CLI reference alongside this page or remove the claim that it includes Observer.

Useful? React with 👍 / 👎.

Comment on lines +92 to +93
<Card title="Agent Relay MCP" href="/docs/agent-relay-mcp">
Includes `get_observer_url` for orchestrating agents.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document the promised MCP observer tool

The linked agent-relay-mcp.mdx inventory does not mention get_observer_url, its inputs, or its output, despite this card promising that it does. An MCP user following the link has no usable reference for invoking the newly advertised tool, so add it to that page or stop describing the destination as containing it.

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Preview deployed!

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

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

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

🧹 Nitpick comments (1)
web/content/docs/observer.mdx (1)

26-26: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Clarify why observer-token exposure in a URL is acceptable.

Line 26 shows the observer token in the URL query string (?key=ot_live_...), yet lines 55-56 warn that query strings end up in browser history, referrer headers, and proxy logs. An observer token faces the identical exposure surface; only its blast radius is smaller due to scope, expiry, and revocability. Add a sentence noting that observer tokens accept the same URL-exposure surface by design, because their reduced capability and revocability make that acceptable, unlike a workspace key. This avoids leaving readers to infer the distinction on their own.

Also applies to: 51-69

🤖 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/observer.mdx` at line 26, Add a sentence in the
observer-token documentation near the URL example and the query-string warning
explaining that observer tokens intentionally share the URL exposure surface,
and that their limited scope, expiry, and revocability make this acceptable
compared with workspace keys.
🤖 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.

Nitpick comments:
In `@web/content/docs/observer.mdx`:
- Line 26: Add a sentence in the observer-token documentation near the URL
example and the query-string warning explaining that observer tokens
intentionally share the URL exposure surface, and that their limited scope,
expiry, and revocability make this acceptable compared with workspace keys.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4d300c34-e02d-4c6f-98e4-c12957e825ce

📥 Commits

Reviewing files that changed from the base of the PR and between d02e9cd and 0f7db55.

📒 Files selected for processing (3)
  • web/content/docs/7.1.1/observer.mdx
  • web/content/docs/observer.mdx
  • web/lib/docs-nav.ts

@cubic-dev-ai cubic-dev-ai 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.

3 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="web/content/docs/observer.mdx">

<violation number="1" location="web/content/docs/observer.mdx:84">
P3: On the new current Observer page, the “When to use it” link to `/docs/relay-dashboard` doesn’t resolve within the current docs. Relay Dashboard is only present in the v7.1.1 archive, so `/docs/relay-dashboard` is not in currentDocsSlugs and the router redirects readers to the archived `/docs/7.1.1/relay-dashboard` page. Since the rest of this PR is about serving current docs (and every other link on this page resolves within current docs), consider either adding a current Relay Dashboard page/slug or removing/linking elsewhere so the new page doesn’t quietly route readers to archived content.</violation>

<violation number="2" location="web/content/docs/observer.mdx:92">
P2: This card claims the Agent Relay MCP page documents `get_observer_url`, but that page doesn't currently list this tool, its inputs, or output. Readers following this link will find no reference for the newly advertised MCP tool. Either add `get_observer_url` to agent-relay-mcp.mdx or remove this claim.</violation>

<violation number="3" location="web/content/docs/observer.mdx:95">
P2: This card states the CLI reference includes the `observer` command, but reference-cli.mdx doesn't document it or its flags (--channels, --include-dms, --expires, etc.). Update the CLI reference alongside this page, or remove the claim that it covers Observer.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

<Card title="Agent Relay MCP" href="/docs/agent-relay-mcp">
Includes `get_observer_url` for orchestrating agents.
</Card>
<Card title="CLI reference" href="/docs/reference-cli">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This card states the CLI reference includes the observer command, but reference-cli.mdx doesn't document it or its flags (--channels, --include-dms, --expires, etc.). Update the CLI reference alongside this page, or remove the claim that it covers Observer.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At web/content/docs/observer.mdx, line 95:

<comment>This card states the CLI reference includes the `observer` command, but reference-cli.mdx doesn't document it or its flags (--channels, --include-dms, --expires, etc.). Update the CLI reference alongside this page, or remove the claim that it covers Observer.</comment>

<file context>
@@ -0,0 +1,101 @@
+  <Card title="Agent Relay MCP" href="/docs/agent-relay-mcp">
+    Includes `get_observer_url` for orchestrating agents.
+  </Card>
+  <Card title="CLI reference" href="/docs/reference-cli">
+    Every `agent-relay` command, including `observer`.
+  </Card>
</file context>

<Card title="Authentication" href="/docs/authentication">
The credential types Agent Relay issues and what each one can do.
</Card>
<Card title="Agent Relay MCP" href="/docs/agent-relay-mcp">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: This card claims the Agent Relay MCP page documents get_observer_url, but that page doesn't currently list this tool, its inputs, or output. Readers following this link will find no reference for the newly advertised MCP tool. Either add get_observer_url to agent-relay-mcp.mdx or remove this claim.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At web/content/docs/observer.mdx, line 92:

<comment>This card claims the Agent Relay MCP page documents `get_observer_url`, but that page doesn't currently list this tool, its inputs, or output. Readers following this link will find no reference for the newly advertised MCP tool. Either add `get_observer_url` to agent-relay-mcp.mdx or remove this claim.</comment>

<file context>
@@ -0,0 +1,101 @@
+  <Card title="Authentication" href="/docs/authentication">
+    The credential types Agent Relay issues and what each one can do.
+  </Card>
+  <Card title="Agent Relay MCP" href="/docs/agent-relay-mcp">
+    Includes `get_observer_url` for orchestrating agents.
+  </Card>
</file context>


Use Observer when you want visibility without control. To chat, spawn agents, or
manage the workspace interactively, use the
[Relay Dashboard](/docs/relay-dashboard) instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: On the new current Observer page, the “When to use it” link to /docs/relay-dashboard doesn’t resolve within the current docs. Relay Dashboard is only present in the v7.1.1 archive, so /docs/relay-dashboard is not in currentDocsSlugs and the router redirects readers to the archived /docs/7.1.1/relay-dashboard page. Since the rest of this PR is about serving current docs (and every other link on this page resolves within current docs), consider either adding a current Relay Dashboard page/slug or removing/linking elsewhere so the new page doesn’t quietly route readers to archived content.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At web/content/docs/observer.mdx, line 84:

<comment>On the new current Observer page, the “When to use it” link to `/docs/relay-dashboard` doesn’t resolve within the current docs. Relay Dashboard is only present in the v7.1.1 archive, so `/docs/relay-dashboard` is not in currentDocsSlugs and the router redirects readers to the archived `/docs/7.1.1/relay-dashboard` page. Since the rest of this PR is about serving current docs (and every other link on this page resolves within current docs), consider either adding a current Relay Dashboard page/slug or removing/linking elsewhere so the new page doesn’t quietly route readers to archived content.</comment>

<file context>
@@ -0,0 +1,101 @@
+
+Use Observer when you want visibility without control. To chat, spawn agents, or
+manage the workspace interactively, use the
+[Relay Dashboard](/docs/relay-dashboard) instead.
+
+## Related docs
</file context>

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.

2 participants