Subagents: Min and Max, one range with two handles, counting this agent (harness spec 3.3.0)
ci / check (push) Waiting to run

/effort's Subagents row and /team size are a two-handle range from 1 to the cap (left/right move
the handle in focus, tab the other, enter sets both); the dialog gains a range row. Every text says
Min and Max, never fewest/most, and that the count includes this agent: "Subagents: Min 1, Max 4 -
1 is this agent alone". /settings shows the same beside agents.min / agents.max; config schema
and the bounds refusal likewise. CHANGELOG in the 2.0.0-beta.5 section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Opus 5.5 committed 2026-11-09 18:09:31 +00:00
1 parent 3a206959b6
commit 6a0e0ed145
11 files changed
+183 -42

No files matched your search

+47
View File
@@ -36,3 +36,50 @@ test("dialog: arrow down + enter picks the second option — with a spec that cl
expect(picked).toEqual(["b"])
expect(closed).toBe(1)
})
test("dialog: a range row is one track with two handles — ←→ move the one in focus, tab the other, enter hands both over", async () => {
const set: [number, number][] = []
const picked: string[] = []
const ctx = { theme: () => DEFAULT_THEME, dims: () => ({ width: 72, height: 16 }) } as never
const [spec, setSpec] = createSignal<DialogSpec | undefined>({
title: "Effort",
options: [
{ label: "high", value: "high", current: true },
{ label: "Subagents", value: "team", description: "1 is this agent alone", range: { from: 1, to: 32, lo: 1, hi: 4, names: ["Min", "Max"], onSubmit: (lo, hi) => set.push([lo, hi]) } },
],
onSelect: (v) => picked.push(v),
})
setup = await testRender(
() => (
<TuiContext.Provider value={ctx}>
<Show when={spec()}>
<Dialog spec={spec()!} close={() => setSpec(undefined)} />
</Show>
</TuiContext.Provider>
),
{ width: 72, height: 16 },
)
await setup.renderOnce()
expect(setup.captureCharFrame()).toContain("Subagents Min 1 ●")
setup.mockInput.pressArrow("down")
await setup.renderOnce()
expect(setup.captureCharFrame()).toContain("←→ move Max · tab Min")
setup.mockInput.pressArrow("right")
setup.mockInput.pressArrow("right")
await setup.renderOnce()
expect(setup.captureCharFrame()).toContain("Max 6")
setup.mockInput.pressTab()
setup.mockInput.pressArrow("right")
setup.mockInput.pressArrow("right")
setup.mockInput.pressArrow("left")
await setup.renderOnce()
expect(setup.captureCharFrame()).toContain("Min 2")
// Min never passes Max, and Min never goes under 1.
for (let i = 0; i < 10; i++) setup.mockInput.pressArrow("right")
await setup.renderOnce()
expect(setup.captureCharFrame()).toContain("Min 6")
setup.mockInput.pressEnter()
await setup.renderOnce()
expect(set).toEqual([[6, 6]])
expect(picked).toEqual([])
})