feat: add live model and thinking option preferences UI (#8)

* feat: add live model and thinking option preferences UI

* refactor: remove agent variant support and clean up thinking options

* feat: live model + thinking presets (RPC)
This commit is contained in:
Mohamed Boudra
2026-02-04 08:18:15 +07:00
committed by GitHub
parent 03f383b908
commit 469a25c724
50 changed files with 1976 additions and 894 deletions
+84 -1
View File
@@ -1086,7 +1086,90 @@ export class DaemonClientV2 {
}
async setAgentMode(agentId: string, modeId: string): Promise<void> {
this.sendSessionMessage({ type: "set_agent_mode", agentId, modeId });
const requestId = this.createRequestId();
const message = SessionInboundMessageSchema.parse({
type: "set_agent_mode_request",
agentId,
modeId,
requestId,
});
const response = this.waitFor(
(msg) => {
if (msg.type !== "set_agent_mode_response") {
return null;
}
if (msg.payload.requestId !== requestId) {
return null;
}
return msg.payload;
},
15000,
{ skipQueue: true }
);
await this.sendSessionMessageOrThrow(message);
const payload = await response;
if (!payload.accepted) {
throw new Error(payload.error ?? "setAgentMode rejected");
}
}
async setAgentModel(agentId: string, modelId: string | null): Promise<void> {
const requestId = this.createRequestId();
const message = SessionInboundMessageSchema.parse({
type: "set_agent_model_request",
agentId,
modelId,
requestId,
});
const response = this.waitFor(
(msg) => {
if (msg.type !== "set_agent_model_response") {
return null;
}
if (msg.payload.requestId !== requestId) {
return null;
}
return msg.payload;
},
15000,
{ skipQueue: true }
);
await this.sendSessionMessageOrThrow(message);
const payload = await response;
if (!payload.accepted) {
throw new Error(payload.error ?? "setAgentModel rejected");
}
}
async setAgentThinkingOption(
agentId: string,
thinkingOptionId: string | null
): Promise<void> {
const requestId = this.createRequestId();
const message = SessionInboundMessageSchema.parse({
type: "set_agent_thinking_request",
agentId,
thinkingOptionId,
requestId,
});
const response = this.waitFor(
(msg) => {
if (msg.type !== "set_agent_thinking_response") {
return null;
}
if (msg.payload.requestId !== requestId) {
return null;
}
return msg.payload;
},
15000,
{ skipQueue: true }
);
await this.sendSessionMessageOrThrow(message);
const payload = await response;
if (!payload.accepted) {
throw new Error(payload.error ?? "setAgentThinkingOption rejected");
}
}
async restartServer(