Skip to content

Commit 77444d4

Browse files
authored
Merge branch 'develop' into fix/siwe-cache-bypass
2 parents 2596581 + e15d233 commit 77444d4

8 files changed

Lines changed: 73 additions & 106 deletions

File tree

.github/workflows/cloud-gateway-discord.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ jobs:
446446
if: |
447447
github.event_name != 'pull_request' &&
448448
(needs.detect-changes.outputs.app == 'true' || (github.event_name == 'workflow_dispatch' && github.event.inputs.action == 'deploy'))
449+
environment: ${{ needs.detect-changes.outputs.environment }}
449450
permissions:
450451
contents: read
451452
packages: write
@@ -462,8 +463,8 @@ jobs:
462463
uses: docker/login-action@v4
463464
with:
464465
registry: ${{ env.REGISTRY }}
465-
username: ${{ github.actor }}
466-
password: ${{ secrets.GITHUB_TOKEN }}
466+
username: ${{ secrets.GHCR_USERNAME }}
467+
password: ${{ secrets.GHCR_TOKEN }}
467468

468469
- name: Extract metadata
469470
id: meta

cloud/packages/tests/unit/providers-vast.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { afterEach, beforeEach, describe, expect, mock, test } from "bun:test";
2-
import { VastProvider } from "@/lib/providers/vast";
32
import type { OpenAIChatRequest } from "@/lib/providers/types";
3+
import { VastProvider } from "@/lib/providers/vast";
44

55
const baseChatRequest: OpenAIChatRequest = {
66
model: "vast/qwen3.6-35b-a3b-awq",

cloud/packages/tests/unit/steward-sync.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { beforeEach, describe, expect, test } from "bun:test";
32
import { organizationInvitesRepository } from "@/db/repositories/organization-invites";
43
import { apiKeysService } from "@/lib/services/api-keys";

plugins/plugin-wallet/src/analytics/dexscreener/__tests__/service.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ import {
33
describe,
44
it,
55
expect,
6-
mock,
6+
vi,
77
beforeEach,
88
afterEach,
9-
spyOn,
10-
} from "bun:test";
9+
} from "vitest";
10+
11+
const mock = vi.fn;
12+
const spyOn = vi.spyOn;
1113
import axios from "axios";
1214
import { DexScreenerService } from "../service";
1315
import { createMockRuntime } from "./test-utils";
@@ -44,8 +46,7 @@ describe("DexScreenerService", () => {
4446
});
4547

4648
afterEach(() => {
47-
// Restore mocks
48-
mock.restore();
49+
vi.restoreAllMocks();
4950
});
5051

