Skip to content

Commit b39ccb2

Browse files
author
Shaw
committed
Merge remote-tracking branch 'origin/develop' into fix/pr-7714-7715-review-issues
# Conflicts: # packages/app/tsconfig.typecheck.json # packages/cloud-api/src/_router.generated.ts # packages/cloud-routing/package.json # packages/elizaos/templates-manifest.json # packages/ui/src/state/useOnboardingCallbacks.ts # plugins/plugin-local-inference/native/llama.cpp # plugins/plugin-openai/utils/config.ts
2 parents 1921cfa + b483034 commit b39ccb2

54 files changed

Lines changed: 969 additions & 694 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/cloud-deploy-backend.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ jobs:
7676
run: |
7777
for attempt in 1 2 3; do
7878
if [ "$attempt" -eq 3 ]; then
79-
bun install --no-save --verbose && git diff --exit-code -- bun.lock && exit 0
79+
bun install --frozen-lockfile --ignore-scripts --verbose && exit 0
8080
else
81-
bun install --no-save && git diff --exit-code -- bun.lock && exit 0
81+
bun install --frozen-lockfile --ignore-scripts && exit 0
8282
fi
8383
84-
echo "bun install attempt $attempt failed or changed bun.lock; retrying in 10s..."
84+
echo "bun install attempt $attempt failed; retrying in 10s..."
8585
sleep 10
8686
done
8787
@@ -148,12 +148,12 @@ jobs:
148148
run: |
149149
for attempt in 1 2 3; do
150150
if [ "$attempt" -eq 3 ]; then
151-
bun install --no-save --verbose && git diff --exit-code -- bun.lock && exit 0
151+
bun install --frozen-lockfile --ignore-scripts --verbose && exit 0
152152
else
153-
bun install --no-save && git diff --exit-code -- bun.lock && exit 0
153+
bun install --frozen-lockfile --ignore-scripts && exit 0
154154
fi
155155
156-
echo "bun install attempt $attempt failed or changed bun.lock; retrying in 10s..."
156+
echo "bun install attempt $attempt failed; retrying in 10s..."
157157
sleep 10
158158
done
159159
@@ -294,7 +294,7 @@ jobs:
294294
export PATH="$BUN_INSTALL/bin:$PATH"
295295
fi
296296
for attempt in 1 2 3; do
297-
if bun install --frozen-lockfile; then
297+
if bun install --frozen-lockfile --ignore-scripts; then
298298
break
299299
fi
300300

.github/workflows/deploy-eliza-provisioning-worker.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,13 @@ jobs:
8787
rm -f .git/index.lock
8888
8989
# Discard local drift, preserve env files.
90-
git clean -fdx -e .env -e .env.local -e .env.* -e node_modules || true
90+
git clean -fdx \
91+
-e .env \
92+
-e .env.local \
93+
-e .env.* \
94+
-e cloud/.env.local \
95+
-e cloud/.env.* \
96+
-e node_modules || true
9197
git checkout -- . 2>/dev/null || true
9298
9399
# bun.lock became tracked at 4ae092dcda; the host's previous deploy
@@ -120,31 +126,20 @@ jobs:
120126
export PATH="$BUN_INSTALL/bin:$PATH"
121127
fi
122128
123-
# cloud/ is a separate bun project (not a sub-workspace of the
124-
# outer monorepo, whose `workspaces` is `packages/*`). Install from
125-
# /opt/eliza/cloud so the worker's deps end up in cloud/node_modules.
126-
#
127-
# No --frozen-lockfile: cloud/bun.lock currently has a duplicate
128-
# package path for @elizaos/plugin-workflow (workspace + registry
129-
# entries for the same name) that bun rejects under frozen mode.
130-
# Cloud-CF deploys hit the same upstream bug; until the lockfile is
131-
# cleaned at source, allow bun to recompute the deps tree.
132-
cd /opt/eliza/cloud
129+
cd /opt/eliza
133130
for attempt in 1 2 3; do
134-
if bun install; then
131+
if bun install --frozen-lockfile --ignore-scripts; then
135132
break
136133
fi
137134
if [ "$attempt" -eq 3 ]; then exit 1; fi
138135
echo "bun install attempt $attempt failed; retrying in 10s..."
139136
sleep 10
140137
done
141-
cd /opt/eliza
142138
143139
# The daemons run under Node/tsx rather than Bun. Node resolves
144140
# linked workspace packages through their built `node` exports, so
145141
# refresh linked package dist files after installing dependencies.
146-
bun run --cwd cloud build:linked-core
147-
bun run --cwd cloud build:linked-billing
142+
bun run build:core
148143
mkdir -p plugins/plugin-sql/node_modules/@elizaos
149144
rm -rf plugins/plugin-sql/node_modules/@elizaos/core
150145
ln -s ../../../../packages/core plugins/plugin-sql/node_modules/@elizaos/core

