Skip to content

Commit b6b7b60

Browse files
committed
fix(config): satisfy lint and contract gates
1 parent a4b74c7 commit b6b7b60

35 files changed

Lines changed: 120 additions & 157 deletions
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"core": 2993,
2+
"core": 3007,
33
"channel": 3732,
44
"plugin": 3537
55
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
86f64c5ab2bebce97e91c77e672c156011ad5c5ae34e3b142230712454295d04 config-baseline.json
2-
e0b59d775332f0dcfd6d642380dc0568961adeb2b72ff72793ff5c0631c7f09f config-baseline.core.json
1+
2f4ba51e354995c0d28052d7c61210ace881145af0db7f5409f8eb7dff167a4f config-baseline.json
2+
0e9d04a669b853f8b58397d2dfc8913b5a3dd70af20ebd43e25b08be4cd3d292 config-baseline.core.json
33
c624c55cb46a67db4c836dcc04d295db966579885a00778d1a32241632de3475 config-baseline.channel.json
44
0e0592b95e4958477e539abd5ccb336c63735c7d69133199953c48ff3c0845a8 config-baseline.plugin.json

extensions/googlechat/src/actions.test.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ describe("googlechat message actions", () => {
100100
});
101101

102102
it("keeps account-scoped discovery send-only", () => {
103-
resolveGoogleChatAccount.mockImplementation(({ accountId }: { accountId?: string | null }) => ({
104-
enabled: true,
105-
credentialSource: "service-account",
106-
config: {},
107-
}));
103+
resolveGoogleChatAccount.mockImplementation(
104+
({ accountId: _accountId }: { accountId?: string | null }) => ({
105+
enabled: true,
106+
credentialSource: "service-account",
107+
config: {},
108+
}),
109+
);
108110

109111
for (const accountId of ["default", "work"]) {
110112
expect(

extensions/googlechat/src/doctor-contract.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,14 @@ function normalizeGoogleChatEntry(params: {
9090
}
9191

9292
if (hasRetiredReactions(updated)) {
93-
const actions = { ...(asObjectRecord(updated.actions) ?? {}) };
93+
const actions = { ...asObjectRecord(updated.actions) };
9494
delete actions.reactions;
9595
updated = { ...updated };
96-
if (Object.keys(actions).length > 0) updated.actions = actions;
97-
else delete updated.actions;
96+
if (Object.keys(actions).length > 0) {
97+
updated.actions = actions;
98+
} else {
99+
delete updated.actions;
100+
}
98101
params.changes.push(
99102
`Removed ${params.pathPrefix}.actions.reactions (Google Chat does not support reactions).`,
100103
);

extensions/irc/src/config-schema.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Irc helper module supports config schema behavior.
22
import {
33
ChannelGroupEntrySchema,
4-
ChannelMentionPatternsSchemas,
54
DmPolicySchema,
65
GroupPolicySchema,
76
MarkdownConfigSchema,
@@ -53,7 +52,7 @@ const IrcAccountSchemaBase = z
5352
groupAllowFrom: z.array(z.union([z.string(), z.number()])).optional(),
5453
groups: z.record(z.string(), ChannelGroupEntrySchema.optional()).optional(),
5554
channels: z.array(z.string()).optional(),
56-
mentionPatterns: ChannelMentionPatternsSchemas.stringArray.optional(),
55+
mentionPatterns: z.array(z.string()).optional(),
5756
markdown: MarkdownConfigSchema,
5857
...ReplyRuntimeConfigSchemaShape,
5958
})

extensions/slack/src/doctor-contract.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ function migrateDmReplyMode(
4444
changes: string[],
4545
): boolean {
4646
const dm = asObjectRecord(entry.dm);
47-
if (!dm || !Object.hasOwn(dm, "replyToMode")) return false;
47+
if (!dm || !Object.hasOwn(dm, "replyToMode")) {
48+
return false;
49+
}
4850
const byType = asObjectRecord(entry.replyToModeByChatType) ?? {};
4951
if (byType.direct === undefined) {
5052
byType.direct = dm.replyToMode;

extensions/whatsapp/src/doctor-contract.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export const legacyConfigRules: ChannelDoctorLegacyConfigRule[] = [
4141
function removeExposeErrorText(cfg: OpenClawConfig, changes: string[]): OpenClawConfig {
4242
const channels = cfg.channels as Record<string, unknown> | undefined;
4343
const entry = asObjectRecord(channels?.whatsapp);
44-
if (!entry) return cfg;
44+
if (!entry) {
45+
return cfg;
46+
}
4547
let changed = false;
4648
const next = { ...entry };
4749
if (Object.hasOwn(next, "exposeErrorText")) {
@@ -54,7 +56,9 @@ function removeExposeErrorText(cfg: OpenClawConfig, changes: string[]): OpenClaw
5456
const nextAccounts = { ...accounts };
5557
for (const [id, value] of Object.entries(accounts)) {
5658
const account = asObjectRecord(value);
57-
if (!account || !Object.hasOwn(account, "exposeErrorText")) continue;
59+
if (!account || !Object.hasOwn(account, "exposeErrorText")) {
60+
continue;
61+
}
5862
const cleaned = { ...account };
5963
delete cleaned.exposeErrorText;
6064
nextAccounts[id] = cleaned;

scripts/plugin-sdk-surface-report.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ export function readPluginSdkSurfaceBudgets(env = process.env) {
284284
// +1: SwarmConfig exposes the tools.swarm contract through config-types.
285285
// +3: harness sessionFork capability params, result, and failure-code contracts.
286286
// +2: upstream-link registry write/delete for harness-owned session forks.
287-
8183,
287+
// Harvest: mention-pattern schemas and helper exports -3.
288+
8179,
288289
env,
289290
),
290291
publicFunctionExports: readPluginSdkSurfaceBudgetEnv(

src/agents/mcp-transport-config.test.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,14 @@ describe("resolveMcpTransportConfig", () => {
4949
);
5050
});
5151

52-
it("clamps oversized MCP request timeout aliases to the Node timer maximum", () => {
53-
const seconds = resolveMcpTransportConfig("probe", {
54-
command: "node",
55-
connectTimeout: 1e306,
56-
timeout: 1e306,
57-
});
58-
const milliseconds = resolveMcpTransportConfig("probe", {
52+
it("clamps oversized canonical MCP timeouts to the Node timer maximum", () => {
53+
const resolved = resolveMcpTransportConfig("probe", {
5954
command: "node",
6055
connectionTimeoutMs: 1e306,
6156
requestTimeoutMs: 1e306,
6257
});
6358

64-
expect(seconds).toEqual(
65-
expect.objectContaining({
66-
connectionTimeoutMs: MAX_TIMER_TIMEOUT_MS,
67-
requestTimeoutMs: MAX_TIMER_TIMEOUT_MS,
68-
}),
69-
);
70-
expect(milliseconds).toEqual(
59+
expect(resolved).toEqual(
7160
expect.objectContaining({
7261
connectionTimeoutMs: MAX_TIMER_TIMEOUT_MS,
7362
requestTimeoutMs: MAX_TIMER_TIMEOUT_MS,

src/agents/tools/music-generate-background.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { MUSIC_GENERATION_TASK_KIND } from "../music-generation-task-status.js";
55
import {
66
announceDeliveryMocks,
77
createMediaCompletionFixture,
8-
expectFallbackMediaAnnouncement,
98
expectQueuedTaskRun,
109
expectRecordedTaskProgress,
1110
resetMediaBackgroundMocks,

0 commit comments

Comments
 (0)