Add Claude Ultracode with setting-change notices (#1625)

* Add Claude Ultracode mode notices

* Share provider notice definitions

* Test Claude Ultracode through public turn API
This commit is contained in:
Mohamed Boudra
2026-06-20 12:15:04 +08:00
committed by GitHub
parent 7af92120fe
commit 2b0740ff84
20 changed files with 310 additions and 53 deletions

View File

@@ -6,6 +6,11 @@ export interface AgentMetadata {
[key: string]: unknown;
}
export type AgentProviderNotice =
| { type: "info"; message: string }
| { type: "warning"; message: string }
| { type: "error"; message: string };
/**
* Stdio-based MCP server (spawns a subprocess).
*/

View File

@@ -178,6 +178,47 @@ describe("agent detach RPC", () => {
});
});
describe("agent setting action responses", () => {
test("parses optional provider notices on mode and thinking responses", () => {
const mode = SessionOutboundMessageSchema.parse({
type: "set_agent_mode_response",
payload: {
requestId: "req-mode",
agentId: "agent-1",
accepted: true,
error: null,
notice: {
type: "info",
message: "This change applies next turn.",
},
},
});
const thinking = SessionOutboundMessageSchema.parse({
type: "set_agent_thinking_response",
payload: {
requestId: "req-thinking",
agentId: "agent-1",
accepted: true,
error: null,
},
});
expect(mode.type).toBe("set_agent_mode_response");
if (mode.type !== "set_agent_mode_response") {
throw new Error("Expected set_agent_mode_response");
}
expect(mode.payload.notice).toEqual({
type: "info",
message: "This change applies next turn.",
});
expect(thinking.type).toBe("set_agent_thinking_response");
if (thinking.type !== "set_agent_thinking_response") {
throw new Error("Expected set_agent_thinking_response");
}
expect(thinking.payload.notice).toBeUndefined();
});
});
describe("file explorer request compatibility", () => {
test("acceptBinary is optional for old clients and accepted for new clients", () => {
expect(

View File

@@ -172,6 +172,7 @@ import type {
ProviderStatus,
AgentRuntimeInfo,
AgentTimelineItem,
AgentProviderNotice,
ToolCallDetail,
ToolCallTimelineItem,
AgentUsage,
@@ -202,6 +203,12 @@ const AgentSelectOptionSchema = z.object({
metadata: z.record(z.string(), z.unknown()).optional(),
});
const AgentProviderNoticeSchema: z.ZodType<AgentProviderNotice> = z.discriminatedUnion("type", [
z.object({ type: z.literal("info"), message: z.string() }),
z.object({ type: z.literal("warning"), message: z.string() }),
z.object({ type: z.literal("error"), message: z.string() }),
]);
export const AgentFeatureToggleSchema = z.object({
type: z.literal("toggle"),
id: z.string(),
@@ -1264,6 +1271,7 @@ const AgentActionResponsePayloadSchema = z.object({
agentId: z.string(),
accepted: z.boolean(),
error: z.string().nullable(),
notice: AgentProviderNoticeSchema.nullable().optional(),
});
export const SetAgentModeResponseMessageSchema = z.object({