Skip to content

docs(cli): document opening a specific agent session via deep link - #5032

Merged
Kitenite merged 2 commits into
ParadevAI:mainfrom
robertn702:adorable-chimpanzee
Jun 21, 2026
Merged

Kitenite merged 2 commits into
ParadevAI:mainfrom
robertn702:adorable-chimpanzee

Conversation

@robertn702

@robertn702 robertn702 commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Document the previously-undocumented superset://v2-workspace/<id> deep-link query params used to focus a specific agent session in the desktop app (Session deep-linking (chatSessionId/terminalId) is undocumented and not exposed by the CLI #5029): ?chatSessionId= (chat sessions), ?terminalId= (terminal sessions), and optional &focusRequestId= to force a re-focus.
  • apps/docs/content/docs/cli/cli-reference.mdx: new "Opening a specific session" subsection under workspaces open, with the kind→param mapping from agents run --json, bash examples, and a cross-platform opener note.
  • skills/superset/SKILL.md: new "Opening sessions in the desktop app" section (same scheme/table/examples plus the $SUPERSET_WORKSPACE_ID/$SUPERSET_TERMINAL_ID shortcut and the "fresh session is invisible until opened" gotcha), an --agent superset mention, and a kind note in the Agents section.

Why / Context

superset workspaces open <id> only ever targets a workspace — it fires superset://v2-workspace/<id> with no query string, and a session created via agents run has no pane and no session-list entry until you navigate to it, so a freshly created session is effectively invisible. The desktop route already parses chatSessionId/terminalId/focusRequestId and focuses/adds the matching pane, but the only way to use it was to hand-build the URL — and that was undocumented. This PR documents the workflow.

Verification (docs vs. source)

Every command, URL, param, and the kind→param mapping was checked against the code:

  • Bare URL + --print: packages/cli/src/commands/workspaces/open/command.ts
  • agents run --json → { kind, sessionId, label }; kind is chat for superset, terminal for claude/codex: packages/cli/src/commands/agents/run/command.ts + host-service agents.ts (input.agent === "superset" → runChatAgent)
  • validateSearch parses all three params and the pane is focused/added with workspace-ownership enforced: desktop v2-workspace/$workspaceId route + useConsumeAutomationRunLink (focusRequestId is part of the consume key, so it forces re-focus)
  • Cross-platform opener (open / xdg-open / start) matches the CLI's own openUrl platform branching.

Testing

  • Docs-only; reviewed rendered MDX (tables, fenced code, anchors). Both cross-reference anchors resolve.
  • Biome ignores .md/.mdx, so no lint impact.

Notes

  • The SKILL.md edit lands in one tracked file but applies in three places: plugins/superset/skills/superset is a symlink to skills/superset, and the marketing .well-known/agent-skills route reads skills/superset/SKILL.md dynamically — so the bundled plugin and the served skill stay in sync with no duplicate blobs.
  • Opened from a fork (robertn702:adorable-chimpanzee) as the author lacks direct push access.

Open in Stage

Summary by cubic

Document deep links for opening a specific agent session in the desktop app. CLI docs and skills/superset/SKILL.md now show how to build superset://v2-workspace/<workspaceId> URLs with ?chatSessionId=/?terminalId= (optional &focusRequestId=), include the kind→param mapping with a bash --json round-trip example, and align placeholder casing and opener notes.

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

Review in cubic

Summary by CodeRabbit

  • Documentation
    • Added guidance for opening specific agent sessions from the CLI, including how to deep-link to chat vs. terminal sessions
    • Documented response fields used to construct session links and provided example deep-link URLs and query parameters
    • Added note to append a focusRequestId when reopening the same link and platform-specific URL-opener tips for Linux/Windows

