Skip to content

Commit 2071a82

Browse files
committed
fix(runtime): restore agent wait listener lifecycle
Keep agent-job data process-shared while preserving module-local event subscription ownership. Ratchet the public wildcard budget down after replacing text-runtime's wildcard singleton export with named exports.
1 parent efa3959 commit 2071a82

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎scripts/plugin-sdk-surface-report.mjs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ export function readPluginSdkSurfaceBudgets(env = process.env) {
269269
),
270270
publicWildcardReexports: readPluginSdkSurfaceBudgetEnv(
271271
"OPENCLAW_PLUGIN_SDK_MAX_PUBLIC_WILDCARD_REEXPORTS",
272-
82,
272+
// -1: text-runtime now names its global-singleton exports explicitly.
273+
81,
273274
env,
274275
),
275276
};

‎src/gateway/server-methods/agent-job.ts‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ type AgentJobState = {
5959
pendingErrors: Map<string, PendingAgentRunTerminal>;
6060
pendingTimeouts: Map<string, PendingAgentRunTerminal>;
6161
waiters: Map<string, Set<AgentJobWaiter>>;
62-
listenerStarted: boolean;
6362
version: number;
6463
};
6564

@@ -71,7 +70,6 @@ const agentJobState = resolveGlobalSingleton<AgentJobState>(
7170
pendingErrors: new Map(),
7271
pendingTimeouts: new Map(),
7372
waiters: new Map(),
74-
listenerStarted: false,
7573
version: 0,
7674
}),
7775
(state) => {
@@ -97,6 +95,7 @@ const agentRunStarts = agentJobState.runStarts;
9795
const pendingAgentRunErrors = agentJobState.pendingErrors;
9896
const pendingAgentRunTimeouts = agentJobState.pendingTimeouts;
9997
const agentRunWaiters = agentJobState.waiters;
98+
let agentRunListenerStarted = false;
10099

101100
function nextAgentRunVersion(): number {
102101
agentJobState.version += 1;
@@ -314,10 +313,10 @@ function createSnapshotFromLifecycleEvent(params: {
314313
}
315314

316315
function ensureAgentRunListener() {
317-
if (agentJobState.listenerStarted) {
316+
if (agentRunListenerStarted) {
318317
return;
319318
}
320-
agentJobState.listenerStarted = true;
319+
agentRunListenerStarted = true;
321320
onAgentEvent((evt) => {
322321
if (!evt || evt.stream !== "lifecycle") {
323322
return;

0 commit comments

Comments
 (0)