惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
Stack Overflow Blog
Stack Overflow Blog
人人都是产品经理
人人都是产品经理
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
Vercel News
Vercel News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Y
Y Combinator Blog
The Cloudflare Blog
Last Week in AI
Last Week in AI
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
博客园 - 司徒正美
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
L
LangChain Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
refactor(plugin-sdk): add managed task flow runtime · ope...
steipete · 2026-04-28 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -725,18 +725,18 @@ canonical replacement.

725725
726726

</Accordion>

727727
728-

<Accordion title="runtime.tasks.flow → runtime.tasks.flows">

728+

<Accordion title="runtime.tasks.flow → runtime.tasks.managedFlows">

729729

**Old**: `runtime.tasks.flow` (singular) returned a live task-flow accessor.

730730
731-

**New**: `runtime.tasks.flows` (plural) returns DTO-based TaskFlow access,

732-

which is import-safe and does not require the full task runtime to be

733-

loaded.

731+

**New**: `runtime.tasks.managedFlows` keeps the managed TaskFlow mutation

732+

runtime for plugins that create, update, cancel, or run child tasks from a

733+

flow. Use `runtime.tasks.flows` when the plugin only needs DTO-based reads.

734734
735735

```typescript

736736

// Before

737-

const flow = api.runtime.tasks.flow(ctx);

737+

const flow = api.runtime.tasks.flow.fromToolContext(ctx);

738738

// After

739-

const flows = api.runtime.tasks.flows(ctx);

739+

const flow = api.runtime.tasks.managedFlows.fromToolContext(ctx);

740740

```

741741
742742

</Accordion>

Original file line numberDiff line numberDiff line change

@@ -179,11 +179,11 @@ Internal OpenClaw runtime code has the same direction: load config once at the C

179179

Inside the Gateway this runtime is in-process. In plugin CLI commands it calls the configured Gateway over RPC, so commands such as `openclaw googlemeet recover-tab` can inspect paired nodes from the terminal. Node commands still go through normal Gateway node pairing, command allowlists, and node-local command handling.

180180
181181

</Accordion>

182-

<Accordion title="api.runtime.taskFlow">

182+

<Accordion title="api.runtime.tasks.managedFlows">

183183

Bind a Task Flow runtime to an existing OpenClaw session key or trusted tool context, then create and manage Task Flows without passing an owner on every call.

184184
185185

```typescript

186-

const taskFlow = api.runtime.taskFlow.fromToolContext(ctx);

186+

const taskFlow = api.runtime.tasks.managedFlows.fromToolContext(ctx);

187187
188188

const created = taskFlow.createManaged({

189189

controllerId: "my-plugin/review-batch",

Original file line numberDiff line numberDiff line change

@@ -89,7 +89,7 @@ The plugin applies:

8989

- Request body size and timeout guards

9090

- Fixed-window rate limiting

9191

- In-flight request limiting

92-

- Owner-bound TaskFlow access through `api.runtime.taskFlow.bindSession(...)`

92+

- Owner-bound TaskFlow access through `api.runtime.tasks.managedFlows.bindSession(...)`

9393
9494

## Request format

9595
Original file line numberDiff line numberDiff line change

@@ -13,8 +13,8 @@ export default definePluginEntry({

1313

return null;

1414

}

1515

const taskFlow =

16-

api.runtime?.taskFlow && ctx.sessionKey

17-

? api.runtime.taskFlow.fromToolContext(ctx)

16+

api.runtime?.tasks.managedFlows && ctx.sessionKey

17+

? api.runtime.tasks.managedFlows.fromToolContext(ctx)

1818

: undefined;

1919

return createLobsterTool(api, { taskFlow }) as AnyAgentTool;

2020

}) as OpenClawPluginToolFactory,

Original file line numberDiff line numberDiff line change

@@ -12,7 +12,7 @@ type JsonLike =

1212

};

1313
1414

type BoundTaskFlow = ReturnType<

15-

NonNullable<OpenClawPluginApi["runtime"]>["taskFlow"]["bindSession"]

15+

NonNullable<OpenClawPluginApi["runtime"]>["tasks"]["managedFlows"]["bindSession"]

1616

>;

1717
1818

type FlowRecord = ReturnType<BoundTaskFlow["createManaged"]>;

Original file line numberDiff line numberDiff line change

@@ -13,7 +13,7 @@ import {

1313

} from "./lobster-taskflow.js";

1414
1515

type BoundTaskFlow = ReturnType<

16-

NonNullable<OpenClawPluginApi["runtime"]>["taskFlow"]["bindSession"]

16+

NonNullable<OpenClawPluginApi["runtime"]>["tasks"]["managedFlows"]["bindSession"]

1717

>;

1818
1919

type JsonLike =

Original file line numberDiff line numberDiff line change

@@ -2,7 +2,7 @@ import { vi } from "vitest";

22

import type { OpenClawPluginApi } from "../runtime-api.js";

33
44

export type BoundTaskFlow = ReturnType<

5-

NonNullable<OpenClawPluginApi["runtime"]>["taskFlow"]["bindSession"]

5+

NonNullable<OpenClawPluginApi["runtime"]>["tasks"]["managedFlows"]["bindSession"]

66

>;

77
88

export function createFakeTaskFlow(overrides?: Partial<BoundTaskFlow>): BoundTaskFlow {

Original file line numberDiff line numberDiff line change

@@ -14,8 +14,10 @@ function createApi(params?: {

1414

source: "test",

1515

pluginConfig: params?.pluginConfig ?? {},

1616

runtime: {

17-

taskFlow: {

18-

bindSession: vi.fn(({ sessionKey }: { sessionKey: string }) => ({ sessionKey })),

17+

tasks: {

18+

managedFlows: {

19+

bindSession: vi.fn(({ sessionKey }: { sessionKey: string }) => ({ sessionKey })),

20+

},

1921

},

2022

} as unknown as OpenClawPluginApi["runtime"],

2123

registerHttpRoute: params?.registerHttpRoute ?? vi.fn(),

Original file line numberDiff line numberDiff line change

@@ -17,7 +17,7 @@ function registerWebhookRoutes(api: OpenClawPluginApi): void {

1717

});

1818
1919

for (const route of routes) {

20-

const taskFlow = api.runtime.taskFlow.bindSession({

20+

const taskFlow = api.runtime.tasks.managedFlows.bindSession({

2121

sessionKey: route.sessionKey,

2222

});

2323

const target: TaskFlowWebhookTarget = {

Original file line numberDiff line numberDiff line change

@@ -18,7 +18,7 @@ import {

1818

} from "../runtime-api.js";

1919

import type { WebhookSecretInput } from "./config.js";

2020
21-

type BoundTaskFlowRuntime = ReturnType<PluginRuntime["taskFlow"]["bindSession"]>;

21+

type BoundTaskFlowRuntime = ReturnType<PluginRuntime["tasks"]["managedFlows"]["bindSession"]>;

2222
2323

type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue };

2424