@henryqw/pi-task-models 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/index.js +3 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -65,6 +65,8 @@ Package also exports config and route-resolution helpers for consumers.
|
|
|
65
65
|
|
|
66
66
|
Each configured profile needs one primary model and thinking level. Fallback is optional. Model references use canonical `provider/model`; numbered `openai-codex-N` routes store as `openai-codex/model`.
|
|
67
67
|
|
|
68
|
+
Profile thinking is authoritative for task routes. `pi-model-thinking.json` affects only active-session model selection and never overrides a task route.
|
|
69
|
+
|
|
68
70
|
Reads are strict. Malformed or unknown values fail visibly and never rewrite the file. Only explicit `/task-models` actions write config.
|
|
69
71
|
|
|
70
72
|
Consumers can call `resolveConfiguredTaskRoute(ctx, taskId)` for the first usable route or `resolveConfiguredTaskRoutes(ctx, taskId)` for primary and fallback routes. Both read strict shared config and fail with `/task-models` guidance when assignment, profile, or route is unavailable.
|
package/dist/index.js
CHANGED
|
@@ -211,17 +211,14 @@ export function resolveTaskModelRoute(ctx, route, agentDir = getAgentDir(), thin
|
|
|
211
211
|
if (!model)
|
|
212
212
|
return undefined;
|
|
213
213
|
const levels = taskThinkingLevels(ctx, model);
|
|
214
|
-
// An explicit requested level wins over
|
|
214
|
+
// An explicit requested level wins over the profile level; a model
|
|
215
215
|
// that cannot honor it is skipped so later fallback routes get considered.
|
|
216
216
|
if (thinking !== undefined) {
|
|
217
217
|
return levels.includes(thinking) ? { model, thinkingLevel: thinking } : undefined;
|
|
218
218
|
}
|
|
219
|
-
|
|
220
|
-
const remembered = rememberedThinkingLevel(model, agentDir);
|
|
221
|
-
const thinkingLevel = remembered && levels.includes(remembered) ? remembered : route.thinkingLevel;
|
|
222
|
-
if (!levels.includes(thinkingLevel))
|
|
219
|
+
if (!levels.includes(route.thinkingLevel))
|
|
223
220
|
return undefined;
|
|
224
|
-
return { model, thinkingLevel };
|
|
221
|
+
return { model, thinkingLevel: route.thinkingLevel };
|
|
225
222
|
}
|
|
226
223
|
export function resolveConfiguredTaskRoutes(ctx, task, agentDir = getAgentDir(), thinking) {
|
|
227
224
|
let config;
|