Skip to content

Commit 0f04849

Browse files
authored
docs: auto doc-review — 3-week diff (14H/15M/8L findings) (#91)
* docs: fix stale knowledge subdir claim and add CLI mirror env vars - knowledge.mdx: update constraint table and @reference syntax to reflect subdir support added in safari#142; remove flat-naming statements in best-practices section (zh + en) - cli.mdx: add MIRROR_URL and FLASHDUTY_UPDATE_BASE_URL to installer options table (zh + en) * docs: auto doc-review diff 3 weeks (37 findings)
1 parent b08f62d commit 0f04849

38 files changed

Lines changed: 1432 additions & 84 deletions

File tree

docs.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@
6767
"zh/platform/team-members",
6868
"zh/platform/permission-design",
6969
"zh/platform/configure-sso",
70-
"zh/platform/audit-log"
70+
"zh/platform/audit-log",
71+
"zh/platform/custom-menu"
7172
]
7273
},
7374
{
@@ -210,6 +211,7 @@
210211
"pages": [
211212
"zh/on-call/integration/alert-integration/alert-sources/standard alert",
212213
"zh/on-call/integration/alert-integration/alert-sources/http-pull",
214+
"zh/on-call/integration/alert-integration/alert-sources/db-pull",
213215
"zh/on-call/integration/alert-integration/alert-sources/prometheus",
214216
"zh/on-call/integration/alert-integration/alert-sources/grafana",
215217
"zh/on-call/integration/alert-integration/alert-sources/zabbix",
@@ -1168,7 +1170,8 @@
11681170
"en/platform/team-members",
11691171
"en/platform/permission-design",
11701172
"en/platform/configure-sso",
1171-
"en/platform/audit-log"
1173+
"en/platform/audit-log",
1174+
"en/platform/custom-menu"
11721175
]
11731176
},
11741177
{
@@ -1311,6 +1314,7 @@
13111314
"pages": [
13121315
"en/on-call/integration/alert-integration/alert-sources/standard alert",
13131316
"en/on-call/integration/alert-integration/alert-sources/http-pull",
1317+
"en/on-call/integration/alert-integration/alert-sources/db-pull",
13141318
"en/on-call/integration/alert-integration/alert-sources/prometheus",
13151319
"en/on-call/integration/alert-integration/alert-sources/grafana",
13161320
"en/on-call/integration/alert-integration/alert-sources/zabbix",

en/ai-sre/environments.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Go to **`Environments`** in the AI SRE left sidebar to create and connect a self
6666

6767
| Field | Type | Required | Description |
6868
|---|---|---|---|
69-
| Name | String | Yes | A unique name identifying this Environment; must be unique within the account; max 128 characters |
69+
| Name | String | No | A unique name identifying this Environment; must be unique within the account; max 128 characters. If left blank, the system auto-fills it with the Runner's **hostname** on the first heartbeat connection (the same GitHub Actions runner auto-naming convention). If the hostname is already taken, the last 4 characters of the Environment ID are appended as a suffix to disambiguate. |
7070
| Scope | Account / Team | Yes | Account scope is visible to all members in the account; team scope is visible and editable only by members of that team (see [Scope](#scope) below) |
7171
| Tags | String list | No | Tags used for task routing, comma-separated, e.g. `linux, docker, gpu` |
7272

@@ -108,7 +108,7 @@ Go to **`Environments`** in the AI SRE left sidebar to create and connect a self
108108
</Tabs>
109109

110110
<Note>
111-
The `connect-url` is the address the Runner dials into AI SRE (typically `wss://api.flashcat.cloud/safari/environment/ws`). It is injected by the deployment configuration — you do not need to fill it in manually. The onboarding guide already shows a complete, ready-to-copy command.
111+
Both the `connect-url` and the install script URL are sourced dynamically from the server-side deployment configuration (`environment.runner.*` in `etc/srv.yml`) and returned by the backend when you create or retrieve an Environment — **nothing is hardcoded in the frontend bundle**. The onboarding guide already shows a complete, ready-to-copy command with the real values pre-filled.
112112
</Note>
113113
</Step>
114114

@@ -121,7 +121,9 @@ Go to **`Environments`** in the AI SRE left sidebar to create and connect a self
121121
| Online | The Runner is currently connected with a healthy heartbeat and ready to accept tasks. |
122122
| Offline | The Runner connected at some point in the past, but its heartbeat has since been lost. |
123123

124-
Once online, the list also backfills the machine's **machine info** (OS / architecture / hostname), the Runner **version**, and the **last heartbeat** time ("just now", "N minutes ago", "N hours ago", etc.). When a newer version is available, an "Upgrade available" badge appears in the version column — clicking it reopens the onboarding guide so you can run the same command to upgrade.
124+
Once online, the list also backfills the machine's **machine info** (OS / architecture / hostname), the Runner **version**, and the **last heartbeat** time ("just now", "N minutes ago", "N hours ago", etc.).
125+
126+
Runner upgrades are **server-push advertised on every heartbeat**: the backend compares the version the Runner reports against the system-configured `latest_version` using semver. If the Runner is behind, the backend pushes an upgrade notification to the Runner containing the target version, download URL, and SHA256 checksum. The Runner then downloads, verifies, and replaces itself **without any manual intervention**. Runners built from source with a `dev` version string are intentionally excluded from the comparison. When a newer version is available, an **"Upgrade available"** badge appears in the version column. Clicking it reopens the onboarding guide if you need to reinstall or view the install commands manually.
125127
</Step>
126128
</Steps>
127129

en/ai-sre/im.mdx

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,41 @@ When you open a **war room** for an incident in IM, AI SRE intervenes **automati
8787
War room auto-diagnosis is bound to the incident context: when the investigation begins, the corresponding `incident_id` is attached to the run so AI SRE can read the incident details, timeline, and recent changes. For details on how incidents / war rooms interact with A2A, see [Agent · Incident & War Room Integration](/en/ai-sre/agents#incident-and-war-room-integration).
8888
</Note>
8989

90+
## In-session Switch Commands
91+
92+
---
93+
94+
IM sessions have no picker UI like the console, but they support two slash commands that let you **switch bindings mid-conversation** — neither command is available for console sessions, whose environment and team bindings are set at creation and cannot be changed afterwards.
95+
96+
### /env — Switch Runner Environment
97+
98+
Send `/env <runner-name>` to the bot in a group or DM to rebind the current IM session to a different online BYOC runner. The conversation history and context are preserved in full. After the switch, the previous environment's working directory is no longer accessible: files created or modified during the conversation in the old environment are gone, and skill and knowledge files are re-staged in the new environment on demand.
99+
100+
<Note>
101+
The switch takes effect after the current turn completes and before the next message is processed — it does not interrupt a tool call that is already running. If the target runner is offline or not found, the command returns an error immediately and the binding remains unchanged.
102+
</Note>
103+
104+
### /scope — Switch Team Scope
105+
106+
Send `/scope <team-name>` (or `/scope personal` to return to personal scope) to rebind the current IM session to a different team without ending the conversation. Team binding is a **usage operation**: any account member can bind a session to any team in the account — this matches the war-room pattern where responders are often not members of the incident's team.
107+
108+
After the switch, AI SRE:
109+
110+
1. Refreshes the memory snapshot for the new team scope (memories from the previous team scope no longer apply to this session).
111+
2. Queues the new team's knowledge bundle to be mounted and injected into context when the next message is processed.
112+
113+
<Note>
114+
Knowledge bundles already mounted into this session are not removed — mounts are conversation-scoped, so switching back to a previously-mounted team will not duplicate the mount reminder.
115+
</Note>
116+
90117
## Relationship to Console Sessions
91118

92119
---
93120

94121
Whether you start a session from IM or the console, it's **the same AI SRE**: messages are handled one at a time, with streaming output, automatic context compaction for long conversations, and optional team and environment bindings. The only difference is the entry point —
95122

96-
- **Console**: ask questions one at a time in the **Chat** workspace and view the full tool-call and sub-session panels.
97-
- **IM**: @mention it in the group where your team already works; findings are posted back to the thread. Great for grabbing a quick analysis at the incident scene, then diving deeper in the console.
123+
- **Console**: ask questions one at a time in the **Chat** workspace and view the full tool-call and sub-session panels; environment and team bindings are fixed at creation and cannot be changed.
124+
- **IM**: @mention it in the group where your team already works; findings are posted back to the thread. Use `/env` and `/scope` to switch bindings mid-conversation. Great for grabbing a quick analysis at the incident scene, then diving deeper in the console.
98125

99126
For more about sessions, see [Conversations](/en/ai-sre/sessions).
100127

en/ai-sre/mcp.mdx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,37 @@ In AI SRE, MCP extends an agent's capability from "built-in tools" to "any exter
3939
**MCP vs. Skills**: MCP provides **the ability to connect external tools**; a Skill provides **the methodology for orchestrating those tools to accomplish a class of tasks**. A Skill can declare which MCP server tool it needs inside `SKILL.md` using `mcp:server/tool` notation. See [Skills](/en/ai-sre/skills) for details.
4040
</Tip>
4141

42+
## Installing MCP Connectors from the Marketplace
43+
44+
---
45+
46+
Go to **Plugins → MCP** and click **Browse Marketplace** to open the MCP **connector catalog**, where you can browse Flashduty's curated selection of third-party MCP connector templates.
47+
48+
<Steps>
49+
<Step title="Open the catalog">
50+
Click **Browse Marketplace** on the MCP list page to open a catalog dialog that displays all available connector templates in a card grid. Each card shows the connector name, vendor, transport, authentication mode, and whether a BYOC Runner is required.
51+
</Step>
52+
<Step title="View details">
53+
Click any connector card to see a full description, connection parameter documentation, and a link to the vendor's official docs. Cards for already-installed connectors display a gear icon; clicking it takes you directly to that connector's edit form.
54+
</Step>
55+
<Step title="Start an install conversation">
56+
For connectors not yet installed, click the **Install** button on the card. The system opens a new AI SRE session and injects the connector's template metadata. The agent then guides you through entering the endpoint URL, completing credential authorization, and calls `mcp_load` to verify connectivity — the entire install flow happens **inside the conversation**, not through a one-click write to the database.
57+
</Step>
58+
<Step title="Confirm the installation">
59+
Once the agent verifies connectivity, it writes the connector into the account via the `/safari/mcp/server/create` endpoint. The connector then appears in the MCP list and is marked as "Installed" on the catalog card.
60+
</Step>
61+
</Steps>
62+
63+
<Note>
64+
The marketplace catalog is **browse-only** — there is no one-click install endpoint. This is intentional: installing a connector must involve credential entry and connectivity verification. Skipping those steps would leave dead connectors in the account that can never actually connect. Conversational install ensures every connector has been validated by a real agent invocation before it is considered ready.
65+
</Note>
66+
67+
Installed connectors record a `source_template_name` field that points back to the originating template, making it easy to trace the connector's provenance later. If the same template is installed more than once (for example, into different team scopes), each installation creates an independent connector instance.
68+
69+
<Warning>
70+
Connectors marked **requires Runner** (typically using `stdio` transport) can only be used in environments where you have a BYOC Runner deployed; cloud Sandboxes do not support them. Before installing, confirm your account has a working BYOC Runner configured. See [Environments (BYOC)](/en/ai-sre/environments).
71+
</Warning>
72+
4273
## Adding an MCP Server
4374

4475
---

en/ai-sre/sessions.mdx

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Console
3-
description: An AI SRE session holds one complete conversation between you and the agent, including messages, streaming responses, tool calls, and artifacts. This page covers creating and managing sessions, sending messages, previewing artifacts, context compaction, and team binding.
4-
keywords: ["AI SRE", "session", "chat", "streaming response", "tool call", "Artifacts", "context compaction", "team binding"]
3+
description: An AI SRE session holds one complete conversation between you and the agent, including messages, streaming responses, tool calls, and artifacts. This page covers creating and managing sessions, sending messages, previewing artifacts, context compaction, team binding, and session data export.
4+
keywords: ["AI SRE", "session", "chat", "streaming response", "tool call", "Artifacts", "context compaction", "team binding", "export", "NDJSON"]
55
sidebarTitle: Console
66
---
77

@@ -193,6 +193,56 @@ Automatic linking between incidents / war rooms and teams is still evolving. You
193193

194194
For the rules governing team scope for resources (account scope vs. team scope, visibility, and edit permissions), see the "Scope" section on each resource page.
195195

196+
## Session entry kind
197+
198+
---
199+
200+
Every session is created with an **entry kind** (`entry_kind`) that identifies which surface produced it. The value is persisted to the database and returned in the create response.
201+
202+
| Value | Source | Notes |
203+
|---|---|---|
204+
| `web` | Console | Default; unknown or missing values are automatically normalized to `web` |
205+
| `im` | IM platform (Feishu / DingTalk / WeCom / Slack) | Set automatically by the IM path; enables **in-place switching** for the session (see below) |
206+
| `api` | External API call | For programmatic integration scenarios |
207+
| `automation` | Automated workflow | Sessions triggered by automation tasks |
208+
209+
When calling `POST /safari/session/create`, you may include `entry_kind` in the request body (optional; defaults to `web`). The `entry_kind` cannot be changed after the session is created.
210+
211+
<Note>
212+
Sessions with `entry_kind=im` support **in-place environment and team switching** — the IM `/env` and `/scope` commands can rebind the session to a different BYOC runner or team scope without discarding the conversation. Console sessions (`web`) have their environment and team fixed at creation time and do not support in-place switching.
213+
</Note>
214+
215+
## Session data export
216+
217+
---
218+
219+
`POST /safari/session/export` streams all events from a session as **NDJSON** (`application/x-ndjson`), one JSON object per line. This is intended for auditing, archiving, offline analysis, or feeding session data into external systems.
220+
221+
### Request fields
222+
223+
| Field | Type | Required | Description |
224+
|---|---|---|---|
225+
| `session_id` | string | Yes | ID of the session to export |
226+
| `include_subagents` | bool | No | When `true`, recursively includes the event streams of all subagent child sessions; defaults to `false` |
227+
228+
### Response format
229+
230+
The response `Content-Type` is `application/x-ndjson`. The **first line is always** a `session_meta` envelope containing the session's metadata; subsequent lines are session events. When `include_subagents=true`, each `subagent_dispatch` line is immediately followed by the complete event stream of the child session, which also begins with its own `session_meta` line.
231+
232+
```
233+
{"type":"session_meta","session_id":"...","app_name":"..."} // first line: session metadata
234+
{"type":"message","..."} // subsequent: event lines (type varies)
235+
{"type":"subagent_dispatch","child_session_id":"..."} // subagent dispatch marker
236+
{"type":"session_meta","session_id":"<child>","..."} // child session metadata
237+
{"type":"message","..."} // child session events
238+
```
239+
240+
<Warning>
241+
If an error occurs after streaming has already begun, the server cannot switch to a standard JSON error envelope. Instead, a JSON-encoded error object is appended as the final line of the stream. Consumers must inspect this last line to determine whether the stream completed successfully.
242+
</Warning>
243+
244+
**Permissions**: the export endpoint uses the same access gate as sending messages (`CanChatSession`), meaning the caller must have message-send permission on the session — read-only access is not sufficient.
245+
196246
## Related Pages
197247

198248
---

en/ai-sre/skills.mdx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,25 @@ At upload time, the system automatically validates that: the archive is a valid
124124
All metadata other than the skill name (description, version, tags, author, tools, etc.) is parsed from `SKILL.md`'s frontmatter and does not need to be entered separately in the form.
125125
</Note>
126126

127+
### Overwrite upload (Replace)
128+
129+
When you want to replace an existing skill with a new version, the upload endpoint supports two overwrite modes. The UI presents a "Replace" confirmation dialog at the appropriate moment:
130+
131+
| Mode | Trigger | Behavior |
132+
| --- | --- | --- |
133+
| **Replace by name** | Upload with `replace=true` and no `skill_id` | Matches an existing skill in the account by the `name` field in the new archive's `SKILL.md` and overwrites its content. The SkillID remains the same, so all existing references (e.g., `/<skill-name>` triggers) continue to work. |
134+
| **Replace by ID** | Upload with `replace=true` and a `skill_id` | Ignores the `name` field in the zip and directly targets the skill with the specified ID. Use this when you want to overwrite a specific record even if the skill has been renamed. |
135+
136+
Both modes return the updated skill object on success. If the target skill does not exist, a 404 error is returned — neither mode silently creates a new skill. **Without the `replace` parameter (the default), a name collision is rejected outright**; the upload endpoint never implicitly overwrites an existing skill.
137+
127138
### Create in conversation (skill-creator)
128139

129140
Besides uploading a zip, you can **create and refine skills right inside an AI SRE session**. `skill-creator` is a Flashduty-provided Marketplace skill, pre-installed into your account by default, that exists specifically to "build skills." Trigger it with `/skill-creator` in any session, or just describe what you want in natural language:
130141

131142
- **Create from scratch**: say "help me create a skill for troubleshooting X," or after an investigation, "turn that workflow into a skill." skill-creator clarifies your intent, drafts the `SKILL.md`, optionally sets up test cases and iterates on them, and saves the result as a skill in your account once you're happy.
132143
- **Rewrite & optimize**: click **"Edit in Chat"** in a skill's detail panel to have skill-creator rewrite that skill; it can also tune the `description` to improve triggering accuracy.
133144

134-
Once the draft is ready, the agent saves it as a skill with one click; if the name conflicts with an existing skill, a "Replace" confirmation appears first.
145+
Once the draft is ready, the agent saves it as a skill with one click. If the name conflicts with an existing skill, a "Replace" confirmation dialog appears — under the hood this invokes the replace-by-name mode (`replace=true`, no `skill_id`).
135146

136147
<Warning>
137148
Skill archive size limits: archives saved by the agent in-conversation are capped at **10 MB**; archives uploaded via the web form or file upload in a session are capped at **100 MB**.

0 commit comments

Comments
 (0)