feat: shared transcription cache to avoid duplicate Whisper API calls

Both services (nanoclaw + nanoclaw-codex) now share cache/transcriptions/
directory. When one service transcribes audio, the other reads from cache
instead of making a second Whisper API call. Uses .pending file to
coordinate concurrent transcription attempts.
This commit is contained in:
Eyejoker
2026-03-14 01:40:35 +09:00
parent 7a726c335d
commit b8292e14a1
3 changed files with 60 additions and 10 deletions

View File

@@ -31,6 +31,8 @@ export const GROUPS_DIR = path.resolve(
export const DATA_DIR = path.resolve(
process.env.NANOCLAW_DATA_DIR || path.join(PROJECT_ROOT, 'data'),
);
// Shared cache directory (same across both services for dedup)
export const CACHE_DIR = path.join(PROJECT_ROOT, 'cache');
export const AGENT_TIMEOUT = parseInt(
process.env.AGENT_TIMEOUT || '1800000',