fix: resolve diagnostic paths and recover time injection
This commit is contained in:
1 parent
a9364a344a
commit
a46fb916a0
9 files changed
+48
-12
No files matched your search
+1
-1
@@ -669,7 +669,7 @@ export function resolveTelegramTimeConfig(
|
||||
? raw.injectionMode
|
||||
: "hidden";
|
||||
const interval =
|
||||
typeof raw?.interval === "number" && raw.interval > 0
|
||||
typeof raw?.interval === "number" && Number.isFinite(raw.interval) && raw.interval > 0
|
||||
? raw.interval
|
||||
: 60 * 60 * 1000;
|
||||
const timezone = getSystemTimezone();
|
||||
|
||||
+3
-4
@@ -75,11 +75,10 @@ export function getTelegramDiagnosticsDisplayPaths(profileName?: string): {
|
||||
state: string;
|
||||
logs: string;
|
||||
} {
|
||||
const suffix = getTelegramProfilePathSuffix(profileName);
|
||||
const profileSlug = suffix.slice(1);
|
||||
const agentDir = resolveAgentDir();
|
||||
return {
|
||||
state: `~/.pi/agent/tmp/telegram/state${suffix}.json`,
|
||||
logs: `~/.pi/agent/tmp/telegram/logs${profileSlug ? `.${profileSlug}` : ""}.jsonl`,
|
||||
state: resolveTelegramProfileTempFilePath("state", "json", agentDir, profileName),
|
||||
logs: resolveTelegramProfileTempFilePath("logs", "jsonl", agentDir, profileName),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ export function createTimeInjectionRuntime(
|
||||
const nowMs = now.getTime();
|
||||
if (
|
||||
previous !== undefined &&
|
||||
nowMs >= previous &&
|
||||
nowMs - previous < config.interval
|
||||
) {
|
||||
return null;
|
||||
|
||||
Reference in new issue
Block a user