Repository navigation
Make Engine Settings Consistent #1112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jaywedgeworth22
merged 25 commits into
main
from
codex/1111-engine-settings-consistency
Oct 13, 2026
+389
−401
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
c4bd3c5
Standardize neutral engine facts
jaywedgeworth22 46291d5
Unify engine rows and connection actions
jaywedgeworth22 a4c7ddf
Keep ASCII.dev Box in Computer settings
jaywedgeworth22 8fc016c
Use platform marks in capability rows
jaywedgeworth22 1514009
Test neutral engine facts
jaywedgeworth22 610c2d3
Test Box settings ownership
jaywedgeworth22 2fb0e8f
Test platform-mark capability rows
jaywedgeworth22 725f410
Remove obsolete engine callout import
jaywedgeworth22 5029319
Preserve capability mark literals
jaywedgeworth22 af4ff6a
Update model picker engine facts
jaywedgeworth22 274bec6
Keep capability rows and platform marks complete
jaywedgeworth22 81f3fc5
Expose OpenAI-compatible visibility rule
jaywedgeworth22 bb55100
Cover engine row visibility visually
jaywedgeworth22 38fa651
Add exact engine settings screenshots
jaywedgeworth22 16c1b70
Scope hidden OpenAI row assertion
jaywedgeworth22 ce10a1f
Add configured engine settings baseline
jaywedgeworth22 721a9f7
Scope Codex row assertion
jaywedgeworth22 6cb83cf
Add hidden engine settings baseline
jaywedgeworth22 5c3a81f
Keep local models out of engine facts
jaywedgeworth22 72b5661
Update Box placement contract
jaywedgeworth22 c04850c
Allow per-engine user model settings
jaywedgeworth22 e1afabb
Validate engine model additions
jaywedgeworth22 29040bb
Expose user-added engine models
jaywedgeworth22 114b09d
Add per-engine model entry form
jaywedgeworth22 fbaa8a5
fix(engines): validate model edits and cover endpoint visibility
jaywedgeworth22 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| import { describe, expect, it } from "vitest"; | ||
| import { instanceModelsSchema } from "./instance-models.ts"; | ||
|
|
||
| describe("instance model edits", () => { | ||
| it("trims and strips incoming fields, and accepts an explicit cleared catalog", () => { | ||
| expect(instanceModelsSchema.parse([{ id: " model/a ", label: " Model A ", unexpected: true }])) | ||
| .toEqual([{ id: "model/a", label: "Model A" }]); | ||
| expect(instanceModelsSchema.parse([])).toEqual([]); | ||
| }); | ||
|
|
||
| it("rejects malformed, excessive, multiline, and duplicate entries", () => { | ||
| const valid = { id: "model/a", label: "Model A" }; | ||
| const invalid = [null, {}, [null], [{ id: 1, label: "A" }], | ||
| [{ id: " ", label: "A" }], [{ id: "a", label: "" }], | ||
| [{ id: "a\nb", label: "A" }], [{ id: "a", label: "A\rB" }], | ||
| [{ id: "a".repeat(201), label: "A" }], [{ id: "a", label: "A".repeat(201) }], | ||
| [valid, { id: " model/a ", label: "Another label" }], | ||
| Array.from({ length: 101 }, (_, index) => ({ id: `model/${index}`, label: "A" }))]; | ||
| for (const input of invalid) expect(instanceModelsSchema.safeParse(input).success).toBe(false); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| import { z } from "zod"; | ||
|
|
||
| const modelText = z.string().trim().min(1).max(200).regex(/^[^\r\n]+$/); | ||
|
|
||
| /** Parse model edits at the instance HTTP boundary before persisting them. */ | ||
| export const instanceModelsSchema = z.array(z.object({ | ||
| id: modelText, | ||
| label: modelText, | ||
| }).strip()).max(100).superRefine((models, context) => { | ||
| const seen = new Set<string>(); | ||
| for (const [index, model] of models.entries()) { | ||
| if (seen.has(model.id)) { | ||
| context.addIssue({ code: "custom", path: [index, "id"], message: "Duplicate model ID" }); | ||
| } | ||
| seen.add(model.id); | ||
| } | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,128 +1,45 @@ | ||
| // EngineCallout shape tests — every known engine renders a collapsed | ||
| // "More Info" disclosure by default, and the headline, prose, and | ||
| // registry pricing pill when expanded. Replaces the legacy | ||
| // MiniMaxCallout.test.ts; the new copy is shared across all engines so | ||
| // the matrix and the callout cannot drift. | ||
| import { describe, expect, it } from "vitest"; | ||
| import { createElement } from "react"; | ||
| import { renderToStaticMarkup } from "react-dom/server"; | ||
|
|
||
| import { EngineCallout } from "./EngineCallout.tsx"; | ||
| import { | ||
| CAPABILITY_LABELS, | ||
| ENGINE_CAPABILITIES, | ||
| ENGINE_DISPLAY_ORDER, | ||
| engineIdFromDriverKind, | ||
| } from "@/lib/engine-capabilities.tsx"; | ||
|
|
||
| // EngineCallout emits JSON-style HTML where ASCII apostrophes and | ||
| // quotes are HTML-escaped by `react-dom/server`'s serializer. Comparing | ||
| // a raw headline that contains an apostrophe against the rendered | ||
| // markup via toContain() produces a false negative; this helper | ||
| // normalizes both sides before comparing. Curly quotes (U+2018 / | ||
| // U+2019) are passed through by the serializer, so only the ASCII | ||
| // entities need decoding. Pinned by the headline-render test. | ||
| function decodeHtmlEntities(text: string): string { | ||
| return text | ||
| .replace(/'/g, "'") | ||
| .replace(/'/g, "'") | ||
| .replace(/'/g, "'") | ||
| .replace(/"/g, '"') | ||
| .replace(/&/g, "&") | ||
| .replace(/</g, "<") | ||
| .replace(/>/g, ">"); | ||
| } | ||
| import { ENGINE_CAPABILITIES, ENGINE_DISPLAY_ORDER, engineIdFromDriverKind } from "@/lib/engine-capabilities.tsx"; | ||
|
|
||
| describe("EngineCallout", () => { | ||
| it("renders collapsed by default for every engine id in the registry", () => { | ||
| it("shows the same neutral facts for every registered engine", () => { | ||
| for (const id of ENGINE_DISPLAY_ORDER) { | ||
| const entry = ENGINE_CAPABILITIES[id]; | ||
| const html = renderToStaticMarkup(createElement(EngineCallout, { engineId: id })); | ||
| // The trigger is a neutral disclosure, not a repeated engine pitch. | ||
| const decoded = decodeHtmlEntities(html); | ||
| // And it is sized to its label, not stretched across the row. Checked as an | ||
| // exact class prefix: a bare `not.toContain("w-full")` would also match | ||
| // inside `max-w-full` and pass for the wrong reason. | ||
| expect(html).toContain("inline-flex w-auto max-w-full"); | ||
| // The label is split across a <strong>, so compare the text, not markup. | ||
| const label = decodeHtmlEntities(html.replace(/<[^>]+>/g, " ")) | ||
| .replace(/\s+/g, " ") | ||
| .trim(); | ||
| expect(label).toContain("More Info"); | ||
| expect(label).not.toContain("Why This Engine?"); | ||
| expect(html).toContain(`aria-label="More Info about ${entry.displayName}"`); | ||
| expect(decoded).not.toContain(entry.whyThisEngine.headline); | ||
| // Collapsed: one-line summary — no prose paragraphs, no pricing line. | ||
| // Avoid /<p/ — Lucide's <path> would falsely match. | ||
| expect(html).not.toMatch(/<p[\s>]/); | ||
| expect(html).not.toContain("Billing:"); | ||
| expect(html).toContain('aria-expanded="false"'); | ||
| expect(html).toContain("aria-hidden"); | ||
| // No dangling reference: the detail region is not rendered collapsed. | ||
| expect(html).not.toContain("aria-controls"); | ||
| expect(html).toContain("Access:"); | ||
| expect(html).toContain("Billing:"); | ||
| expect(html).toContain("Models:"); | ||
| expect(html).not.toContain("More Info"); | ||
| expect(html).not.toContain(entry.whyThisEngine.headline); | ||
| expect(html).not.toContain("aria-expanded"); | ||
| } | ||
| }); | ||
|
|
||
| it("expands to show headline, prose, and pricing when defaultOpen is set", () => { | ||
| const entry = ENGINE_CAPABILITIES.minimax; | ||
| it("uses the live instance model ids when supplied", () => { | ||
| const html = renderToStaticMarkup( | ||
| createElement(EngineCallout, { engineId: "minimax", defaultOpen: true }), | ||
| ); | ||
| expect(html).toContain('aria-expanded="true"'); | ||
| expect(html).toMatch(/<p[\s>]/); | ||
| expect(html).toContain("Access: API"); | ||
| expect(html).toContain("Billing: Subscription + API"); | ||
| const decoded = decodeHtmlEntities(html); | ||
| expect(decoded).toContain(entry.whyThisEngine.headline); | ||
| expect(decoded).toContain(entry.whyThisEngine.prose[0]); | ||
| }); | ||
|
|
||
| it("uses a unique aria-controls id per instanceId", () => { | ||
| const a = renderToStaticMarkup( | ||
| createElement(EngineCallout, { | ||
| engineId: "minimax", | ||
| instanceId: "mm-a", | ||
| defaultOpen: true, | ||
| engineId: "openai-compat", | ||
| models: ["vendor/model-a", "vendor/model-b"], | ||
| }), | ||
| ); | ||
| const b = renderToStaticMarkup( | ||
| createElement(EngineCallout, { | ||
| engineId: "minimax", | ||
| instanceId: "mm-b", | ||
| defaultOpen: true, | ||
| }), | ||
| ); | ||
| expect(a).toContain('aria-controls="engine-callout-detail-mm-a"'); | ||
| expect(a).toContain('id="engine-callout-detail-mm-a"'); | ||
| expect(b).toContain("engine-callout-detail-mm-b"); | ||
| expect(a).not.toContain("engine-callout-detail-mm-b"); | ||
| expect(html).toContain("vendor/model-a, vendor/model-b"); | ||
| expect(html).not.toContain("meta-llama/llama-3.3-70b-instruct"); | ||
| }); | ||
|
|
||
| it("resolves driver-kind ids via engineIdFromDriverKind", () => { | ||
| const html = renderToStaticMarkup( | ||
| createElement(EngineCallout, { driverKind: "grokAgent", defaultOpen: true }), | ||
| ); | ||
| const decoded = decodeHtmlEntities(html); | ||
| expect(decoded).toContain(ENGINE_CAPABILITIES.grok.whyThisEngine.headline); | ||
| it("keeps a long catalog compact while stating how many ids remain", () => { | ||
| const models = Array.from({ length: 8 }, (_, index) => `model-${index + 1}`); | ||
| const html = renderToStaticMarkup(createElement(EngineCallout, { engineId: "grok", models })); | ||
| expect(html).toContain("model-1, model-2, model-3, model-4, model-5, model-6 +2 more"); | ||
| expect(html).not.toContain("model-7"); | ||
| }); | ||
|
|
||
| it("renders the fallback headline when expanded for an unknown engine id", () => { | ||
| const html = renderToStaticMarkup( | ||
| createElement(EngineCallout, { engineId: "nope", defaultOpen: true }), | ||
| ); | ||
| expect(html).toContain("Engine not in the capability registry yet"); | ||
| }); | ||
|
|
||
| it("engineIdFromDriverKind strips the Agent suffix for known drivers", () => { | ||
| expect(engineIdFromDriverKind("grokAgent")).toBe("grok"); | ||
| expect(engineIdFromDriverKind("claudeAgent")).toBe("claude"); | ||
| it("resolves runtime driver kinds to registry ids", () => { | ||
| const html = renderToStaticMarkup(createElement(EngineCallout, { driverKind: "grokAgent" })); | ||
| expect(html).toContain("Access:"); | ||
| expect(engineIdFromDriverKind("dshAgent")).toBe("deepseek-harness"); | ||
| expect(engineIdFromDriverKind("cursorAgent")).toBe("cursor"); | ||
| expect(engineIdFromDriverKind("antigravityAgent")).toBe("antigravity"); | ||
| }); | ||
|
|
||
| it("renders every capability label as expected prose container", () => { | ||
| expect(CAPABILITY_LABELS.files).toBe("Files"); | ||
| expect(CAPABILITY_LABELS.crossBotCoordination).toBe("Cross-Bot Coordination"); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.