refactor: cleanup shared constants and add async SDK support for isCallerOrchestrator

- Use shared OPENCODE_STORAGE, MESSAGE_STORAGE, PART_STORAGE constants
- Make isCallerOrchestrator async with SDK fallback for beta
- Fix cache implementation using Symbol sentinel
- Update atlas hooks and sisyphus-junior-notepad to use async isCallerOrchestrator
This commit is contained in:
YeonGyu-Kim
2026-02-14 19:24:30 +09:00
parent 1bb5a3a037
commit 068831f79e
8 changed files with 31 additions and 27 deletions
+4 -3
View File
@@ -3,10 +3,11 @@ import { join } from "node:path"
import { getDataDir } from "./data-path"
import { isOpenCodeVersionAtLeast, OPENCODE_SQLITE_VERSION } from "./opencode-version"
let cachedResult: boolean | null = null
const NOT_CACHED = Symbol("NOT_CACHED")
let cachedResult: boolean | typeof NOT_CACHED = NOT_CACHED
export function isSqliteBackend(): boolean {
if (cachedResult !== null) {
if (cachedResult !== NOT_CACHED) {
return cachedResult
}
@@ -19,5 +20,5 @@ export function isSqliteBackend(): boolean {
}
export function resetSqliteBackendCache(): void {
cachedResult = null
cachedResult = NOT_CACHED
}