Repository navigation
Closed
Description
Date: 2026-01-02
Severity: High (Blocks build)
Status: Unresolved
Related: Discovered after fixing broken pi-ai patch
Upstream Issue: https://github.com/steipete/clawdis (need to report)
Summary
After the pi-ai patch was fixed in commit 6cda8443, a new TypeScript error appeared. The discord.actions configuration type is not properly defined, causing TypeScript to infer never as the key type for isActionEnabled() function calls.
Error Details
src/agents/clawdis-tools.ts(1758,32): error TS2345: Argument of type '"reactions"' is not assignable to parameter of type 'never'.
src/agents/clawdis-tools.ts(1772,32): error TS2345: Argument of type '"reactions"' is not assignable to parameter of type 'never'.
src/agents/clawdis-tools.ts(1792,32): error TS2345: Argument of type '"stickers"' is not assignable to parameter of type 'never'.
src/agents/clawdis-tools.ts(1805,32): error TS2345: Argument of type '"polls"' is not assignable to parameter of type 'never'.
// ... 25 more similar errors for: permissions, messages, threads, pins, search, memberInfo, roleInfo, roles, channelInfo, voiceStatus, events, moderationAdditionally:
src/tui/message-list.ts(65,11): error TS2552: Cannot find name 'MessageEntry'. Did you mean 'MessageEvent'?Root Cause
In src/agents/clawdis-tools.ts at line 1747-1754:
const isActionEnabled = (
key: keyof NonNullable<typeof cfg.discord>["actions"], // ← Type inference fails here
defaultValue = true,
) => {
const value = cfg.discord?.actions?.[key];
if (value === undefined) return defaultValue;
return value !== false;
};The type NonNullable<typeof cfg.discord>["actions"] resolves to never because:
- The
discordconfig type doesn't have anactionsproperty defined, OR - The
actionsproperty type is missing the required action keys
Expected Type Definition
The config should include something like:
interface ClawdisConfig {
discord?: {
actions?: {
reactions?: boolean;
stickers?: boolean;
polls?: boolean;
permissions?: boolean;
messages?: boolean;
threads?: boolean;
pins?: boolean;
search?: boolean;
memberInfo?: boolean;
roleInfo?: boolean;
roles?: boolean;
channelInfo?: boolean;
voiceStatus?: boolean;
events?: boolean;
moderation?: boolean;
};
// ... other discord config
};
// ... other config
}Files Affected
src/agents/clawdis-tools.ts(lines 1747-2235) - Discord action checkssrc/tui/message-list.ts(line 65) - Missing MessageEntry typesrc/config/config.ts- Likely where the type definition needs to be added
Temporary Workaround
Could use type assertion as a quick fix:
const isActionEnabled = (
key: string, // ← Temporary fix
defaultValue = true,
) => {
const value = cfg.discord?.actions?.[key as keyof typeof cfg.discord.actions];
if (value === undefined) return defaultValue;
return value !== false;
};Recommended Fix
- Add proper type definitions for
discord.actionsin the config schema - Ensure all action keys are properly typed
- Add
MessageEntrytype export in TUI message list module
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Priority
None yet
Activity
steipete commentedon Jan 3, 2026
Fixed on main via commit 3633c82. Discord action key typing now uses DiscordActionConfig; TUI MessageList now uses explicit MessageRole. Build passes (pnpm build). Closing.
Merge pull request #119 from dgarson/codex/non-claude-memory
fix(model): update gemini apikey modify function (openclaw#119)