Merge pull request #664 from azade-c/fix/use-state-dir-for-nodes-voicewake
fix: use resolveStateDir() for node-pairing and voicewake storage
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
- Agents/OpenAI: fix Responses tool-only → follow-up turn handling (avoid standalone `reasoning` items that trigger 400 “required following item”).
|
- Agents/OpenAI: fix Responses tool-only → follow-up turn handling (avoid standalone `reasoning` items that trigger 400 “required following item”).
|
||||||
- Auth: update Claude Code keychain credentials in-place during refresh sync; share JSON file helpers; add CLI fallback coverage.
|
- Auth: update Claude Code keychain credentials in-place during refresh sync; share JSON file helpers; add CLI fallback coverage.
|
||||||
- Auth: throttle external CLI credential syncs (Claude/Codex), reduce Keychain reads, and skip sync when cached credentials are still fresh.
|
- Auth: throttle external CLI credential syncs (Claude/Codex), reduce Keychain reads, and skip sync when cached credentials are still fresh.
|
||||||
|
- CLI: respect `CLAWDBOT_STATE_DIR` for node pairing + voice wake settings storage. (#664) — thanks @azade-c.
|
||||||
- Onboarding/Gateway: persist non-interactive gateway token auth in config; add WS wizard + gateway tool-calling regression coverage.
|
- Onboarding/Gateway: persist non-interactive gateway token auth in config; add WS wizard + gateway tool-calling regression coverage.
|
||||||
- Gateway/Control UI: make `chat.send` non-blocking, wire Stop to `chat.abort`, and treat `/stop` as an out-of-band abort. (#653)
|
- Gateway/Control UI: make `chat.send` non-blocking, wire Stop to `chat.abort`, and treat `/stop` as an out-of-band abort. (#653)
|
||||||
- Gateway/Control UI: allow `chat.abort` without `runId` (abort active runs), suppress post-abort chat streaming, and prune stuck chat runs. (#653)
|
- Gateway/Control UI: allow `chat.abort` without `runId` (abort active runs), suppress post-abort chat streaming, and prune stuck chat runs. (#653)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { randomUUID } from "node:crypto";
|
import { randomUUID } from "node:crypto";
|
||||||
import fs from "node:fs/promises";
|
import fs from "node:fs/promises";
|
||||||
import os from "node:os";
|
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
import { resolveStateDir } from "../config/paths.js";
|
||||||
|
|
||||||
export type NodePairingPendingRequest = {
|
export type NodePairingPendingRequest = {
|
||||||
requestId: string;
|
requestId: string;
|
||||||
@@ -48,12 +48,8 @@ type NodePairingStateFile = {
|
|||||||
|
|
||||||
const PENDING_TTL_MS = 5 * 60 * 1000;
|
const PENDING_TTL_MS = 5 * 60 * 1000;
|
||||||
|
|
||||||
function defaultBaseDir() {
|
|
||||||
return path.join(os.homedir(), ".clawdbot");
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolvePaths(baseDir?: string) {
|
function resolvePaths(baseDir?: string) {
|
||||||
const root = baseDir ?? defaultBaseDir();
|
const root = baseDir ?? resolveStateDir();
|
||||||
const dir = path.join(root, "nodes");
|
const dir = path.join(root, "nodes");
|
||||||
return {
|
return {
|
||||||
dir,
|
dir,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { randomUUID } from "node:crypto";
|
import { randomUUID } from "node:crypto";
|
||||||
import fs from "node:fs/promises";
|
import fs from "node:fs/promises";
|
||||||
import os from "node:os";
|
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
|
import { resolveStateDir } from "../config/paths.js";
|
||||||
|
|
||||||
export type VoiceWakeConfig = {
|
export type VoiceWakeConfig = {
|
||||||
triggers: string[];
|
triggers: string[];
|
||||||
@@ -10,12 +10,8 @@ export type VoiceWakeConfig = {
|
|||||||
|
|
||||||
const DEFAULT_TRIGGERS = ["clawd", "claude", "computer"];
|
const DEFAULT_TRIGGERS = ["clawd", "claude", "computer"];
|
||||||
|
|
||||||
function defaultBaseDir() {
|
|
||||||
return path.join(os.homedir(), ".clawdbot");
|
|
||||||
}
|
|
||||||
|
|
||||||
function resolvePath(baseDir?: string) {
|
function resolvePath(baseDir?: string) {
|
||||||
const root = baseDir ?? defaultBaseDir();
|
const root = baseDir ?? resolveStateDir();
|
||||||
return path.join(root, "settings", "voicewake.json");
|
return path.join(root, "settings", "voicewake.json");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,14 @@ vi.mock("../config/config.js", async (importOriginal) => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
vi.mock("../config/sessions.js", async (importOriginal) => {
|
||||||
|
const actual = await importOriginal<typeof import("../config/sessions.js")>();
|
||||||
|
return {
|
||||||
|
...actual,
|
||||||
|
updateLastRoute: vi.fn(async () => undefined),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
vi.mock("./pairing-store.js", () => ({
|
vi.mock("./pairing-store.js", () => ({
|
||||||
readTelegramAllowFromStore: vi.fn(async () => [] as string[]),
|
readTelegramAllowFromStore: vi.fn(async () => [] as string[]),
|
||||||
upsertTelegramPairingRequest: vi.fn(async () => ({
|
upsertTelegramPairingRequest: vi.fn(async () => ({
|
||||||
@@ -63,7 +71,7 @@ vi.mock("../auto-reply/reply.js", () => {
|
|||||||
|
|
||||||
describe("telegram inbound media", () => {
|
describe("telegram inbound media", () => {
|
||||||
const INBOUND_MEDIA_TEST_TIMEOUT_MS =
|
const INBOUND_MEDIA_TEST_TIMEOUT_MS =
|
||||||
process.platform === "win32" ? 30_000 : 10_000;
|
process.platform === "win32" ? 30_000 : 20_000;
|
||||||
|
|
||||||
it(
|
it(
|
||||||
"downloads media via file_path (no file.download)",
|
"downloads media via file_path (no file.download)",
|
||||||
|
|||||||
Reference in New Issue
Block a user