From aa13c7daf04f7b45dab6517a4f8f7581506b449e Mon Sep 17 00:00:00 2001 From: rattle99 <24495512+rattle99@users.noreply.github.com> Date: Wed, 20 May 2026 15:46:13 +0530 Subject: [PATCH] fix: use default_factory for marketplace_source (Python 3.11 dataclass) --- src/agentpeek/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/agentpeek/models.py b/src/agentpeek/models.py index d2c4c02..012470b 100644 --- a/src/agentpeek/models.py +++ b/src/agentpeek/models.py @@ -1,5 +1,5 @@ from collections.abc import Mapping -from dataclasses import dataclass +from dataclasses import dataclass, field from pathlib import Path from types import MappingProxyType from typing import Literal @@ -142,7 +142,11 @@ class Plugin: # `~/.claude/plugins/known_marketplaces.json` and the # `extraKnownMarketplaces` keys of user + remote settings. Empty # mapping when the marketplace isn't found in any registry. - marketplace_source: Mapping[str, str] = MappingProxyType({}) + # `default_factory` (not bare default) because Python 3.11's + # @dataclass rejects MappingProxyType as a mutable default. + marketplace_source: Mapping[str, str] = field( + default_factory=lambda: MappingProxyType({}) + ) MemoryKind = Literal["claude_md", "memory_index", "memory_entry"]