mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
Fix agent model fallback and title/branch tool parsing
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -22,6 +22,9 @@ const PrincipalParamSchema = z.union([
|
||||
// Command as array (Codex sends this)
|
||||
z.object({ command: z.array(z.string()).nonempty() }).transform((d) => ({ type: "command" as const, value: d.command.join(" ") })),
|
||||
// Other text params
|
||||
z.object({ title: z.string() }).transform((d) => ({ type: "text" as const, value: d.title })),
|
||||
z.object({ name: z.string() }).transform((d) => ({ type: "text" as const, value: d.name })),
|
||||
z.object({ branch: z.string() }).transform((d) => ({ type: "text" as const, value: d.branch })),
|
||||
z.object({ pattern: z.string() }).transform((d) => ({ type: "text" as const, value: d.pattern })),
|
||||
z.object({ query: z.string() }).transform((d) => ({ type: "text" as const, value: d.query })),
|
||||
z.object({ url: z.string() }).transform((d) => ({ type: "text" as const, value: d.url })),
|
||||
|
||||
Reference in New Issue
Block a user