The open-source app everyone uses to manage agents at work
TypeScript acpxagent-orchestrationagent-skillsagentic-aiai-agentsai-engineeringai-governanceai-toolsautonomous-agentsclaudeclaude-codeclaude-skillscodexhermesllmmcpmulti-agentopenclawproject-managementworkflow-automation
Log workspace warnings to stdout
dotta88da68d8a2b0
diff --git a/server/src/__tests__/heartbeat-workspace-session.test.ts b/server/src/__tests__/heartbeat-workspace-session.test.tsindex 1be5cbb775..79d781e954 100644--- a/server/src/__tests__/heartbeat-workspace-session.test.ts+++ b/server/src/__tests__/heartbeat-workspace-session.test.ts@@ -2,6 +2,7 @@ import { describe, expect, it } from "vitest";import type { agents } from "@paperclipai/db";import { resolveDefaultAgentWorkspaceDir } from "../home-paths.js";import {+ formatRuntimeWorkspaceWarningLog,prioritizeProjectWorkspaceCandidatesForRun,parseSessionCompactionPolicy,resolveRuntimeSessionParamsForWorkspace,@@ -181,6 +182,15 @@ describe("shouldResetTaskSessionForWake", () => {});});+describe("formatRuntimeWorkspaceWarningLog", () => {+ it("emits informational workspace warnings on stdout", () => {+ expect(formatRuntimeWorkspaceWarningLog("Using fallback workspace")).toEqual({+ stream: "stdout",+ chunk: "[paperclip] Using fallback workspace\n",+ });+ });+});+describe("prioritizeProjectWorkspaceCandidatesForRun", () => {it("moves the explicitly selected workspace to the front", () => {const rows = [diff --git a/server/src/services/heartbeat.ts b/server/src/services/heartbeat.tsindex 31905a5fd4..8e338b90d0 100644--- a/server/src/services/heartbeat.ts+++ b/server/src/services/heartbeat.ts@@ -497,6 +497,13 @@ export function shouldResetTaskSessionForWake(return false;}+export function formatRuntimeWorkspaceWarningLog(warning: string) {+ return {+ stream: "stdout" as const,+ chunk: `[paperclip] ${warning}\n`,+ };+}+function describeSessionResetReason(contextSnapshot: Record<string, unknown> | null | undefined,) {@@ -2055,7 +2062,8 @@ export function heartbeatService(db: Db) {});};for (const warning of runtimeWorkspaceWarnings) {- await onLog("stderr", `[paperclip] ${warning}\n`);+ const logEntry = formatRuntimeWorkspaceWarningLog(warning);+ await onLog(logEntry.stream, logEntry.chunk);}const adapterEnv = Object.fromEntries(Object.entries(parseObject(resolvedConfig.env)).filter(