@pushpalsdev/cli 1.1.14 → 1.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1648,6 +1648,7 @@ var DEFAULT_EMBEDDED_SERVICE_LAUNCH_WARN_MS = 5000;
1648
1648
  var EMBEDDED_SERVICE_RESTART_MAX_ATTEMPTS = 4;
1649
1649
  var WORKERPAL_STARTUP_READINESS_PROBE_MAX_MS = 15000;
1650
1650
  var CLI_SESSION_JOB_LOG_MAX_CHARS = 700;
1651
+ var CLI_SESSION_SHOW_JOB_EVENTS_ENV = "PUSHPALS_CLI_SHOW_JOB_EVENTS";
1651
1652
  var EMBEDDED_RUNTIME_SAFETY_CAP_DISABLE_ENV = "PUSHPALS_DISABLE_EMBEDDED_SAFETY_CAPS";
1652
1653
  var EMBEDDED_RUNTIME_WINDOWS_SAFETY_CAPS = {
1653
1654
  REMOTEBUDDY_WORKERPAL_STARTUP_TIMEOUT_MS: "120000",
@@ -1674,6 +1675,12 @@ function formatTimestampedCliLine(line, at = new Date) {
1674
1675
  }
1675
1676
  return `[${at.toISOString()}]${text}`;
1676
1677
  }
