Fix agent model fallback and title/branch tool parsing

This commit is contained in:
Mohamed Boudra
2026-01-23 10:14:46 +07:00
parent 53155ebcc9
commit f8ba0ff239
3 changed files with 11 additions and 2 deletions
@@ -11,12 +11,12 @@ describe("extractAgentModel", () => {
expect(extractAgentModel(agent)).toBe("gpt-5.2-codex");
});
it("returns null when runtime model missing even if config model is set", () => {
it("returns configured model when runtime model is missing", () => {
const agent = {
model: "gpt-5.1-codex",
runtimeInfo: {},
} as Partial<Agent> as Agent;
expect(extractAgentModel(agent)).toBeNull();
expect(extractAgentModel(agent)).toBe("gpt-5.1-codex");
});
});
@@ -1161,6 +1161,12 @@ const TOOL_NAME_MAP: Record<string, string> = {
Bash: "Shell",
read_file: "Read",
apply_patch: "Edit",
"agent-control.set_title": "Set title",
"agent-control.set_branch": "Set branch",
set_title: "Set title",
set_branch: "Set branch",
"mcp__agent-control__set_title": "Set title",
"mcp__agent-control__set_branch": "Set branch",
};
const ToolCallDisplaySchema = z