Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
Reference for the
api.runtimeStep-by-step guide that uses these helpers in context for channel plugins.
Step-by-step guide that uses these helpers in context for provider plugins.
typescriptregister(api) { const runtime = api.runtime; }
Prefer config that was already passed into the active call path, for example
api.configcfgUse
api.runtime.config.current()Tool factories receive
ctx.runtimeConfigctx.getRuntimeConfig()executePersist changes with
api.runtime.config.mutateConfigFile(...)api.runtime.config.replaceConfigFile(...)afterWriteafterWrite: { mode: "auto" }afterWrite: { mode: "restart", reason: "..." }afterWrite: { mode: "none", reason: "..." }The mutation helpers return
afterWritefollowUpapi.runtime.config.loadConfig()api.runtime.config.writeConfigFile(...)runtime-config-load-writeFor direct SDK imports, use the focused config subpaths instead of the broad
openclaw/plugin-sdk/config-runtimeconfig-typesplugin-config-runtimeruntime-config-snapshotconfig-mutationInternal OpenClaw runtime code has the same direction: load config once at the CLI, gateway, or process boundary, then pass that value through. Successful mutation writes refresh the process runtime snapshot and advance its internal revision; long-lived caches should key off the runtime-owned cache key instead of serializing config locally. Long-lived runtime modules have a zero-tolerance scanner for ambient
loadConfig()cfgcontext.getRuntimeConfig()getRuntimeConfig()Provider and channel execution paths must use the active runtime config snapshot, not a file snapshot returned for config readback or editing. File snapshots preserve source values such as SecretRef markers for UI and writes; provider callbacks need the resolved runtime view. When a helper may be called with either the active source snapshot or the active runtime snapshot, route through
selectApplicableRuntimeConfig()Use
createPluginRuntimeStoreregistertextconst store = createPluginRuntimeStore<PluginRuntime>({ pluginId: "my-plugin", errorMessage: "my-plugin runtime not initialized", }); ```
textexport function tryGetRuntime() { return store.tryGetRuntime(); // returns null if not initialized } ```
apiBeyond
api.runtimedefinePluginEntry© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine