fix: land #569 and restore gate (thanks @bjesuiter)
This commit is contained in:
parent
71ecfb0b86
commit
ce9769ab09
@ -46,6 +46,7 @@
|
|||||||
- Control UI: show/patch per-session reasoning level and render extracted reasoning in chat.
|
- Control UI: show/patch per-session reasoning level and render extracted reasoning in chat.
|
||||||
- Control UI: queue outgoing chat messages, add Enter-to-send, and show queued items. (#527) — thanks @YuriNachos
|
- Control UI: queue outgoing chat messages, add Enter-to-send, and show queued items. (#527) — thanks @YuriNachos
|
||||||
- Control UI: drop explicit `ui:install` step; `ui:build` now auto-installs UI deps (docs + update flow).
|
- Control UI: drop explicit `ui:install` step; `ui:build` now auto-installs UI deps (docs + update flow).
|
||||||
|
- Control UI: default control UI asset base to relative paths for subpath hosting. (#569) — thanks @bjesuiter
|
||||||
- Telegram: retry long-polling conflicts with backoff to avoid fatal exits.
|
- Telegram: retry long-polling conflicts with backoff to avoid fatal exits.
|
||||||
- Telegram: fix grammY fetch type mismatch when injecting `fetch`. (#512) — thanks @YuriNachos
|
- Telegram: fix grammY fetch type mismatch when injecting `fetch`. (#512) — thanks @YuriNachos
|
||||||
- WhatsApp: resolve @lid JIDs via Baileys mapping to unblock inbound messages. (#415)
|
- WhatsApp: resolve @lid JIDs via Baileys mapping to unblock inbound messages. (#415)
|
||||||
|
|||||||
@ -80,7 +80,7 @@ describe("Agent-specific sandbox config", () => {
|
|||||||
|
|
||||||
expect(context).toBeDefined();
|
expect(context).toBeDefined();
|
||||||
expect(context?.enabled).toBe(true);
|
expect(context?.enabled).toBe(true);
|
||||||
});
|
}, 20000);
|
||||||
|
|
||||||
it("should allow agent-specific docker setupCommand overrides", async () => {
|
it("should allow agent-specific docker setupCommand overrides", async () => {
|
||||||
const { resolveSandboxContext } = await import("./sandbox.js");
|
const { resolveSandboxContext } = await import("./sandbox.js");
|
||||||
|
|||||||
@ -179,14 +179,22 @@ async function ensureDevGatewayConfig(opts: { reset?: boolean }) {
|
|||||||
mode: "local",
|
mode: "local",
|
||||||
bind: "loopback",
|
bind: "loopback",
|
||||||
},
|
},
|
||||||
agent: {
|
agents: {
|
||||||
workspace,
|
defaults: {
|
||||||
skipBootstrap: true,
|
workspace,
|
||||||
},
|
skipBootstrap: true,
|
||||||
identity: {
|
},
|
||||||
name: DEV_IDENTITY_NAME,
|
list: [
|
||||||
theme: DEV_IDENTITY_THEME,
|
{
|
||||||
emoji: DEV_IDENTITY_EMOJI,
|
id: "main",
|
||||||
|
default: true,
|
||||||
|
identity: {
|
||||||
|
name: DEV_IDENTITY_NAME,
|
||||||
|
theme: DEV_IDENTITY_THEME,
|
||||||
|
emoji: DEV_IDENTITY_EMOJI,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
await ensureDevWorkspace(workspace);
|
await ensureDevWorkspace(workspace);
|
||||||
|
|||||||
@ -289,7 +289,7 @@ describe("doctor", () => {
|
|||||||
"+15555550123",
|
"+15555550123",
|
||||||
]);
|
]);
|
||||||
expect(written.routing).toBeUndefined();
|
expect(written.routing).toBeUndefined();
|
||||||
});
|
}, 20000);
|
||||||
|
|
||||||
it("migrates legacy Clawdis services", async () => {
|
it("migrates legacy Clawdis services", async () => {
|
||||||
readConfigFileSnapshot.mockResolvedValue({
|
readConfigFileSnapshot.mockResolvedValue({
|
||||||
|
|||||||
@ -10,12 +10,6 @@ const DEFAULT_MINIMAX_CONTEXT_WINDOW = 200000;
|
|||||||
const DEFAULT_MINIMAX_MAX_TOKENS = 8192;
|
const DEFAULT_MINIMAX_MAX_TOKENS = 8192;
|
||||||
export const MINIMAX_HOSTED_MODEL_REF = `minimax/${MINIMAX_HOSTED_MODEL_ID}`;
|
export const MINIMAX_HOSTED_MODEL_REF = `minimax/${MINIMAX_HOSTED_MODEL_ID}`;
|
||||||
|
|
||||||
const DEFAULT_MINIMAX_BASE_URL = "https://api.minimax.io/v1";
|
|
||||||
export const MINIMAX_HOSTED_MODEL_ID = "MiniMax-M2.1";
|
|
||||||
const DEFAULT_MINIMAX_CONTEXT_WINDOW = 200000;
|
|
||||||
const DEFAULT_MINIMAX_MAX_TOKENS = 8192;
|
|
||||||
export const MINIMAX_HOSTED_MODEL_REF = `minimax/${MINIMAX_HOSTED_MODEL_ID}`;
|
|
||||||
|
|
||||||
export async function writeOAuthCredentials(
|
export async function writeOAuthCredentials(
|
||||||
provider: OAuthProvider,
|
provider: OAuthProvider,
|
||||||
creds: OAuthCredentials,
|
creds: OAuthCredentials,
|
||||||
@ -176,7 +170,7 @@ export function applyMinimaxHostedProviderConfig(
|
|||||||
cfg: ClawdbotConfig,
|
cfg: ClawdbotConfig,
|
||||||
params?: { baseUrl?: string },
|
params?: { baseUrl?: string },
|
||||||
): ClawdbotConfig {
|
): ClawdbotConfig {
|
||||||
const models = { ...cfg.agent?.models };
|
const models = { ...cfg.agents?.defaults?.models };
|
||||||
models[MINIMAX_HOSTED_MODEL_REF] = {
|
models[MINIMAX_HOSTED_MODEL_REF] = {
|
||||||
...models[MINIMAX_HOSTED_MODEL_REF],
|
...models[MINIMAX_HOSTED_MODEL_REF],
|
||||||
alias: models[MINIMAX_HOSTED_MODEL_REF]?.alias ?? "Minimax",
|
alias: models[MINIMAX_HOSTED_MODEL_REF]?.alias ?? "Minimax",
|
||||||
@ -212,9 +206,12 @@ export function applyMinimaxHostedProviderConfig(
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
...cfg,
|
...cfg,
|
||||||
agent: {
|
agents: {
|
||||||
...cfg.agent,
|
...cfg.agents,
|
||||||
models,
|
defaults: {
|
||||||
|
...cfg.agents?.defaults,
|
||||||
|
models,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
models: {
|
models: {
|
||||||
mode: cfg.models?.mode ?? "merge",
|
mode: cfg.models?.mode ?? "merge",
|
||||||
@ -254,17 +251,21 @@ export function applyMinimaxHostedConfig(
|
|||||||
const next = applyMinimaxHostedProviderConfig(cfg, params);
|
const next = applyMinimaxHostedProviderConfig(cfg, params);
|
||||||
return {
|
return {
|
||||||
...next,
|
...next,
|
||||||
agent: {
|
agents: {
|
||||||
...next.agent,
|
...next.agents,
|
||||||
model: {
|
defaults: {
|
||||||
...(next.agent?.model &&
|
...next.agents?.defaults,
|
||||||
"fallbacks" in (next.agent.model as Record<string, unknown>)
|
model: {
|
||||||
? {
|
...(next.agents?.defaults?.model &&
|
||||||
fallbacks: (next.agent.model as { fallbacks?: string[] })
|
"fallbacks" in (next.agents.defaults.model as Record<string, unknown>)
|
||||||
.fallbacks,
|
? {
|
||||||
}
|
fallbacks: (
|
||||||
: undefined),
|
next.agents.defaults.model as { fallbacks?: string[] }
|
||||||
primary: MINIMAX_HOSTED_MODEL_REF,
|
).fallbacks,
|
||||||
|
}
|
||||||
|
: undefined),
|
||||||
|
primary: MINIMAX_HOSTED_MODEL_REF,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -546,7 +546,8 @@ async function promptWhatsAppAllowFrom(
|
|||||||
"WhatsApp number",
|
"WhatsApp number",
|
||||||
);
|
);
|
||||||
const entry = await prompter.text({
|
const entry = await prompter.text({
|
||||||
message: "Your personal WhatsApp number (the phone you will message from)",
|
message:
|
||||||
|
"Your personal WhatsApp number (the phone you will message from)",
|
||||||
placeholder: "+15555550123",
|
placeholder: "+15555550123",
|
||||||
initialValue: existingAllowFrom[0],
|
initialValue: existingAllowFrom[0],
|
||||||
validate: (value) => {
|
validate: (value) => {
|
||||||
@ -613,7 +614,8 @@ async function promptWhatsAppAllowFrom(
|
|||||||
"WhatsApp number",
|
"WhatsApp number",
|
||||||
);
|
);
|
||||||
const entry = await prompter.text({
|
const entry = await prompter.text({
|
||||||
message: "Your personal WhatsApp number (the phone you will message from)",
|
message:
|
||||||
|
"Your personal WhatsApp number (the phone you will message from)",
|
||||||
placeholder: "+15555550123",
|
placeholder: "+15555550123",
|
||||||
initialValue: existingAllowFrom[0],
|
initialValue: existingAllowFrom[0],
|
||||||
validate: (value) => {
|
validate: (value) => {
|
||||||
|
|||||||
@ -1202,7 +1202,7 @@ export type AgentDefaultsConfig = {
|
|||||||
every?: string;
|
every?: string;
|
||||||
/** Heartbeat model override (provider/model). */
|
/** Heartbeat model override (provider/model). */
|
||||||
model?: string;
|
model?: string;
|
||||||
/** Delivery target (last|whatsapp|telegram|discord|signal|imessage|none). */
|
/** Delivery target (last|whatsapp|telegram|discord|slack|signal|imessage|msteams|none). */
|
||||||
target?:
|
target?:
|
||||||
| "last"
|
| "last"
|
||||||
| "whatsapp"
|
| "whatsapp"
|
||||||
@ -1211,6 +1211,7 @@ export type AgentDefaultsConfig = {
|
|||||||
| "slack"
|
| "slack"
|
||||||
| "signal"
|
| "signal"
|
||||||
| "imessage"
|
| "imessage"
|
||||||
|
| "msteams"
|
||||||
| "none";
|
| "none";
|
||||||
/** Optional delivery override (E.164 for WhatsApp, chat id for Telegram). */
|
/** Optional delivery override (E.164 for WhatsApp, chat id for Telegram). */
|
||||||
to?: string;
|
to?: string;
|
||||||
|
|||||||
@ -603,6 +603,7 @@ const HeartbeatSchema = z
|
|||||||
z.literal("slack"),
|
z.literal("slack"),
|
||||||
z.literal("signal"),
|
z.literal("signal"),
|
||||||
z.literal("imessage"),
|
z.literal("imessage"),
|
||||||
|
z.literal("msteams"),
|
||||||
z.literal("none"),
|
z.literal("none"),
|
||||||
])
|
])
|
||||||
.optional(),
|
.optional(),
|
||||||
|
|||||||
@ -56,8 +56,9 @@ export async function monitorMSTeamsProvider(
|
|||||||
const textLimit = resolveTextChunkLimit(cfg, "msteams");
|
const textLimit = resolveTextChunkLimit(cfg, "msteams");
|
||||||
const MB = 1024 * 1024;
|
const MB = 1024 * 1024;
|
||||||
const mediaMaxBytes =
|
const mediaMaxBytes =
|
||||||
typeof cfg.agent?.mediaMaxMb === "number" && cfg.agent.mediaMaxMb > 0
|
typeof cfg.agents?.defaults?.mediaMaxMb === "number" &&
|
||||||
? Math.floor(cfg.agent.mediaMaxMb * MB)
|
cfg.agents.defaults.mediaMaxMb > 0
|
||||||
|
? Math.floor(cfg.agents.defaults.mediaMaxMb * MB)
|
||||||
: 8 * MB;
|
: 8 * MB;
|
||||||
const conversationStore =
|
const conversationStore =
|
||||||
opts.conversationStore ?? createMSTeamsConversationStoreFs();
|
opts.conversationStore ?? createMSTeamsConversationStoreFs();
|
||||||
|
|||||||
@ -122,9 +122,7 @@ export async function sendMessageTelegram(
|
|||||||
const client: ApiClientOptions | undefined = fetchImpl
|
const client: ApiClientOptions | undefined = fetchImpl
|
||||||
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
|
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
|
||||||
: undefined;
|
: undefined;
|
||||||
const api =
|
const api = opts.api ?? new Bot(token, client ? { client } : undefined).api;
|
||||||
opts.api ??
|
|
||||||
new Bot(token, client ? { client } : undefined).api;
|
|
||||||
const mediaUrl = opts.mediaUrl?.trim();
|
const mediaUrl = opts.mediaUrl?.trim();
|
||||||
|
|
||||||
// Build optional params for forum topics and reply threading.
|
// Build optional params for forum topics and reply threading.
|
||||||
@ -296,9 +294,7 @@ export async function reactMessageTelegram(
|
|||||||
const client: ApiClientOptions | undefined = fetchImpl
|
const client: ApiClientOptions | undefined = fetchImpl
|
||||||
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
|
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
|
||||||
: undefined;
|
: undefined;
|
||||||
const api =
|
const api = opts.api ?? new Bot(token, client ? { client } : undefined).api;
|
||||||
opts.api ??
|
|
||||||
new Bot(token, client ? { client } : undefined).api;
|
|
||||||
const request = createTelegramRetryRunner({
|
const request = createTelegramRetryRunner({
|
||||||
retry: opts.retry,
|
retry: opts.retry,
|
||||||
configRetry: account.config.retry,
|
configRetry: account.config.retry,
|
||||||
|
|||||||
@ -11,10 +11,7 @@ export async function setTelegramWebhook(opts: {
|
|||||||
const client: ApiClientOptions | undefined = fetchImpl
|
const client: ApiClientOptions | undefined = fetchImpl
|
||||||
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
|
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
|
||||||
: undefined;
|
: undefined;
|
||||||
const bot = new Bot(
|
const bot = new Bot(opts.token, client ? { client } : undefined);
|
||||||
opts.token,
|
|
||||||
client ? { client } : undefined,
|
|
||||||
);
|
|
||||||
await bot.api.setWebhook(opts.url, {
|
await bot.api.setWebhook(opts.url, {
|
||||||
secret_token: opts.secret,
|
secret_token: opts.secret,
|
||||||
drop_pending_updates: opts.dropPendingUpdates ?? false,
|
drop_pending_updates: opts.dropPendingUpdates ?? false,
|
||||||
@ -26,9 +23,6 @@ export async function deleteTelegramWebhook(opts: { token: string }) {
|
|||||||
const client: ApiClientOptions | undefined = fetchImpl
|
const client: ApiClientOptions | undefined = fetchImpl
|
||||||
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
|
? { fetch: fetchImpl as unknown as ApiClientOptions["fetch"] }
|
||||||
: undefined;
|
: undefined;
|
||||||
const bot = new Bot(
|
const bot = new Bot(opts.token, client ? { client } : undefined);
|
||||||
opts.token,
|
|
||||||
client ? { client } : undefined,
|
|
||||||
);
|
|
||||||
await bot.api.deleteWebhook();
|
await bot.api.deleteWebhook();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user