feat(agent): unify models and validate OpenCode providers
Generate chat, task and learning models from agent-models.json. Use WaterNetwork fast/expert models with 272k context and validate upstream names before readiness. Add an isolated model check command with signal-safe cleanup and plugin, Skill and MCP management docs. Verified in isolation: type checks, 26 focused tests and both model catalog checks; no model inference requests.
This commit is contained in:
@@ -2,6 +2,7 @@ import { z } from "zod";
|
||||
|
||||
import { writeLearningAuditLog } from "../audit/learningAudit.js";
|
||||
import { type SupportedModel } from "../chat/models.js";
|
||||
import { toRuntimeModel } from "../chat/modelConfig.js";
|
||||
import { type ChatRequestContext } from "../chat/sessionBridge.js";
|
||||
import { config } from "../config.js";
|
||||
import { type SessionTurnRecord, SessionTranscriptStore } from "../sessions/transcriptStore.js";
|
||||
@@ -158,7 +159,7 @@ export class LearningOrchestrator {
|
||||
await this.runtime.prompt(
|
||||
gateSession.id,
|
||||
buildGatePrompt({ recentTurns }),
|
||||
GATE_MODEL,
|
||||
toRuntimeModel(config.LEARNING_GATE_MODEL),
|
||||
);
|
||||
const messages = await this.runtime.messages(gateSession.id, 20);
|
||||
const assistantMessage = [...messages]
|
||||
@@ -558,25 +559,6 @@ const collectTextContent = (
|
||||
.map((part) => part.text)
|
||||
.join("");
|
||||
|
||||
const toRuntimeModel = (model?: SupportedModel) => {
|
||||
if (!model) {
|
||||
return undefined;
|
||||
}
|
||||
const [providerID, modelID] = model.split("/");
|
||||
if (!providerID || !modelID) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
modelID,
|
||||
providerID,
|
||||
};
|
||||
};
|
||||
|
||||
const GATE_MODEL = {
|
||||
modelID: "deepseek-flash",
|
||||
providerID: "deepseek",
|
||||
} as const;
|
||||
|
||||
const REDACTED_AUDIT_FIELD = "[redacted by persistence policy]";
|
||||
|
||||
const sanitizeAuditDetail = (detail?: string) => {
|
||||
|
||||
Reference in New Issue
Block a user