@a-t-h-i/bot-lobby 0.6.6 → 0.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -1
- package/package.json +1 -1
- package/prompts/master.md +6 -0
- package/src/ask/dialog.ts +4 -2
- package/src/ask/state.ts +10 -1
- package/src/ask/tool.ts +6 -1
- package/src/ask/view.ts +2 -1
- package/src/execution/agent-runner.ts +23 -1
- package/src/execution/fallback.ts +75 -0
- package/src/lobby/feed.ts +7 -0
- package/src/lobby/layout.ts +22 -1
- package/src/lobby/mini.ts +159 -0
- package/src/lobby/planner.ts +10 -3
- package/src/lobby/quickfix.ts +17 -3
- package/src/lobby/runtime.ts +27 -4
- package/src/lobby/view.ts +22 -7
- package/src/master/master.ts +1 -1
- package/src/master/research.ts +1 -0
- package/src/pi/events.ts +2 -0
- package/src/pi/master-fallback.ts +61 -0
- package/src/pi/model-support.ts +18 -3
- package/src/pi/settings-ui.ts +63 -10
- package/src/schemas/configuration.ts +43 -9
- package/src/schemas/findings.ts +2 -0
- package/src/workflow/workflow.ts +12 -2
package/src/workflow/workflow.ts
CHANGED
|
@@ -296,7 +296,7 @@ async function handleClarify(task: Task, params: OrchestrateParams, deps: Workfl
|
|
|
296
296
|
}
|
|
297
297
|
const answer = params.options?.length ? await deps.choose(question, params.options) : await deps.ask(question);
|
|
298
298
|
if (answer === undefined) {
|
|
299
|
-
return `
|
|
299
|
+
return `The user did not answer. Do not assume an answer or pick the recommended option: ask the user this again in your reply, end your turn, and continue only once they have answered.\n\nQuestion: ${question}`;
|
|
300
300
|
}
|
|
301
301
|
return `User answered: ${answer}`;
|
|
302
302
|
}
|
|
@@ -681,6 +681,10 @@ function workerRequest(deps: WorkflowDeps, task: Task, domain: Domain, instructi
|
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
683
|
|
|
684
|
+
const ANSWER_NOW = "Answer the questions now";
|
|
685
|
+
/** Times an agent's abandoned questions are put to the user again before it decides. */
|
|
686
|
+
const MAX_NUDGES = 5;
|
|
687
|
+
|
|
684
688
|
/** Agents that may ask the user themselves: the designer, whose choices are the user's to see. */
|
|
685
689
|
const ASKING_DOMAINS: ReadonlySet<Domain> = new Set(["designer"]);
|
|
686
690
|
|
|
@@ -706,7 +710,13 @@ function askRelay(task: Task, deps: WorkflowDeps, domain: Domain): { onAsk: Rela
|
|
|
706
710
|
if (isAutoMode(deps.root, deps.configDir, task.id)) {
|
|
707
711
|
return { answers: [], cancelled: true, globalNote: "Auto mode is on, so nobody can answer: decide with the options you recommend and say in your report what you chose and why." };
|
|
708
712
|
}
|
|
709
|
-
|
|
713
|
+
let result = await askQuestions(questions, label, signal);
|
|
714
|
+
// Leaving the questions must not quietly hand the choice to the agent: ask whether it may decide.
|
|
715
|
+
for (let nudges = 0; result.answers.length === 0 && result.cancelled && !signal.aborted && nudges < MAX_NUDGES; nudges++) {
|
|
716
|
+
const choice = await deps.choose(`${label} is waiting for your answer${questions.length === 1 ? "" : "s"} (${questions.map((question) => question.header).join(", ")}).`, [ANSWER_NOW, `Let ${label} decide with its recommendation`]);
|
|
717
|
+
if (choice !== ANSWER_NOW && choice !== undefined) break;
|
|
718
|
+
result = await askQuestions(questions, label, signal);
|
|
719
|
+
}
|
|
710
720
|
recordDecision(task, askedDecision(label, questions, result), domain);
|
|
711
721
|
return result;
|
|
712
722
|
});
|