You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The question tool accepts an empty question list and then answers or hangs #792
QuestionTool.execute validates the question list with:
constinvalid=params.questions.find((question)=>question.options.length<2||!question.options[0]?.label.endsWith("(Recommended)"),)if(invalid)thrownewError("Planning and consequential questions need at least two concrete choices, ...")
Array.prototype.find on an empty array returns undefined, so questions: [] passes the only guard. The tool then takes one of two wrong paths, depending on autonomy:
Autonomous / balanced-planning — recommendedResolution maps over an empty list:
title: "Continued with 0 recommended choices"
output: "OpenScience continued without pausing. Assumption recorded: ."
metadata: { answers: [], assumptions: [] }
The model is told an assumption was recorded when none was, and the trailing Assumption recorded: . is a visibly broken sentence it has to reason about.
Interactive — Question.ask({ questions: [] }) publishes a question.asked event carrying zero questions and returns a promise that only settles on a UI reply or an abort. The turn stalls on a card with nothing to answer until the user interrupts.
Why it is wrong
Both outcomes misreport what happened. One invents a decision, the other blocks the turn indefinitely. Either way the model believes something false about the state of its own run, and neither mentions that no question was asked.
Reproduction
consttool=awaitQuestionTool.init()awaittool.execute({reason: "consequential",questions: []},ctx)// resolves, instead of throwing
awaittool.execute({reason: "consequential",questions: []},{ ...ctx,extra: {delegationSettings: {level: "standard",autonomy: "autonomous"}}},)// -> "OpenScience continued without pausing. Assumption recorded: ."
The existing suite covers valid input, planning, balanced, autonomous, missing-authority, and the fail-closed recommended-choice rule, but never an empty array.
Suggested fix
Refuse an empty list at the top of execute, before the recommended-choice guard, with a message written for the model in the same style as the existing throw.
Activity