-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expose reasoning controls in GJC model exports #5431
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -297,7 +297,7 @@ describe("gajae", () => { | |
| expect(block.apiKey).toBe(LOOPBACK_API_KEY_PLACEHOLDER); | ||
| expect(block).not.toHaveProperty("apiKeyEnv"); | ||
| expect(Object.keys(block).sort()).toEqual(["api", "apiKey", "baseUrl", "models"]); | ||
| const allowed = new Set(["id", "name", "input", "contextWindow", "maxTokens"]); | ||
| const allowed = new Set(["id", "name", "input", "contextWindow", "maxTokens", "reasoning", "thinking", "compat"]); | ||
| for (const model of block.models) { | ||
| for (const key of Object.keys(model)) expect(allowed.has(key)).toBe(true); | ||
| } | ||
|
|
@@ -306,6 +306,52 @@ describe("gajae", () => { | |
| test("the destination is the documented models file", () => { | ||
| expect(gajaeConfigPath({}, "/home/u")).toBe(join("/home/u", ".gjc", "agent", "models.yml")); | ||
| }); | ||
|
|
||
| test("exports a declared effort ladder as GJC reasoning metadata", () => { | ||
| const doc = buildClientConfig("gajae", { | ||
| ...ctx(), | ||
| models: [{ | ||
| namespaced: "deepseek/deepseek-v4.1-flash", | ||
| provider: "deepseek", | ||
| id: "deepseek-v4.1-flash", | ||
| inputModalities: ["text"], | ||
| reasoningEfforts: ["max", "low", "medium", "high", "xhigh", "none", "turbo"], | ||
| }], | ||
| }) as GajaeGeneratedConfig; | ||
|
|
||
| expect(doc.providers[OPENCODE_PROVIDER_ID]!.models).toEqual([{ | ||
| id: "deepseek/deepseek-v4.1-flash", | ||
| name: "deepseek-v4.1-flash (deepseek)", | ||
| input: ["text"], | ||
| reasoning: true, | ||
| thinking: { | ||
| mode: "effort", | ||
| minLevel: "low", | ||
| maxLevel: "max", | ||
| levels: ["low", "medium", "high", "xhigh", "max"], | ||
| }, | ||
| compat: { supportsReasoningEffort: true }, | ||
| }]); | ||
| }); | ||
|
|
||
| test("exports the native Codex effort ladder even when the catalog omits it", () => { | ||
| const doc = buildClientConfig("gajae", { | ||
| ...ctx(), | ||
| models: [{ | ||
| namespaced: "gpt-5.6-sol", | ||
| provider: "openai", | ||
| id: "gpt-5.6-sol", | ||
| native: true, | ||
| inputModalities: ["text", "image"], | ||
| }], | ||
| }) as GajaeGeneratedConfig; | ||
|
|
||
| expect(doc.providers[OPENCODE_PROVIDER_ID]!.models[0]).toMatchObject({ | ||
| reasoning: true, | ||
| thinking: { mode: "effort", levels: ["low", "medium", "high", "xhigh", "max"] }, | ||
| compat: { supportsReasoningEffort: true }, | ||
| }); | ||
| }); | ||
|
Comment on lines
+309
to
+354
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: sed -n '285,365p' tests/config/client-config-export-new-clients.test.ts
sed -n '1090,1128p' src/clients/config-export.ts
sed -n '45,85p' src/reasoning-effort.tsRepository: lidge-jun/opencodex Length of output: 6885 🏁 Script executed: set -eu
printf '%s\n' '--- config-export symbols and callers ---'
rg -n -C 4 'function buildClientConfig|buildClientConfig|canonicalizeReasoningEfforts|reasoningEfforts|GajaeGeneratedConfig' src tests | head -n 240
printf '%s\n' '--- exact exporter implementation ---'
nl -ba src/clients/config-export.ts | sed -n '1060,1145p'
printf '%s\n' '--- exact relevant tests ---'
nl -ba tests/config/client-config-export-new-clients.test.ts | sed -n '270,365p'
printf '%s\n' '--- Gajae types/schema/consumer references ---'
rg -n -C 3 'GJC|gajae|models\.yml|supportsReasoningEffort|thinking|reasoning' src tests docs README.md 2>/dev/null | head -n 260Repository: lidge-jun/opencodex Length of output: 41771 Add a negative Gajae export test for excluded-only effort ladders. The existing test detects a regression that leaves Add a model with 🤖 Prompt for AI Agents |
||
| }); | ||
|
|
||
| describe("contributions name every fragment we own", () => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: lidge-jun/opencodex
Length of output: 33680
Derive the native Codex ladder from canonical provider metadata. The fallback hardcodes provider capability metadata outside the registry and derivation flow. If the canonical ladder changes, this exporter can advertise stale levels. Define the native ladder in the canonical provider metadata and derive
model.reasoningEffortsfrom it before exporting.🤖 Prompt for AI Agents