docs: surface mountWorkspace SDK helper in README; fix guide code-fence langs#123
Conversation
…ce langs Adds a "Mount a workspace from a sandbox (TypeScript SDK)" subsection under Hosted Agent Relay so the new SDK helper from #122 is discoverable from the project README and reads as the programmatic sibling of the existing `relayfile setup` CLI flow. Links the new guide from the Docs section. Also addresses CodeRabbit nits on docs/guides/post-auth-mount-session.md by adding language specifiers to two unspecified fenced code blocks (text for the ASCII flow diagram, http for the endpoint reference).
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThis PR adds README documentation for a TypeScript SDK workflow to programmatically mount Agent Relay Cloud workspaces from sandboxes, including ChangesMount Workspace SDK Documentation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@README.md`:
- Around line 263-264: The code sample calls handle.status() without awaiting
the async method, so change the sample to await the Promise returned by status()
before accessing .expiresAt; specifically, update the lines using
handle.status() (the async status(): Promise<MountedWorkspaceStatus> method) so
you await it (e.g., const status = await handle.status(); then use
status.expiresAt) and keep the subsequent await handle.stop() as-is.
- Around line 270-272: The README example incorrectly passes a plain object as
the workspace argument to setup.ensureMountedWorkspace; replace the object with
either a WorkspaceHandle instance (obtainable via setup.joinWorkspace()) or pass
the workspaceId string directly. Update the sample to call
setup.joinWorkspace(...) and pass its returned WorkspaceHandle into
setup.ensureMountedWorkspace, or change the argument to workspaceId: "rw_…" so
the usage matches the SDK's WorkspaceHandle contract and the
ensureMountedWorkspace signature.
🪄 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: ace5a0a2-2540-4937-a6ca-d2028fc05a09
📒 Files selected for processing (2)
README.mddocs/guides/post-auth-mount-session.md
| }) | ||
|
|
||
| // /workspace is now a live mount of the workspace | ||
| console.log(handle.status().expiresAt) |
There was a problem hiding this comment.
🟡 README example accesses .expiresAt on an unresolved Promise from status()
The README SDK example at line 263 does handle.status().expiresAt, but according to the MountedWorkspaceHandle interface documented in docs/guides/post-auth-mount-session.md:230, status() returns Promise<MountedWorkspaceStatus>. Accessing .expiresAt on a Promise yields undefined. The guide's own example at docs/guides/post-auth-mount-session.md:141 correctly uses handle.expiresAt (a direct readonly property on the handle). The README example should either use the synchronous property handle.expiresAt or await the call: (await handle.status()).expiresAt.
| console.log(handle.status().expiresAt) | |
| console.log(handle.expiresAt) | |
Was this helpful? React with 👍 or 👎 to provide feedback.
CodeRabbit / Devin Review on #123: - `handle.status()` returns a Promise; `handle.status().expiresAt` was reading off the unresolved Promise. The handle exposes `expiresAt` as a readonly synchronous property — use that. - `setup.ensureMountedWorkspace({ workspace: { id: ... } })` doesn't match `MountWorkspaceInput.workspace?: WorkspaceHandle`. Switch to the `workspaceId: string` overload, which the SDK accepts as a primitive.
Summary
Two small follow-ups after #122 merged:
relayfile setup) was already documented; this surfaces the new programmatic equivalent from feat(sdk): add post-auth mount workspace helper #122 (RelayfileSetup.mountWorkspace/ensureMountedWorkspace) right next to it so integrators see both entry points. Links the new guide from the Docs section.docs/guides/post-auth-mount-session.mdby adding language specifiers to fenced code blocks:textfor the ASCII flow diagram (line 18),httpfor the endpoint reference (line 45).Verification
awk '/^\``/{print}'`).