-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Problem
In src/execution/scenario-execution.ts, there are boolean parameters that make code hard to read at call sites:
// Line 431
private async _step(
goToNextTurn: boolean = true,
onTurn?: (state: ScenarioExecutionStateLike) => void | Promise<void>
): Promise<void>
// Line 508
private async callAgent(
idx: number,
role: AgentRole,
judgmentRequest: boolean = false
): Promise<void>Boolean parameters force readers to remember what true or false means at each call site.
Proposed Solution
Use named options objects or discriminated function names:
interface StepOptions {
advanceTurnIfNeeded: boolean;
onTurn?: (state: ScenarioExecutionStateLike) => void | Promise<void>;
}
private async _step(options: StepOptions): Promise<void>
// Or split into explicit methods:
private async stepWithTurnAdvance(): Promise<void>
private async stepWithoutTurnAdvance(): Promise<void>Files Affected
src/execution/scenario-execution.ts
Metadata
Metadata
Assignees
Labels
No labels