Document the previously-undocumented superset://v2-workspace/<id> deep-link
query params (?chatSessionId= / ?terminalId= / &focusRequestId=) used to focus
a specific agent session in the desktop app (ParadevAI#5029).

- cli-reference.mdx: add "Opening a specific session" subsection under
  `workspaces open` with the kind->param mapping from `agents run --json`.
- SKILL.md: add "Opening sessions in the desktop app" section plus a kind
  note in Agents and an `--agent superset` mention.

The SKILL.md edit propagates to the bundled plugin (symlinked) and the
marketing-served copy (read dynamically), so only the one tracked file changes.
@ghost

ghost commented Jun 2, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 2 individual chapters for you:

Title
1 Document session deep links in CLI reference
2 Update Superset skill documentation for sessions
Open in Stage

Chapters generated by Stage for commit cdb7944 on Jun 5, 2026 9:40pm UTC.

@capy-ai

capy-ai Bot commented Jun 2, 2026

Copy link
Copy Markdown

Capy auto-review is paused for this organization because the monthly auto-review limit has been reached. Increase the limit or turn it off in billing settings to resume automatic reviews.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Too many files changed? Review this PR in Change Stack to see how the pieces fit before you dive in.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b870af62-6376-47f4-b1ef-eb7a9c7b0a3a

📥 Commits

Reviewing files that changed from the base of the PR and between ee4ab16 and cdb7944.

📒 Files selected for processing (2)
  • apps/docs/content/docs/cli/cli-reference.mdx
  • skills/superset/SKILL.md
✅ Files skipped from review due to trivial changes (2)
  • skills/superset/SKILL.md
  • apps/docs/content/docs/cli/cli-reference.mdx

📝 Walkthrough

Walkthrough

This PR adds documentation for opening specific agent sessions via deep links in the Superset desktop app. It expands the --agent option guidance in SKILL.md and adds two new sections explaining how to construct deep-link URLs using query parameters derived from agents run --json output, with handling for refocus via focusRequestId.

Changes

Agent Session Deep-Link Documentation

Layer / File(s) Summary
Agent command documentation and session opening guide
skills/superset/SKILL.md
Expanded --agent option to document built-in superset chat agent and --attachment-id usage. Added "Opening sessions in the desktop app" section describing agents run --json output (kind, sessionId, label), deep-link construction for chat vs terminal (chatSessionId vs terminalId), example superset:// URLs using env vars, focusRequestId guidance, and platform URL-opener notes (xdg-open/start).
CLI reference for workspace session opening
apps/docs/content/docs/cli/cli-reference.mdx
Added workspaces open subsection documenting how to deep-link directly to agent sessions via chatSessionId and terminalId query parameters, including focusRequestId for re-opening the same link and replacement of open with platform-specific URL openers on Linux/Windows.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Poem

🐰 I hopped through docs with a twitchy nose,

Deep links laid out where the session flows.
chatSessionId or terminalId in view,
A focusRequestId to open anew.
Now agents and workspaces meet—hip, hop, hooray!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: documenting how to open a specific agent session via deep link in the CLI.
Description check ✅ Passed The description covers all required template sections with substantial detail: Summary, Context, Verification, Testing, and Notes. All key information is present and well-documented.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@greptile-apps

greptile-apps Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This is a documentation-only PR that surfaces the previously undocumented chatSessionId, terminalId, and focusRequestId query parameters for the superset://v2-workspace/<id> deep link, explaining how to focus a specific agent session that would otherwise be invisible until navigated to manually.

  • apps/docs/content/docs/cli/cli-reference.mdx: Adds an "Opening a specific session" subsection after the workspaces open command block, with a kind→query-param mapping table and platform-aware open/xdg-open/start examples. The anchor link to #superset-agents-run resolves correctly per the Command component's slugify logic.
  • skills/superset/SKILL.md: Extends the Agents section to mention superset as a valid --agent value and adds the agents run --json return shape; introduces a new "Opening sessions in the desktop app" section with the same mapping table plus a $SUPERSET_WORKSPACE_ID/$SUPERSET_TERMINAL_ID shortcut example relevant to agents running inside a workspace.

Confidence Score: 4/5

Docs-only change with no runtime code altered; safe to merge.

Both changed files are documentation. The deep-link params, kind values, and anchor references all check out against the source components. Minor style gaps (inconsistent placeholder casing between the two files, no end-to-end shell snippet showing how to extract sessionId from agents run --json) do not affect correctness.

No files require special attention; apps/docs/content/docs/cli/cli-reference.mdx has small style inconsistencies noted in the comments.

Important Files Changed

Filename Overview
apps/docs/content/docs/cli/cli-reference.mdx Adds an 'Opening a specific session' subsection after the workspaces open Command block, documenting the chatSessionId/terminalId/focusRequestId deep-link params. The anchor reference to #superset-agents-run resolves correctly per the Command component's slugify logic. Placeholder naming style (camelCase here, kebab-case in SKILL.md) is inconsistent, and the bash examples omit any agents run --json invocation showing how to obtain sessionId.
skills/superset/SKILL.md Expands the Agents section to mention superset as a valid --agent value, adds agents run --json return shape, and introduces a new 'Opening sessions in the desktop app' section with the kind-to-param table and three shell examples including the $SUPERSET_WORKSPACE_ID/$SUPERSET_TERMINAL_ID shortcut. Content is accurate and the internal anchor resolves correctly.

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as superset CLI
    participant Desktop as Desktop App (deep link)

    User->>CLI: agents run --workspace id --agent preset --prompt ... --json
    CLI-->>User: "{ kind, sessionId, label }"

    alt "kind == chat (agent: superset)"
        User->>Desktop: "open superset://v2-workspace/id?chatSessionId=sessionId"
    else "kind == terminal (agent: claude, codex)"
        User->>Desktop: "open superset://v2-workspace/id?terminalId=sessionId"
    end

    Note over Desktop: validateSearch parses params, focuses/adds pane. Add focusRequestId=unique to force re-focus.
Loading
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
apps/docs/content/docs/cli/cli-reference.mdx:642-648
**Missing `--json` call in code examples**

The prose correctly explains that you must run `agents run --json` to get the `kind` and `sessionId`, but the bash block jumps straight to the `open` call with `<sessionId>` as a placeholder — without any example of how to capture that value from the JSON output. A reader following this doc literally has no shell snippet showing the full round-trip (run → parse → open). Even a one-liner using `jq` or `$(…)` substitution would make the intent actionable without forcing them to infer the plumbing.

### Issue 2 of 2
apps/docs/content/docs/cli/cli-reference.mdx:637-640
**Placeholder naming style inconsistent with `SKILL.md`**

The examples here use camelCase placeholders (`<workspaceId>`, `<sessionId>`) while the parallel section in `skills/superset/SKILL.md` uses kebab-case (`<workspace-id>`, `<sessionId>`). Since these two files document the same URL scheme and are meant to stay in sync, consistent placeholder casing makes it easier to correlate them at a glance. Consider aligning on one convention across both files.

Reviews (1): Last reviewed commit: "docs(cli): document opening a specific a..." | Re-trigger Greptile

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

1 issue found across 2 files

Architecture diagram
sequenceDiagram
    participant CLI as CLI (workspaces open)
    participant Runner as agents run
    participant User as Desktop User
    participant Desktop as Desktop App
    participant Route as v2-workspace Route
    participant Pane as Session Pane

    Note over CLI,Pane: Opening a specific agent session via deep link

    User->>CLI: superset agents run --agent superset --json
    CLI->>Runner: Execute agent run
    Runner-->>CLI: { kind: "chat", sessionId: "sess_xxx", label: "..." }
    CLI-->>User: JSON output

    User->>CLI: superset workspaces open <workspaceId> --print
    CLI-->>User: superset://v2-workspace/<workspaceId>

    User->>User: Build deep link with query params
    Note over User: Choose param by kind:<br/>chat → ?chatSessionId=<sessionId><br/>terminal → ?terminalId=<sessionId><br/>Optional: &focusRequestId=<unique>

    User->>Desktop: Open deep link<br/>superset://v2-workspace/<workspaceId>?chatSessionId=<sessionId>
    Note over User,Desktop: Platform opener: open/xdg-open/start

    Desktop->>Route: Navigate to v2-workspace/<workspaceId>
    Route->>Route: Parse query params (validateSearch)
    Route->>Route: Verify session belongs to workspace

    alt chatSessionId present
        Route->>Pane: Focus chat session pane
    else terminalId present
        Route->>Pane: Focus terminal session pane
    end

    opt focusRequestId present
        Route->>Pane: Force re-focus even if already opened
    end

    Pane-->>Route: Pane focused/added
    Route-->>User: Session visible in workspace view
Loading

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

Re-trigger cubic

@Kitenite
Kitenite merged commit 3637e47 into ParadevAI:main Jun 21, 2026
9 of 11 checks passed
@greptile-apps greptile-apps Bot mentioned this pull request Jun 22, 2026
3 tasks

This branch had an error being deployed

1 failed deployment
preview — cdb79447 Deployed Jun 21, 2026 by robertn702 via Deploy Database (Neon) #5889
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