refactor: unify env vars (UWF_HOME, OCAS_HOME) + env only in CLI (#37)
CI / check (pull_request) Failing after 3m6s
CI / check (pull_request) Failing after 3m6s
Breaking changes: - UWF_STORAGE_ROOT → UWF_HOME - WORKFLOW_STORAGE_ROOT removed (no fallback) - OCAS_DIR → OCAS_HOME (aligned with ocas CLI) Library functions no longer read process.env: - util-agent/storage.ts: resolveStorageRoot(override), getGlobalCasDir(override) - agent-hermes: isResumeDisabled(flag) pure function, CLI reads env - agent-claude-code: CLI reads CLAUDE_MODEL and passes to agent Fixes #37
This commit is contained in:
@@ -29,6 +29,8 @@ function minimalContext(overrides: Partial<AgentContext> = {}): AgentContext {
|
||||
outputFormatInstruction: "---\nstatus: done\n---",
|
||||
edgePrompt: "Implement the fix described in the plan.",
|
||||
isFirstVisit: true,
|
||||
storageRoot: "/tmp/uwf-test",
|
||||
casDir: "/tmp/ocas-test",
|
||||
...overrides,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@ import {
|
||||
createAgent,
|
||||
loadWorkflowConfig,
|
||||
resolveModel,
|
||||
resolveStorageRoot,
|
||||
} from "@united-workforce/util-agent";
|
||||
|
||||
import { storeBuiltinDetail } from "./detail.js";
|
||||
@@ -40,6 +39,7 @@ type SessionRecord = {
|
||||
model: string;
|
||||
startedAtMs: number;
|
||||
messages: ChatMessage[];
|
||||
storageRoot: string;
|
||||
};
|
||||
|
||||
const sessions = new Map<string, SessionRecord>();
|
||||
@@ -103,7 +103,7 @@ async function runBuiltinWithMessages(
|
||||
}
|
||||
|
||||
async function runBuiltin(ctx: AgentContext): Promise<AgentRunResult> {
|
||||
const storageRoot = resolveStorageRoot();
|
||||
const storageRoot = ctx.storageRoot;
|
||||
const config = await loadWorkflowConfig(storageRoot);
|
||||
const provider = resolveModel(config, config.defaultModel);
|
||||
|
||||
@@ -116,6 +116,7 @@ async function runBuiltin(ctx: AgentContext): Promise<AgentRunResult> {
|
||||
model: provider.model,
|
||||
startedAtMs: Date.now(),
|
||||
messages,
|
||||
storageRoot,
|
||||
};
|
||||
sessions.set(sessionId, session);
|
||||
|
||||
@@ -136,7 +137,7 @@ async function continueBuiltin(
|
||||
store: Store,
|
||||
): Promise<AgentRunResult> {
|
||||
const session = getSession(sessionId);
|
||||
const storageRoot = resolveStorageRoot();
|
||||
const storageRoot = session.storageRoot;
|
||||
const config = await loadWorkflowConfig(storageRoot);
|
||||
const provider = resolveModel(config, config.defaultModel);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user