v4.3.19-23: 글로벌 하트비트가 빈 워크스페이스를 보던 버그 수정

멀티유저 전환 후 USER.md/SOUL.md가 유저별 워크스페이스로 옮겨졌는데
HeartbeatRunner는 여전히 글로벌 워크스페이스(파일 없음)를 보고 있어서
30분마다 memory_read(user/soul)가 매번 "not found"로 실패하던 문제.
workspacePath를 papa 워크스페이스로, handleChat에 username도 함께
전달하도록 수정.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
kimandClaude Sonnet 5 committed 2026-07-28 13:22:09 +09:00
1 parent 4c3d90c3d2
commit 8a7f6443fc
2 files changed
+13 -1

No files matched your search

+5 -1
View File
@@ -1021,7 +1021,11 @@ class MultiUserTelegramManager {
const userTelegramManager = new MultiUserTelegramManager();
const heartbeatRunner = new HeartbeatRunner({
workspacePath: getConfig().getWorkspacePath(),
// Post multi-user migration, USER.md/SOUL.md live under the per-user workspace, not the
// (now-empty) global one — point the heartbeat at papa's so memory_read/memory_write during
// a heartbeat tick resolve to real files instead of failing "not found" every cycle.
workspacePath: getUserWorkspace('papa'),
username: 'papa',
configPath: path.join(CONFIG_DIR_PATH, 'heartbeat', 'config.json'),
handleChat: (message, sessionId, sendSSE, pinnedMessages, abortSignal, callerContext, modelOverride, executionMode, username) =>
handleChat(message, sessionId, sendSSE, pinnedMessages, abortSignal, callerContext, modelOverride, executionMode, username),
+8
View File
@@ -20,6 +20,13 @@ export interface HeartbeatRunnerConfig {
interface HeartbeatRunnerDeps {
workspacePath: string;
// Passed through to handleChat so its internal workspace resolution (memory_read,
// memory_write, etc.) lands on the same per-user workspace as `workspacePath` above,
// instead of falling back to the empty global workspace (2026-07-28 bug: heartbeat's
// memory_read('user'/'soul') always failed post multi-user migration since USER.md/SOUL.md
// moved to .smallclaw/users/<username>/workspace/prompts/ and nothing lived at the old
// global path anymore).
username?: string;
configPath: string;
handleChat: (
message: string,
@@ -225,6 +232,7 @@ export class HeartbeatRunner {
'CONTEXT: Internal HEARTBEAT tick. Run checklist and reply HEARTBEAT_OK if nothing needs attention.',
undefined,
'heartbeat',
this.deps.username,
);
const text = String(result?.text || '');
const isOk = /^\s*HEARTBEAT_OK\s*$/i.test(text);