.github/workflows/release-electrobun.yml

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -179,46 +179,6 @@ jobs:
179179
with:
180180
submodules: recursive
181181

182-
- name: Validate public desktop signing inputs
183-
env:
184-
BUILD_ENV: ${{ needs.prepare.outputs.env }}
185-
PUBLISH_RELEASE: ${{ inputs.publish_release || github.event_name == 'push' }}
186-
PLATFORM_OS: ${{ matrix.platform.os }}
187-
CSC_LINK: ${{ secrets.CSC_LINK }}
188-
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
189-
APPLE_ID: ${{ secrets.APPLE_ID }}
190-
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
191-
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
192-
WINDOWS_SIGN_CERT_BASE64: ${{ secrets.WINDOWS_SIGN_CERT_BASE64 }}
193-
WINDOWS_SIGN_CERT_PASSWORD: ${{ secrets.WINDOWS_SIGN_CERT_PASSWORD }}
194-
WINDOWS_SIGN_TIMESTAMP_URL: ${{ secrets.WINDOWS_SIGN_TIMESTAMP_URL }}
195-
run: |
196-
if [[ "$PUBLISH_RELEASE" != "true" && "$BUILD_ENV" != "stable" ]]; then
197-
echo "Non-published canary build; signing inputs are advisory."
198-
exit 0
199-
fi
200-
201-
missing=()
202-
case "$PLATFORM_OS" in
203-
macos)
204-
[[ -z "$CSC_LINK" ]] && missing+=("CSC_LINK")
205-
[[ -z "$CSC_KEY_PASSWORD" ]] && missing+=("CSC_KEY_PASSWORD")
206-
[[ -z "$APPLE_ID" ]] && missing+=("APPLE_ID")
207-
[[ -z "$APPLE_APP_SPECIFIC_PASSWORD" ]] && missing+=("APPLE_APP_SPECIFIC_PASSWORD")
208-
[[ -z "$APPLE_TEAM_ID" ]] && missing+=("APPLE_TEAM_ID")
209-
;;
210-
windows)
211-
[[ -z "$WINDOWS_SIGN_CERT_BASE64" ]] && missing+=("WINDOWS_SIGN_CERT_BASE64")
212-
[[ -z "$WINDOWS_SIGN_CERT_PASSWORD" ]] && missing+=("WINDOWS_SIGN_CERT_PASSWORD")
213-
[[ -z "$WINDOWS_SIGN_TIMESTAMP_URL" ]] && missing+=("WINDOWS_SIGN_TIMESTAMP_URL")
214-
;;
215-
esac
216-
217-
if [[ ${#missing[@]} -gt 0 ]]; then
218-
echo "::error::Missing public desktop signing inputs for $PLATFORM_OS: ${missing[*]}"
219-
exit 1
220-
fi
221-
222182
- name: Setup Node.js
223183
uses: actions/setup-node@v6
224184
with:
@@ -415,6 +375,46 @@ jobs:
415375
with:
416376
submodules: recursive
417377

378+
- name: Validate public desktop signing inputs
379+
env:
380+
BUILD_ENV: ${{ needs.prepare.outputs.env }}
381+
PUBLISH_RELEASE: ${{ inputs.publish_release || github.event_name == 'push' }}
382+
PLATFORM_OS: ${{ matrix.platform.os }}
383+
CSC_LINK: ${{ secrets.CSC_LINK }}
384+
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
385+
APPLE_ID: ${{ secrets.APPLE_ID }}
386+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
387+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
388+
WINDOWS_SIGN_CERT_BASE64: ${{ secrets.WINDOWS_SIGN_CERT_BASE64 }}
389+
WINDOWS_SIGN_CERT_PASSWORD: ${{ secrets.WINDOWS_SIGN_CERT_PASSWORD }}
390+
WINDOWS_SIGN_TIMESTAMP_URL: ${{ secrets.WINDOWS_SIGN_TIMESTAMP_URL }}
391+
run: |
392+
if [[ "$PUBLISH_RELEASE" != "true" && "$BUILD_ENV" != "stable" ]]; then
393+
echo "Non-published canary build; signing inputs are advisory."
394+
exit 0
395+
fi
396+
397+
missing=()
398+
case "$PLATFORM_OS" in
399+
macos)
400+
[[ -z "$CSC_LINK" ]] && missing+=("CSC_LINK")
401+
[[ -z "$CSC_KEY_PASSWORD" ]] && missing+=("CSC_KEY_PASSWORD")
402+
[[ -z "$APPLE_ID" ]] && missing+=("APPLE_ID")
403+
[[ -z "$APPLE_APP_SPECIFIC_PASSWORD" ]] && missing+=("APPLE_APP_SPECIFIC_PASSWORD")
404+
[[ -z "$APPLE_TEAM_ID" ]] && missing+=("APPLE_TEAM_ID")
405+
;;
406+
windows)
407+
[[ -z "$WINDOWS_SIGN_CERT_BASE64" ]] && missing+=("WINDOWS_SIGN_CERT_BASE64")
408+
[[ -z "$WINDOWS_SIGN_CERT_PASSWORD" ]] && missing+=("WINDOWS_SIGN_CERT_PASSWORD")
409+
[[ -z "$WINDOWS_SIGN_TIMESTAMP_URL" ]] && missing+=("WINDOWS_SIGN_TIMESTAMP_URL")
410+
;;
411+
esac
412+
413+
if [[ ${#missing[@]} -gt 0 ]]; then
414+
echo "::error::Missing public desktop signing inputs for $PLATFORM_OS: ${missing[*]}"
415+
exit 1
416+
fi
417+
418418
- name: Setup Node.js
419419
uses: actions/setup-node@v6
420420
with:

biome.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"!**/build",
1717
"!**/.next",
1818
"!**/node_modules",
19+
"!**/vendor",
20+
"!**/vendor/**",
1921
"!**/public",
2022
"!packages/inference/llama.cpp",
2123
"!packages/inference/reports",

bun.lock

Lines changed: 4 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
"format": "turbo run format",
8585
"format:check": "turbo run format:check",
8686
"clean": "turbo run clean --concurrency=100% && rm -rf dist .turbo node_modules .turbo-tsconfig.json tsconfig.tsbuildinfo bun.lock* .eliza .elizadb && bun install && bun run build --concurrency=100%",
87-
"build:core": "turbo run build --filter=@elizaos/contracts --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/cloud-sdk --filter=@elizaos/cloud-shared --filter=@elizaos/vault --filter=@elizaos/plugin-local-inference --filter=@elizaos/plugin-ollama --filter=@elizaos/plugin-commands --filter=@elizaos/plugin-shell --filter=@elizaos/plugin-coding-tools --filter=@elizaos/plugin-agent-orchestrator --filter=@elizaos/plugin-video --filter=@elizaos/plugin-background-runner --filter=@elizaos/plugin-mlx --filter=@elizaos/plugin-anthropic --filter=@elizaos/plugin-openai --filter=@elizaos/plugin-elizacloud --no-cache",
87+
"build:core": "turbo run build --filter=@elizaos/contracts --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/cloud-sdk --filter=@elizaos/cloud-shared --filter=@elizaos/vault --filter=@elizaos/app-core --filter=@elizaos/plugin-local-inference --filter=@elizaos/plugin-ollama --filter=@elizaos/plugin-commands --filter=@elizaos/plugin-shell --filter=@elizaos/plugin-coding-tools --filter=@elizaos/plugin-agent-orchestrator --filter=@elizaos/plugin-app-manager --filter=@elizaos/plugin-wallet --filter=@elizaos/plugin-video --filter=@elizaos/plugin-background-runner --filter=@elizaos/plugin-mlx --filter=@elizaos/plugin-anthropic --filter=@elizaos/plugin-openai --filter=@elizaos/plugin-elizacloud --no-cache",
8888
"build:server": "turbo run build --filter=@elizaos/agent --no-cache",
8989
"lint": "turbo run lint && node packages/scripts/run-examples-benchmarks.mjs lint",
9090
"lint:check": "turbo run lint:check",
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
import type {
2+
IAgentRuntime,
3+
Memory,
4+
Plugin,
5+
Provider,
6+
State,
7+
} from "@elizaos/core";
8+
import { beforeEach, describe, expect, it, vi } from "vitest";
9+
10+
const rolesMock = vi.hoisted(() => ({
11+
checkSenderRole: vi.fn(),
12+
}));
13+
14+
vi.mock("./roles.ts", () => rolesMock);
15+
16+
import { applyPluginRoleGating } from "./plugin-role-gating.ts";
17+
18+
const runtime = {
19+
agentId: "11111111-1111-1111-1111-111111111111",
20+
} as IAgentRuntime;
21+
22+
function message(metadata: Record<string, unknown> = {}): Memory {
23+
return {
24+
id: "22222222-2222-2222-2222-222222222222",
25+
entityId: "33333333-3333-3333-3333-333333333333",
26+
roomId: "44444444-4444-4444-4444-444444444444",
27+
content: { text: "hi", source: "discord" },
28+
metadata,
29+
} as Memory;
30+
}
31+
32+
function provider(name: string): Provider {
33+
return {
34+
name,
35+
get: vi.fn(async () => ({ text: `${name}: visible` })),
36+
} as unknown as Provider;
37+
}
38+
39+
function pluginWithProviders(providers: Provider[]): Plugin {
40+
return {
41+
name: "test-plugin",
42+
providers,
43+
} as Plugin;
44+
}
45+
46+
describe("applyPluginRoleGating", () => {
47+
beforeEach(() => {
48+
rolesMock.checkSenderRole.mockReset();
49+
});
50+
51+
it("deduplicates concurrent provider role checks for the same message", async () => {
52+
rolesMock.checkSenderRole.mockImplementation(
53+
() =>
54+
new Promise((resolve) => {
55+
setTimeout(() => {
56+
resolve({ role: "ADMIN", isOwner: false, isAdmin: true });
57+
}, 10);
58+
}),
59+
);
60+
const providers = [provider("SECRETS_STATUS"), provider("MISSING_SECRETS")];
61+
applyPluginRoleGating([pluginWithProviders(providers)]);
62+
63+
const results = await Promise.all(
64+
providers.map((item) =>
65+
item.get?.(runtime, message({ fromId: "discord-user-1" }), {} as State),
66+
),
67+
);
68+
69+
expect(rolesMock.checkSenderRole).toHaveBeenCalledTimes(1);
70+
expect(results.map((item) => item?.text)).toEqual([
71+
"SECRETS_STATUS: visible",
72+
"MISSING_SECRETS: visible",
73+
]);
74+
});
75+
76+
it("does not reuse a resolved role decision across later turns", async () => {
77+
rolesMock.checkSenderRole
78+
.mockResolvedValueOnce({ role: "ADMIN", isOwner: false, isAdmin: true })
79+
.mockResolvedValueOnce({ role: "GUEST", isOwner: false, isAdmin: false });
80+
const gatedProvider = provider("SECRETS_STATUS");
81+
applyPluginRoleGating([pluginWithProviders([gatedProvider])]);
82+
83+
await expect(
84+
gatedProvider.get?.(
85+
runtime,
86+
message({ fromId: "discord-user-1" }),
87+
{} as State,
88+
),
89+
).resolves.toMatchObject({ text: "SECRETS_STATUS: visible" });
90+
await expect(
91+
gatedProvider.get?.(
92+
runtime,
93+
message({ fromId: "discord-user-1" }),
94+
{} as State,
95+
),
96+
).resolves.toMatchObject({ text: "" });
97+
98+
expect(rolesMock.checkSenderRole).toHaveBeenCalledTimes(2);
99+
});
100+
101+
it("keeps concurrent role checks separate when live connector metadata differs", async () => {
102+
rolesMock.checkSenderRole.mockResolvedValue({
103+
role: "ADMIN",
104+
isOwner: false,
105+
isAdmin: true,
106+
});
107+
const gatedProvider = provider("SECRETS_STATUS");
108+
applyPluginRoleGating([pluginWithProviders([gatedProvider])]);
109+
110+
await Promise.all([
111+
gatedProvider.get?.(
112+
runtime,
113+
message({ fromId: "discord-user-1" }),
114+
{} as State,
115+
),
116+
gatedProvider.get?.(
117+
runtime,
118+
message({ fromId: "discord-user-2" }),
119+
{} as State,
120+
),
121+
]);
122+
123+
expect(rolesMock.checkSenderRole).toHaveBeenCalledTimes(2);
124+
});
125+
});

0 commit comments

Comments
 (0)