From 185a12530794eac2064f5fb73e42aaa0e0cc0f98 Mon Sep 17 00:00:00 2001 From: Lukas May Date: Sat, 31 Jan 2026 18:01:45 +0100 Subject: [PATCH] feat(10-03): add setAgentQuestion convenience helper - Add single-question convenience method to TestHarness - Wraps question in array for questions scenario - Keeps setAgentQuestions for multi-question cases --- src/test/harness.ts | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/test/harness.ts b/src/test/harness.ts index 3299034..60da30e 100644 --- a/src/test/harness.ts +++ b/src/test/harness.ts @@ -197,13 +197,24 @@ export interface TestHarness { setAgentDone(agentName: string, result?: string): void; /** - * Convenience: Set agent to ask questions. + * Convenience: Set agent to ask questions (array form). */ setAgentQuestions( agentName: string, questions: QuestionItem[] ): void; + /** + * Convenience: Set agent to ask a single question. + * Wraps the question in an array internally. + */ + setAgentQuestion( + agentName: string, + questionId: string, + question: string, + options?: Array<{ label: string; description?: string }> + ): void; + /** * Convenience: Set agent to fail with unrecoverable error. */ @@ -311,6 +322,18 @@ export function createTestHarness(): TestHarness { agentManager.setScenario(agentName, { status: 'questions', questions }); }, + setAgentQuestion: ( + agentName: string, + questionId: string, + question: string, + options?: Array<{ label: string; description?: string }> + ) => { + agentManager.setScenario(agentName, { + status: 'questions', + questions: [{ id: questionId, question, options }], + }); + }, + setAgentError: (agentName: string, error: string) => { agentManager.setScenario(agentName, { status: 'unrecoverable_error', error }); },