mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-27 00:52:05 +00:00
fix: honor zalouser default runtime account
This commit is contained in:
@@ -124,6 +124,27 @@ describe("zalouser account resolution", () => {
|
||||
expect(resolved.config.allowFrom).toEqual(["123"]);
|
||||
});
|
||||
|
||||
it("uses configured defaultAccount when accountId is omitted", () => {
|
||||
const cfg = asConfig({
|
||||
channels: {
|
||||
zalouser: {
|
||||
defaultAccount: "work",
|
||||
accounts: {
|
||||
work: {
|
||||
name: "Work",
|
||||
profile: "work-profile",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const resolved = resolveZalouserAccountSync({ cfg });
|
||||
expect(resolved.accountId).toBe("work");
|
||||
expect(resolved.name).toBe("Work");
|
||||
expect(resolved.profile).toBe("work-profile");
|
||||
});
|
||||
|
||||
it("resolves account config when account key casing differs from normalized id", () => {
|
||||
const cfg = asConfig({
|
||||
channels: {
|
||||
|
||||
@@ -47,7 +47,9 @@ function resolveProfile(config: ZalouserAccountConfig, accountId: string): strin
|
||||
}
|
||||
|
||||
function resolveZalouserAccountBase(params: { cfg: OpenClawConfig; accountId?: string | null }) {
|
||||
const accountId = normalizeAccountId(params.accountId);
|
||||
const accountId = normalizeAccountId(
|
||||
params.accountId ?? resolveDefaultZalouserAccountId(params.cfg),
|
||||
);
|
||||
const baseEnabled =
|
||||
(params.cfg.channels?.zalouser as ZalouserConfig | undefined)?.enabled !== false;
|
||||
const merged = mergeZalouserAccountConfig(params.cfg, accountId);
|
||||
|
||||
Reference in New Issue
Block a user