fix: record requested headless command
This commit is contained in:
parent
2d465b11fd
commit
5157223e4c
1 changed files with 6 additions and 2 deletions
|
|
@ -562,6 +562,8 @@ async function runHeadlessOnce(
|
|||
let interrupted = false;
|
||||
const startTime = Date.now();
|
||||
const headlessRunId = `headless-${new Date(startTime).toISOString().replace(/[:.]/g, "-")}-${randomUUID().slice(0, 8)}`;
|
||||
const requestedCommand = options.command;
|
||||
const requestedCommandArgs = [...options.commandArgs];
|
||||
if (options.command === "help") {
|
||||
const { printSubcommandHelp } = await import("./help-text.js");
|
||||
printSubcommandHelp("headless", process.env.SF_VERSION || "0.0.0");
|
||||
|
|
@ -592,6 +594,7 @@ async function runHeadlessOnce(
|
|||
// per-unit timeout via auto-supervisor. Disable the overall timeout unless the
|
||||
// user explicitly set --timeout.
|
||||
const isAutoMode = options.command === "autonomous";
|
||||
const wasRequestedAutoMode = requestedCommand === "autonomous";
|
||||
// discuss and plan are multi-turn: they involve multiple question rounds,
|
||||
// codebase scanning, and artifact writing before the workflow completes (#3547).
|
||||
const isMultiTurnCommand =
|
||||
|
|
@ -1926,7 +1929,7 @@ async function runHeadlessOnce(
|
|||
await client.stop();
|
||||
|
||||
const solverEvalRecord =
|
||||
isAutoMode && timedOut
|
||||
(isAutoMode || wasRequestedAutoMode) && timedOut
|
||||
? await runHeadlessTimeoutSolverEval(process.cwd())
|
||||
: null;
|
||||
|
||||
|
|
@ -1945,7 +1948,7 @@ async function runHeadlessOnce(
|
|||
|
||||
await recordHeadlessRunBestEffort(process.cwd(), {
|
||||
runId: headlessRunId,
|
||||
command: `/sf ${options.command}${options.commandArgs.length > 0 ? " " + options.commandArgs.join(" ") : ""}`,
|
||||
command: `/sf ${requestedCommand}${requestedCommandArgs.length > 0 ? " " + requestedCommandArgs.join(" ") : ""}`,
|
||||
status,
|
||||
exitCode,
|
||||
timedOut,
|
||||
|
|
@ -1958,6 +1961,7 @@ async function runHeadlessOnce(
|
|||
solverEvalRunId: solverEvalRecord?.runId ?? null,
|
||||
solverEvalReportPath: solverEvalRecord?.reportPath ?? null,
|
||||
details: {
|
||||
effectiveCommand: `/sf ${options.command}${options.commandArgs.length > 0 ? " " + options.commandArgs.join(" ") : ""}`,
|
||||
outputFormat: options.outputFormat,
|
||||
eventFilter: options.eventFilter ? [...options.eventFilter] : [],
|
||||
solverEvalDbRecorded: solverEvalRecord?.dbRecorded ?? null,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue