fix: keep research available without search keys

This commit is contained in:
amosblomqvist
2026-10-24 06:52:36 +03:00
parent 6cba9c8c5a
commit 4bd20be529
11 changed files with 277 additions and 129 deletions
-16
View File
@@ -15,7 +15,6 @@ import {
composeSlotModel,
composeTool,
composeQuizMechanics,
researchToolUnavailable,
sectionedSegments,
} from "../components/settings/agent-section.tsx";
import { nextOverrides } from "../components/settings/keyboard-section.tsx";
@@ -328,21 +327,6 @@ describe("first-run gate — slotsConfigured + setupStage (model-slots wave)", (
});
});
describe("researchToolUnavailable — the row grays on the registry's own signal", () => {
it("research grays exactly when the live search status says unavailable", () => {
// the SAME /api/search signal chat-handler's searchAvailable uses —
// the row and the registry can never disagree (Teacher flag 2026-09-22)
assert.equal(researchToolUnavailable("research", { available: false }), true);
assert.equal(researchToolUnavailable("research", { available: true }), false);
// loading/failed fetch grays nothing (never a false-negative row)
assert.equal(researchToolUnavailable("research", null), false);
// only research — the other tools never touch the search port
for (const id of ["demo", "visual", "pdf"]) {
assert.equal(researchToolUnavailable(id, { available: false }), false);
}
});
});
describe("sectionedSegments — the prompts overhaul (2026-09-26)", () => {
// The server contract: BOTH per-agent lists include the shared
// segments (same paths) — the view must list them ONCE.