fix(cli): restored piped session persistence

- Treated undefined stdin TTY state as redirected input.

- Honored PI_CODING_AGENT_SESSION_DIR with CLI precedence.

Fixes #7378
This commit is contained in:
roboomp
2026-08-02 11:33:58 +00:00
parent 06343fef42
commit 72d8d4eaca
5 changed files with 47 additions and 4 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
/**
* CLI argument parsing and help display
*/
import { APP_NAME, CONFIG_DIR_NAME, logger } from "@oh-my-pi/pi-utils";
import { $env, APP_NAME, CONFIG_DIR_NAME, logger } from "@oh-my-pi/pi-utils";
import chalk from "chalk";
import { CLI_THINKING_LEVELS, type ConfiguredThinkingLevel, parseCliThinkingLevel } from "../thinking";
import { BUILTIN_TOOL_NAMES, HIDDEN_TOOL_NAMES, normalizeToolNames } from "../tools/builtin-names";
@@ -145,6 +145,7 @@ export function parseArgs(inputArgs: string[], extensionFlags?: Map<string, { ty
fileArgs: [],
unknownFlags: new Map(),
unrecognizedFlags: [],
sessionDir: $env.PI_CODING_AGENT_SESSION_DIR || undefined,
};
// `--` ends option parsing (POSIX end-of-options). Everything after it is