Skip to content

Commit d2c9e74

Browse files
authored
fix(irc): config validation rejects documented channels.irc.configWrites key (#112392)
1 parent 554d786 commit d2c9e74

4 files changed

Lines changed: 32 additions & 12 deletions

File tree

‎extensions/irc/src/config-schema.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@ describe("irc config schema", () => {
4646
expect(config.nick).toBe("openclaw-bot");
4747
});
4848

49+
it("accepts configWrites at channel and account level", () => {
50+
const config = expectValidConfig(
51+
parseIrcConfig({
52+
configWrites: false,
53+
accounts: {
54+
work: {
55+
host: "irc.libera.chat",
56+
configWrites: true,
57+
},
58+
},
59+
}),
60+
);
61+
62+
expect(config.configWrites).toBe(false);
63+
expect(config.accounts?.work?.configWrites).toBe(true);
64+
});
65+
4966
it('rejects dmPolicy="open" without allowFrom "*"', () => {
5067
const issues = expectInvalidConfig(
5168
parseIrcConfig({

‎extensions/irc/src/config-schema.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const IrcAccountSchemaBase = z
3636
.object({
3737
name: z.string().optional(),
3838
enabled: z.boolean().optional(),
39+
configWrites: z.boolean().optional(),
3940
dangerouslyAllowNameMatching: z.boolean().optional(),
4041
host: z.string().optional(),
4142
port: z.number().int().min(1).max(65535).optional(),

‎extensions/irc/src/types.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ export type IrcNickServConfig = {
3333
export type IrcAccountConfig = {
3434
name?: string;
3535
enabled?: boolean;
36+
/** Allow channel-initiated config writes (default: true). */
37+
configWrites?: boolean;
3638
/**
3739
* Break-glass override: allow nick-only allowlist matching.
3840
* Default behavior requires host/user-qualified identities.

‎src/config/bundled-channel-config-metadata.generated.ts‎

Lines changed: 12 additions & 12 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)