1678
+ function isTruthyCliEnvValue(value) {
1679
+ return /^(1|true|yes|on)$/i.test(String(value ?? "").trim());
1680
+ }
1681
+ function shouldShowCliSessionOperationalEvents(env = process.env) {
1682
+ return isTruthyCliEnvValue(env[CLI_SESSION_SHOW_JOB_EVENTS_ENV]);
1683
+ }
1677
1684
  function formatRuntimeStartupTimingSummary(input) {
1678
1685
  const phaseSummary = input.phases.map((phase) => `${phase.name}=${Math.max(0, Math.floor(phase.durationMs))}ms(${phase.status.trim() || "unknown"})`).join(" ");
1679
1686
  const detail = typeof input.detail === "string" && input.detail.trim() ? ` detail=${input.detail.trim()}` : "";
@@ -5218,7 +5225,10 @@ function formatSessionEventLine(event) {
5218
5225
  const type = String(event.type ?? "").toLowerCase();
5219
5226
  const from = String(event.from ?? "");
5220
5227
  const payload = event.payload ?? {};
5228
+ const showOperationalEvents = shouldShowCliSessionOperationalEvents();
5221
5229
  if (type === "job_enqueued") {
5230
+ if (!showOperationalEvents)
5231
+ return null;
5222
5232
  const jobId = String(payload.jobId ?? "").slice(0, 8);
5223
5233
  const kind = String(payload.kind ?? "").trim();
5224
5234
  const taskId = String(payload.taskId ?? "").slice(0, 8);
@@ -5226,11 +5236,15 @@ function formatSessionEventLine(event) {
5226
5236
  return `[job ${jobId}] queued: ${detail}`;
5227
5237
  }
5228
5238
  if (type === "job_claimed") {
5239
+ if (!showOperationalEvents)
5240
+ return null;
5229
5241
  const jobId = String(payload.jobId ?? "").slice(0, 8);
5230
5242
  const workerId = String(payload.workerId ?? "").trim();
5231
5243
  return `[job ${jobId}] claimed${workerId ? ` by ${workerId}` : ""}`;
5232
5244
  }
5233
5245
  if (type === "job_log") {
5246
+ if (!showOperationalEvents)
5247
+ return null;
5234
5248
  const jobId = String(payload.jobId ?? "").slice(0, 8);
5235
5249
  const stream = String(payload.stream ?? "").toLowerCase() === "stderr" ? " stderr" : "";
5236
5250
  const phase = compactCliSessionJobLogLine(String(payload.phase ?? "").trim());
@@ -5239,6 +5253,8 @@ function formatSessionEventLine(event) {
5239
5253
  return line ? `[job ${jobId}${stream}${phaseLabel}] ${line}` : null;
5240
5254
  }
5241
5255
  if (type === "job_failed") {
5256
+ if (!showOperationalEvents)
5257
+ return null;
5242
5258
  const jobId = String(payload.jobId ?? "").slice(0, 8);
5243
5259
  const message = String(payload.message ?? "").trim();
5244
5260
  return `[job ${jobId}] failed: ${message || "unknown"}`;
@@ -5251,24 +5267,34 @@ function formatSessionEventLine(event) {
5251
5267
  const text = String(payload.text ?? "").trim();
5252
5268
  if (!text)
5253
5269
  return null;
5270
+ if (/^All systems online\b/i.test(text))
5271
+ return null;
5254
5272
  return `assistant> ${text}`;
5255
5273
  }
5256
5274
  if (type === "task_progress") {
5275
+ if (!showOperationalEvents)
5276
+ return null;
5257
5277
  const taskId = String(payload.taskId ?? "").slice(0, 8);
5258
5278
  const message = String(payload.message ?? "").trim();
5259
5279
  return message ? `[task ${taskId}] ${message}` : null;
5260
5280
  }
5261
5281
  if (type === "task_failed") {
5282
+ if (!showOperationalEvents)
5283
+ return null;
5262
5284
  const taskId = String(payload.taskId ?? "").slice(0, 8);
5263
5285
  const message = String(payload.message ?? "").trim();
5264
5286
  return `[task ${taskId}] failed: ${message || "unknown"}`;
5265
5287
  }
5266
5288
  if (type === "task_completed") {
5289
+ if (!showOperationalEvents)
5290
+ return null;
5267
5291
  const taskId = String(payload.taskId ?? "").slice(0, 8);
5268
5292
  const summary = String(payload.summary ?? "").trim();
5269
5293
  return `[task ${taskId}] completed${summary ? `: ${summary}` : ""}`;
5270
5294
  }
5271
5295
  if (type === "job_completed") {
5296
+ if (!showOperationalEvents)
5297
+ return null;
5272
5298
  const jobId = String(payload.jobId ?? "").slice(0, 8);
5273
5299
  const summary = String(payload.summary ?? "").trim();
5274
5300
  return `[job ${jobId}] completed${summary ? `: ${summary}` : ""}`;
@@ -5277,6 +5303,8 @@ function formatSessionEventLine(event) {
5277
5303
  return null;
5278
5304
  }
5279
5305
  if (type === "status") {
5306
+ if (!showOperationalEvents)
5307
+ return null;
5280
5308
  const state = String(payload.state ?? "").trim();
5281
5309
  const detail = String(payload.detail ?? "").trim();
5282
5310
  const source = from || String(payload.agentId ?? "status");
@@ -6009,6 +6037,7 @@ export {
6009
6037
  startEmbeddedMonitoringHub,
6010
6038
  shutdownEmbeddedServiceManagerGracefully,
6011
6039
  shouldUseRemoteBuddySilentStartupFallback,
6040
+ shouldShowCliSessionOperationalEvents,
6012
6041
  shouldRunEmbeddedRuntimeStartupPrechecks,
6013
6042
  shouldRestartEmbeddedService,
6014
6043
  runCommandWithEnv,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushpalsdev/cli",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "description": "PushPals terminal CLI for LocalBuddy -> RemoteBuddy orchestration",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -204,6 +204,50 @@ function formatGenericPythonExecutorTimeoutDetail(
204
204
  return `${configPath}=${configuredTimeoutMs}ms within planning executionBudgetMs=${executionBudgetMs}ms`;
205
205
  }
206
206
 
207
+ export function normalizeGenericPythonExecutorParsedResultForTimeout(params: {
208
+ backendName: string;
209
+ kind: string;
210
+ timedOut: boolean;
211
+ timeoutMs: number;
212
+ timeoutDetail?: string;
213
+ summary: string;
214
+ stdout: string;
215
+ stderr: string;
216
+ exitCode: number;
217
+ }): { summary: string; stdout: string; stderr: string; exitCode: number } {
218
+ const signalTerminatedCodex =
219
+ params.timedOut &&
220
+ params.backendName === "openai_codex" &&
221
+ /\bopenai_codex interrupted by signal 15\b/i.test(params.summary);
222
+ if (!signalTerminatedCodex) {
223
+ return {
224
+ summary: params.summary,
225
+ stdout: params.stdout,
226
+ stderr: params.stderr,
227
+ exitCode: params.exitCode,
228
+ };
229
+ }
230
+
231
+ const timeoutDetail = String(params.timeoutDetail ?? "").trim();
232
+ const cleanedStderr = String(params.stderr ?? "")
233
+ .replace(/\bopenai_codex interrupted by signal 15\b/gi, "OpenAI Codex exceeded the execution budget")
234
+ .trim();
235
+ const stderr = [
236
+ `OpenAI Codex exceeded the PushPals execution budget before returning a completed result.`,
237
+ timeoutDetail ? `Timeout detail: ${timeoutDetail}.` : "",
238
+ cleanedStderr ? `Last stderr:\n${cleanedStderr}` : "",
239
+ ]
240
+ .filter(Boolean)
241
+ .join("\n");
242
+
243
+ return {
244
+ summary: `${params.backendName} execution budget expired after ${params.timeoutMs}ms for ${params.kind}`,
245
+ stdout: params.stdout,
246
+ stderr,
247
+ exitCode: 124,
248
+ };
249
+ }
250
+
207
251
  export function createGenericPythonExecutor(
208
252
  config: GenericPythonExecutorConfig,
209
253
  ): BackendTaskExecutor {
@@ -390,16 +434,27 @@ export function createGenericPythonExecutor(
390
434
  parsed.usage,
391
435
  estimateJobTokenUsage(backendName, modelId, params, summary, parsedStdout, parsedStderr),
392
436
  );
393
-
394
- return {
395
- ok: typeof parsed.ok === "boolean" ? parsed.ok : exitCode === 0,
437
+ const normalized = normalizeGenericPythonExecutorParsedResultForTimeout({
438
+ backendName,
439
+ kind,
440
+ timedOut,
441
+ timeoutMs,
442
+ timeoutDetail,
396
443
  summary,
397
- stdout: truncate(parsedStdout, outputPolicy),
398
- stderr: truncate(parsedStderr, outputPolicy),
444
+ stdout: parsedStdout,
445
+ stderr: parsedStderr,
399
446
  exitCode:
400
447
  typeof parsed.exitCode === "number" && Number.isFinite(parsed.exitCode)
401
448
  ? parsed.exitCode
402
449
  : exitCode,
450
+ });
451
+
452
+ return {
453
+ ok: typeof parsed.ok === "boolean" ? parsed.ok : exitCode === 0,
454
+ summary: normalized.summary,
455
+ stdout: truncate(normalized.stdout, outputPolicy),
456
+ stderr: truncate(normalized.stderr, outputPolicy),
457
+ exitCode: normalized.exitCode,
403
458
  usage,
404
459
  };
405
460
  } catch (err) {