mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-04 13:51:30 +00:00
fix(discord): quiet Carbon reconcile log
This commit is contained in:
@@ -39,6 +39,7 @@ const {
|
||||
|
||||
let monitorDiscordProvider: typeof import("./provider.js").monitorDiscordProvider;
|
||||
let providerTesting: typeof import("./provider.js").__testing;
|
||||
let runtimeEnvModule: typeof import("openclaw/plugin-sdk/runtime-env");
|
||||
|
||||
function createCompatRateLimitError(
|
||||
response: Response,
|
||||
@@ -149,11 +150,13 @@ describe("monitorDiscordProvider", () => {
|
||||
vi.doMock("../token.js", () => ({
|
||||
normalizeDiscordToken: (value?: string) => value,
|
||||
}));
|
||||
runtimeEnvModule = await import("openclaw/plugin-sdk/runtime-env");
|
||||
({ monitorDiscordProvider, __testing: providerTesting } = await import("./provider.js"));
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
resetDiscordProviderMonitorMocks();
|
||||
vi.mocked(runtimeEnvModule.logVerbose).mockClear();
|
||||
providerTesting.setFetchDiscordApplicationId(async () => "app-1");
|
||||
providerTesting.setCreateDiscordNativeCommand(((
|
||||
...args: Parameters<typeof providerTesting.setCreateDiscordNativeCommand>[0] extends
|
||||
@@ -613,8 +616,8 @@ describe("monitorDiscordProvider", () => {
|
||||
expect(clientHandleDeployRequestMock).toHaveBeenCalledTimes(1);
|
||||
expect(clientFetchUserMock).toHaveBeenCalledWith("@me");
|
||||
expect(monitorLifecycleMock).toHaveBeenCalledTimes(1);
|
||||
expect(runtime.log).toHaveBeenCalledWith(
|
||||
expect.stringContaining("native commands using Carbon reconcile path"),
|
||||
expect(runtimeEnvModule.logVerbose).toHaveBeenCalledWith(
|
||||
"discord: native commands using Carbon reconcile path",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -355,7 +355,7 @@ async function deployDiscordCommands(params: {
|
||||
// errors like Discord 30034 fail fast and don't wedge the provider.
|
||||
restClient.options.queueRequests = false;
|
||||
}
|
||||
params.runtime.log?.("discord: native commands using Carbon reconcile path");
|
||||
logVerbose("discord: native commands using Carbon reconcile path");
|
||||
for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {
|
||||
try {
|
||||
await params.client.handleDeployRequest();
|
||||
|
||||
Reference in New Issue
Block a user