5152
describe("constructor", () => {

plugins/plugin-wallet/src/analytics/dexscreener/__tests__/test-utils.ts

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import {
33
describe,
44
expect,
55
it,
6-
mock,
6+
vi,
77
beforeEach,
88
afterEach,
9-
spyOn,
10-
} from "bun:test";
9+
type Mock,
10+
} from "vitest";
1111
import {
1212
type IAgentRuntime,
1313
type Memory,
@@ -20,7 +20,10 @@ import {
2020
ChannelType,
2121
} from "@elizaos/core";
2222

23-
// Re-export bun test utilities for convenience
23+
const mock = vi.fn;
24+
const spyOn = vi.spyOn;
25+
26+
// Re-export vitest utilities for convenience
2427
export { describe, it, expect, mock, beforeEach, afterEach, spyOn };
2528

2629
// Create a valid UUID for testing
@@ -30,23 +33,23 @@ export const testUUID = "550e8400-e29b-41d4-a716-446655440000" as UUID;
3033
export type MockRuntime = Partial<IAgentRuntime> & {
3134
agentId: UUID;
3235
character: Character;
33-
getSetting: ReturnType<typeof mock>;
34-
useModel: ReturnType<typeof mock>;
35-
composeState: ReturnType<typeof mock>;
36-
createMemory: ReturnType<typeof mock>;
37-
getMemories: ReturnType<typeof mock>;
38-
searchMemories: ReturnType<typeof mock>;
39-
updateMemory: ReturnType<typeof mock>;
40-
getRoom: ReturnType<typeof mock>;
41-
getParticipantUserState: ReturnType<typeof mock>;
42-
setParticipantUserState: ReturnType<typeof mock>;
43-
emitEvent: ReturnType<typeof mock>;
44-
getTasks: ReturnType<typeof mock>;
36+
getSetting: Mock;
37+
useModel: Mock;
38+
composeState: Mock;
39+
createMemory: Mock;
40+
getMemories: Mock;
41+
searchMemories: Mock;
42+
updateMemory: Mock;
43+
getRoom: Mock;
44+
getParticipantUserState: Mock;
45+
setParticipantUserState: Mock;
46+
emitEvent: Mock;
47+
getTasks: Mock;
4548
providers: any[];
4649
actions: any[];
4750
evaluators: any[];
4851
services: any[];
49-
getService: ReturnType<typeof mock>;
52+
getService: Mock;
5053
};
5154

5255
// Create Mock Runtime

plugins/plugin-wallet/src/chains/solana/dex/meteora/services/__tests__/MeteoraLpService.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import { Keypair as SolanaKeypair } from "@solana/web3.js";
66
import { beforeEach, describe, expect, it, type Mock, type MockInstance, vi } from "vitest";
77
import { MeteoraLpService } from "../MeteoraLpService.ts";
88

9+
vi.mock("@meteora-ag/dlmm", () => ({
10+
default: { create: vi.fn() },
11+
}));
12+
913
// Mock fetch
1014
const mockFetch = vi.fn();
1115
global.fetch = mockFetch as unknown as typeof fetch;

plugins/plugin-wallet/src/lp/actions/LpManagementAgentAction.ts

Lines changed: 36 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -162,86 +162,45 @@ export const LpManagementAgentAction: Action = {
162162

163163
examples: [] as ActionExample[][], // Empty for now - add examples when specific LP workflows are documented
164164

165-
validate: async (runtime: IAgentRuntime, message: Memory, state?: State): Promise<boolean> => {
166-
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
167-
const __avText = __avTextRaw.toLowerCase();
168-
const __avKeywords = ["management"];
169-
const __avKeywordOk =
170-
__avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
171-
const __avRegex = /\b(?:management)\b/i;
172-
const __avRegexOk = __avRegex.test(__avText);
173-
const __avSource = String(message?.content?.source ?? "");
174-
const __avExpectedSource = "";
175-
const __avSourceOk = __avExpectedSource
176-
? __avSource === __avExpectedSource
177-
: Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
178-
const __avInputOk =
179-
__avText.trim().length > 0 ||
180-
Boolean(message?.content && typeof message.content === "object");
181-
182-
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
165+
validate: async (_runtime: IAgentRuntime, message: Memory, _state?: State): Promise<boolean> => {
166+
if (!message?.content?.text) {
183167
return false;
184168
}
185169

186-
const __avLegacyValidate = async (
187-
_runtime: IAgentRuntime,
188-
message: Memory,
189-
_state?: State
190-
): Promise<boolean> => {
191-
console.info(
192-
"[LpManagementAgentAction] Validate called with message:",
193-
message?.content?.text || "No text"
194-
);
195-
196-
// If there's no message content, validation fails
197-
if (!message?.content?.text) {
198-
console.info("[LpManagementAgentAction] No message text, returning false");
199-
return false;
200-
}
201-
202-
const text = message.content.text.toLowerCase();
203-
204-
// Check for LP-related keywords in the message
205-
const lpKeywords = [
206-
"liquidity",
207-
"lp",
208-
"pool",
209-
"dex",
210-
"vault",
211-
"slippage",
212-
"apr",
213-
"apy",
214-
"tvl",
215-
"swap",
216-
"balance",
217-
"position",
218-
"yield",
219-
"deposit",
220-
"withdraw",
221-
"rebalance",
222-
"auto-rebalance",
223-
"auto rebalance",
224-
"enable rebalance",
225-
"preference",
226-
"slippage",
227-
"concentrated",
228-
"range",
229-
"price range",
230-
"narrow",
231-
"tight",
232-
"out of range",
233-
];
234-
235-
const hasLpKeyword = lpKeywords.some((keyword) => text.includes(keyword));
236-
console.info("[LpManagementAgentAction] Has LP keyword:", hasLpKeyword);
237-
238-
return hasLpKeyword;
239-
};
240-
try {
241-
return Boolean(await __avLegacyValidate(runtime, message, state));
242-
} catch {
243-
return false;
244-
}
170+
const text = message.content.text.toLowerCase();
171+
172+
const lpKeywords = [
173+
"liquidity",
174+
"lp",
175+
"pool",
176+
"dex",
177+
"vault",
178+
"slippage",
179+
"apr",
180+
"apy",
181+
"tvl",
182+
"swap",
183+
"balance",
184+
"position",
185+
"yield",
186+
"deposit",
187+
"withdraw",
188+
"rebalance",
189+
"auto-rebalance",
190+
"auto rebalance",
191+
"enable rebalance",
192+
"preference",
193+
"concentrated",
194+
"range",
195+
"price range",
196+
"narrow",
197+
"tight",
198+
"out of range",
199+
"management",
200+
"intent",
201+
];
202+
203+
return lpKeywords.some((keyword) => text.includes(keyword));
245204
},
246205

247206
handler: async (runtime, message, _state) => {

plugins/plugin-wallet/src/lp/services/__tests__/EvmLpServices.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const createMockRuntime = (settings: Record<string, string> = {}): IAgentRuntime
1515
getCache: vi.fn(),
1616
}) as unknown as IAgentRuntime;
1717

18-
describe("UniswapV3LpService", () => {
18+
describe.skip("UniswapV3LpService", () => {
1919
let mockRuntime: IAgentRuntime;
2020

2121
beforeEach(() => {
@@ -52,7 +52,7 @@ describe("UniswapV3LpService", () => {
5252
});
5353
});
5454

55-
describe("PancakeSwapV3LpService", () => {
55+
describe.skip("PancakeSwapV3LpService", () => {
5656
let mockRuntime: IAgentRuntime;
5757

5858
beforeEach(() => {
@@ -82,7 +82,7 @@ describe("PancakeSwapV3LpService", () => {
8282
});
8383
});
8484

85-
describe("AerodromeLpService", () => {
85+
describe.skip("AerodromeLpService", () => {
8686
let mockRuntime: IAgentRuntime;
8787

8888
beforeEach(() => {

0 commit comments

Comments
 (0)