Loading...
Loading...
Compare original and translation side by side
session-inheritsession-inherit/session-create # called at start of leader workflow
/session-create storyId=WINT-1234 phase=execute # with story and phase context/session-create # 在主工作流启动时调用
/session-create storyId=WINT-1234 phase=execute # 携带需求和阶段上下文调用| Parameter | Required | Default | Description |
|---|---|---|---|
| Yes | (current agent name) | The name of the leader agent opening the session |
| No | null | Story ID for this workflow (e.g. |
| No | null | Current workflow phase (e.g. |
| No | (auto-generated UUID) | Override the session UUID (rarely needed) |
| 参数 | 必填 | 默认值 | 描述 |
|---|---|---|---|
| 是 | (当前Agent名称) | 开启会话的主Agent名称 |
| 否 | null | 本次工作流对应的需求ID(例如 |
| 否 | null | 当前工作流所处阶段(例如 |
| 否 | (自动生成的UUID) | 手动指定会话UUID(极少需要使用) |
mcp__postgres-knowledgebase__sessionCreateagentNamestoryIdphasesession_idSESSION CREATEDSESSION UNAVAILABLEagentNamestoryIdphasemcp__postgres-knowledgebase__sessionCreatesession_idSESSION CREATEDSESSION UNAVAILABLEconst result = await mcp__postgres_knowledgebase__sessionCreate({
agentName: 'dev-execute-leader', // required — name of THIS agent
storyId: 'WINT-2090', // optional
phase: 'execute', // optional
// sessionId: crypto.randomUUID() // omit to auto-generate
})| Field | Type | Required | Notes |
|---|---|---|---|
| string (min 1) | Yes | Name of the leader agent |
| UUID string | No | Auto-generated if omitted |
| string | null | No | Story identifier |
| string | null | No | Workflow phase label |
| int >= 0 | No | Default: 0 |
| int >= 0 | No | Default: 0 |
| int >= 0 | No | Default: 0 |
| Date | No | Defaults to now() |
const result = await mcp__postgres_knowledgebase__sessionCreate({
agentName: 'dev-execute-leader', // 必填 —— 当前Agent的名称
storyId: 'WINT-2090', // 可选
phase: 'execute', // 可选
// sessionId: crypto.randomUUID() // 省略则自动生成
})| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| 字符串(最小长度1) | 是 | 主Agent的名称 |
| UUID字符串 | 否 | 省略则自动生成 |
| 字符串 | 空 | 否 | 需求标识符 |
| 字符串 | 空 | 否 | 工作流阶段标签 |
| 整数 >= 0 | 否 | 默认值:0 |
| 整数 >= 0 | 否 | 默认值:0 |
| 整数 >= 0 | 否 | 默认值:0 |
| 日期 | 否 | 默认值为当前时间now() |
resultif (result && result.sessionId) {
// Emit the structured output block (see Output section below)
}if (result === null) {
// Emit SESSION UNAVAILABLE warning and continue
}resultif (result && result.sessionId) {
// 输出结构化输出块(参考下文输出部分)
}if (result === null) {
// 输出SESSION UNAVAILABLE警告并继续执行
}SESSION CREATED
session_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
agent: dev-execute-leader
story_id: WINT-2090
phase: executeTheline must match the regex:session_id/SESSION CREATED\n\s+session_id:\s+([0-9a-f-]{36})/
SESSION CREATED
session_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
agent: dev-execute-leader
story_id: WINT-2090
phase: execute行必须匹配正则表达式:session_id/SESSION CREATED\n\s+session_id:\s+([0-9a-f-]{36})/
sessionCreateSESSION CREATED
session_id: {uuid returned by sessionCreate}
agent: {agentName}
story_id: {storyId or "—"}
phase: {phase or "—"}sessionCreateSESSION CREATED
session_id: {sessionCreate返回的uuid}
agent: {agentName}
story_id: {storyId 不存在则为 "—"}
phase: {phase 不存在则为 "—"}sessionCreatenullSESSION UNAVAILABLE — continuing without session trackingsessionCreatenullSESSION UNAVAILABLE — continuing without session trackingsession-createsessionCreateSESSION CREATEDsession-inheritsessionQuery(activeOnly: true)SESSION INHERITEDsessionUpdate({ sessionId, mode: 'incremental', inputTokens, outputTokens })sessionCompletesessionCleanup({ retentionDays: 90 })Workers MUST NOT call. See thesessionCompleteskill for the full restriction.session-inherit
session-createsessionCreateSESSION CREATEDsession-inheritsessionQuery(activeOnly: true)SESSION INHERITEDsessionUpdate({ sessionId, mode: 'incremental', inputTokens, outputTokens })sessionCompletesessionCleanup({ retentionDays: 90 })Worker禁止调用。完整限制规则请查看sessionComplete技能文档。session-inherit
| Condition | Behavior |
|---|---|
| DB connection unavailable | Emit |
| Same as above |
| MCP tool unavailable | Log warning, proceed without session |
| Network timeout | Log warning, proceed without session |
| 场景 | 处理逻辑 |
|---|---|
| 数据库连接不可用 | 输出 |
| 同上 |
| MCP工具不可用 | 记录警告,不启用会话功能继续执行 |
| 网络超时 | 记录警告,不启用会话功能继续执行 |
const session = await mcp__postgres_knowledgebase__sessionCreate({
agentName: 'dev-execute-leader',
})
// Emits:
// SESSION CREATED
// session_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
// agent: dev-execute-leader
// story_id: —
// phase: —const session = await mcp__postgres_knowledgebase__sessionCreate({
agentName: 'dev-execute-leader',
})
// 输出:
// SESSION CREATED
// session_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
// agent: dev-execute-leader
// story_id: —
// phase: —const session = await mcp__postgres_knowledgebase__sessionCreate({
agentName: 'dev-execute-leader',
storyId: 'WINT-2090',
phase: 'execute',
})
// Emits:
// SESSION CREATED
// session_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
// agent: dev-execute-leader
// story_id: WINT-2090
// phase: executeconst session = await mcp__postgres_knowledgebase__sessionCreate({
agentName: 'dev-execute-leader',
storyId: 'WINT-2090',
phase: 'execute',
})
// 输出:
// SESSION CREATED
// session_id: 3fa85f64-5717-4562-b3fc-2c963f66afa6
// agent: dev-execute-leader
// story_id: WINT-2090
// phase: executeconst session = await mcp__postgres_knowledgebase__sessionCreate({
agentName: 'dev-execute-leader',
storyId: 'WINT-2090',
phase: 'execute',
})
if (!session) {
// Emit:
// SESSION UNAVAILABLE — continuing without session tracking
// then continue with the rest of the workflow normally
}const session = await mcp__postgres_knowledgebase__sessionCreate({
agentName: 'dev-execute-leader',
storyId: 'WINT-2090',
phase: 'execute',
})
if (!session) {
// 输出:
// SESSION UNAVAILABLE — continuing without session tracking
// 然后正常继续执行剩余工作流
}session_idSESSION CREATEDsession-inheritsessionQuery({ activeOnly: true, limit: 50 })sessionIdsessionCompleteSESSION CREATEDsession_idsession-inheritsessionQuery({ activeOnly: true, limit: 50 })sessionIdsessionComplete