Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/app/src/context/orchestrate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2699,6 +2699,7 @@ export const { use: useOrchestrate, provider: OrchestrateProvider } = createSimp
model: { providerID: string; modelID: string }
models?: OrchestrateRoleModelOverrides
agent: string
allowInteractiveQuestions?: boolean
tokenBudget?: number
maxParallelAgents?: number
maxRecursionDepth?: number
Expand Down Expand Up @@ -2778,6 +2779,9 @@ export const { use: useOrchestrate, provider: OrchestrateProvider } = createSimp
providerID: roleModels.master.providerID,
modelID: roleModels.master.modelID,
models: roleModels,
...(typeof opts.allowInteractiveQuestions === "boolean"
? { allowInteractiveQuestions: opts.allowInteractiveQuestions }
: {}),
...(opts.tokenBudget ? { tokenBudget: opts.tokenBudget } : {}),
...(opts.maxParallelAgents ? { maxParallelAgents: opts.maxParallelAgents } : {}),
...(opts.maxRecursionDepth ? { maxRecursionDepth: opts.maxRecursionDepth } : {}),
Expand Down
11 changes: 11 additions & 0 deletions packages/app/src/pages/orchestrate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import { Button } from "@oneshot-ai/ui/button"
import { IconButton } from "@oneshot-ai/ui/icon-button"
import { Icon } from "@oneshot-ai/ui/icon"
import { Select } from "@oneshot-ai/ui/select"
import { Switch as ToggleSwitch } from "@oneshot-ai/ui/switch"
import { Tooltip } from "@oneshot-ai/ui/tooltip"
import { ProviderIcon } from "@oneshot-ai/ui/provider-icon"
import type { IconName } from "@oneshot-ai/ui/icons/provider"
Expand Down Expand Up @@ -1562,6 +1563,7 @@ function PromptForm() {
const [tokenBudget, setTokenBudget] = createSignal<BudgetOption>(BUDGET_OPTIONS[2]) // 5M default
const [maxParallel, setMaxParallel] = createSignal<ParallelOption>(PARALLEL_OPTIONS[2]) // 20 default
const [maxDepth, setMaxDepth] = createSignal<DepthOption>(DEPTH_OPTIONS[2]) // 5 default
const [allowInteractiveQuestions, setAllowInteractiveQuestions] = createSignal(false)
const [showAdvancedRouting, setShowAdvancedRouting] = createSignal(false)
const [roleModels, setRoleModels] = createStore<OrchestrateRoleModelOverrides>({})

Expand Down Expand Up @@ -1732,6 +1734,7 @@ function PromptForm() {
}
: {}),
agent: currentAgent.name,
allowInteractiveQuestions: allowInteractiveQuestions(),
tokenBudget: tokenBudget().value,
maxParallelAgents: maxParallel().value,
maxRecursionDepth: maxDepth().value,
Expand Down Expand Up @@ -2015,6 +2018,14 @@ function PromptForm() {
onSelect={(o) => o && setMaxDepth(o)}
/>
</div>

<div class="flex items-center gap-2">
<span class="text-11-regular text-text-weak">Questions</span>
<ToggleSwitch
checked={allowInteractiveQuestions()}
onChange={setAllowInteractiveQuestions}
/>
</div>
</div>
</div>
</form>
Expand Down
17 changes: 17 additions & 0 deletions packages/oneshot/src/orchestrator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ function resolveConfiguredMaxReplanCycles(): number {

const DEFAULT_MAX_REPLAN_CYCLES = resolveConfiguredMaxReplanCycles()

function parseBooleanFlag(value: string | undefined, fallback: boolean): boolean {
if (!value?.trim()) return fallback
const normalized = value.trim().toLowerCase()
if (["1", "true", "yes", "on"].includes(normalized)) return true
if (["0", "false", "no", "off"].includes(normalized)) return false
return fallback
}

const DEFAULT_ALLOW_INTERACTIVE_QUESTIONS = parseBooleanFlag(
process.env.ONESHOT_ORCHESTRATOR_ALLOW_INTERACTIVE_QUESTIONS,
false,
)

function resolveRunMaxReplanCycles(
requested: number | undefined,
opts: { upgradeLegacyDefault?: boolean } = {},
Expand Down Expand Up @@ -94,6 +107,7 @@ export async function startOrchestration(opts: {
providerID: string
modelID: string
models?: RunModelOverrides
allowInteractiveQuestions?: boolean
tokenBudget?: number
maxParallelAgents?: number
maxRecursionDepth?: number
Expand Down Expand Up @@ -126,6 +140,9 @@ export async function startOrchestration(opts: {
provider: runModels.master.providerID,
model: runModels.master.modelID,
models: runModels,
allowInteractiveQuestions: typeof opts.allowInteractiveQuestions === "boolean"
? opts.allowInteractiveQuestions
: DEFAULT_ALLOW_INTERACTIVE_QUESTIONS,
tokenBudget,
tokenKillThreshold: killThreshold,
globalTokenUsage: { inputTokens: 0, outputTokens: 0, totalTokens: 0 },
Expand Down
Loading