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

推荐订阅源

Engineering at Meta
Engineering at Meta
J
Java Code Geeks
I
InfoQ
腾讯CDC
Vercel News
Vercel News
IT之家
IT之家
V
Visual Studio Blog
P
Proofpoint News Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 叶小钗
有赞技术团队
有赞技术团队
月光博客
月光博客
Martin Fowler
Martin Fowler
量子位
L
LangChain Blog
B
Blog
Last Week in AI
Last Week in AI
博客园 - 司徒正美
Microsoft Security Blog
Microsoft Security Blog
博客园 - 聂微东
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans

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
fix(heartbeat): remap cron-run exec events to session key...
Kaspre · 2026-05-11 · via Recent Commits to openclaw:main

@@ -12,7 +12,7 @@ import { requestHeartbeat } from "../infra/heartbeat-wake.js";

1212

import { isDangerousHostInheritedEnvVarName } from "../infra/host-env-security.js";

1313

import { findPathKey, mergePathPrepend } from "../infra/path-prepend.js";

1414

import { enqueueSystemEvent } from "../infra/system-events.js";

15-

import { scopedHeartbeatWakeOptions } from "../routing/session-key.js";

15+

import { resolveEventSessionKey, scopedHeartbeatWakeOptions } from "../routing/session-key.js";

1616

import type { ProcessSession } from "./bash-process-registry.js";

1717

import type { ExecToolDetails } from "./bash-tools.exec-types.js";

1818

import type { BashSandboxConfig } from "./bash-tools.shared.js";

@@ -340,17 +340,22 @@ function maybeNotifyOnExit(session: ProcessSession, status: "completed" | "faile

340340

? `Exec ${status} (${session.id.slice(0, 8)}, ${exitLabel}) :: ${output}`

341341

: `Exec ${status} (${session.id.slice(0, 8)}, ${exitLabel})`;

342342

enqueueSystemEvent(summary, {

343-

sessionKey,

343+

sessionKey: resolveEventSessionKey(sessionKey, session.mainKey, session.sessionScope),

344344

deliveryContext: session.notifyDeliveryContext,

345345

trusted: false,

346346

});

347347

requestHeartbeat(

348-

scopedHeartbeatWakeOptions(sessionKey, {

349-

source: "exec-event",

350-

intent: "event",

351-

reason: "exec-event",

352-

coalesceMs: 0,

353-

}),

348+

scopedHeartbeatWakeOptions(

349+

sessionKey,

350+

{

351+

source: "exec-event",

352+

intent: "event",

353+

reason: "exec-event",

354+

coalesceMs: 0,

355+

},

356+

session.mainKey,

357+

session.sessionScope,

358+

),

354359

);

355360

}

356361

@@ -416,25 +421,40 @@ export function resolveApprovalRunningNoticeMs(value?: number) {

416421417422

export function emitExecSystemEvent(

418423

text: string,

419-

opts: { sessionKey?: string; contextKey?: string; deliveryContext?: DeliveryContext },

424+

opts: {

425+

sessionKey?: string;

426+

contextKey?: string;

427+

deliveryContext?: DeliveryContext;

428+

/** `session.mainKey` from the runtime config; pass-through of `undefined`

429+

* falls back to the literal "main" default in `resolveEventSessionKey`. */

430+

mainKey?: string;

431+

/** `session.scope` from the runtime config; needed so global-scope

432+

* agents route cron-run events to the "global" queue. */

433+

sessionScope?: "per-sender" | "global";

434+

},

420435

) {

421436

const sessionKey = opts.sessionKey?.trim();

422437

if (!sessionKey) {

423438

return;

424439

}

425440

enqueueSystemEvent(text, {

426-

sessionKey,

441+

sessionKey: resolveEventSessionKey(sessionKey, opts.mainKey, opts.sessionScope),

427442

contextKey: opts.contextKey,

428443

deliveryContext: opts.deliveryContext,

429444

trusted: false,

430445

});

431446

requestHeartbeat(

432-

scopedHeartbeatWakeOptions(sessionKey, {

433-

source: "exec-event",

434-

intent: "event",

435-

reason: "exec-event",

436-

coalesceMs: 0,

437-

}),

447+

scopedHeartbeatWakeOptions(

448+

sessionKey,

449+

{

450+

source: "exec-event",

451+

intent: "event",

452+

reason: "exec-event",

453+

coalesceMs: 0,

454+

},

455+

opts.mainKey,

456+

opts.sessionScope,

457+

),

438458

);

439459

}

440460

@@ -568,6 +588,15 @@ export async function runExecProcess(opts: {

568588

notifyOnExitEmptySuccess?: boolean;

569589

scopeKey?: string;

570590

sessionKey?: string;

591+

/** `session.mainKey` from the runtime config; snapshotted onto the

592+

* ProcessSession so background-exit notifications can remap cron-run

593+

* keys without an ambient config load. Long-running background exits use

594+

* this start-time value even if config changes while the process runs. */

595+

mainKey?: string;

596+

/** `session.scope` from the runtime config; snapshotted alongside

597+

* `mainKey` so the cron-run remap can route global-scope agents to

598+

* the "global" queue instead of agent-main. */

599+

sessionScope?: "per-sender" | "global";

571600

notifyDeliveryContext?: DeliveryContext;

572601

timeoutSec: number | null;

573602

onUpdate?: (partialResult: AgentToolResult<ExecToolDetails>) => void;

@@ -587,6 +616,8 @@ export async function runExecProcess(opts: {

587616

command: opts.command,

588617

scopeKey: opts.scopeKey,

589618

sessionKey: opts.sessionKey,

619+

mainKey: opts.mainKey,

620+

sessionScope: opts.sessionScope,

590621

notifyDeliveryContext: normalizeDeliveryContext(opts.notifyDeliveryContext),

591622

notifyOnExit: opts.notifyOnExit,

592623

notifyOnExitEmptySuccess: opts.notifyOnExitEmptySuccess === true,