fix(backend): make data root config authoritative
This commit is contained in:
@@ -35,6 +35,7 @@ export function createPiModelLister(cfg: AppConfig, opts: Opts = {}): () => Prom
|
||||
if (cache && now() - cache.at < ttlMs) return cache.models;
|
||||
|
||||
const env: NodeJS.ProcessEnv = { ...process.env };
|
||||
delete env.THT_DATA_ROOT;
|
||||
if (cfg.dataRoot !== undefined) env.THT_DATA_ROOT = cfg.dataRoot;
|
||||
const child = spawnFn(cfg.piBin, ["--mode", "rpc"], { cwd: cfg.harnessDir, env });
|
||||
child.stderr.resume();
|
||||
|
||||
@@ -35,6 +35,7 @@ export class PiProcessManager {
|
||||
THT_SESSION: sessionId,
|
||||
THT_AUTHOR: author,
|
||||
};
|
||||
delete env.THT_DATA_ROOT;
|
||||
if (this.cfg.dataRoot !== undefined) env.THT_DATA_ROOT = this.cfg.dataRoot;
|
||||
// pi 0.73 removed `--approve`: rpc mode is headless and its argv is intentionally minimal.
|
||||
const child = spawnFn(this.cfg.piBin, ["--mode", "rpc"], {
|
||||
|
||||
@@ -63,6 +63,7 @@ export class ThtRunner {
|
||||
run(args: string[], workspace?: string): Promise<{ code: number; stdout: string; stderr: string }> {
|
||||
return new Promise((resolve) => {
|
||||
const env: NodeJS.ProcessEnv = { ...process.env };
|
||||
delete env.THT_DATA_ROOT;
|
||||
if (this.cfg.dataRoot !== undefined) env.THT_DATA_ROOT = this.cfg.dataRoot;
|
||||
const ch = spawn(this.cfg.thtBin, this.buildArgv(args, workspace), {
|
||||
cwd: this.cfg.harnessDir,
|
||||
|
||||
Reference in New Issue
Block a user