Repository navigation
Give Action one metaclass with both parents so Toad imports on Textual main - #1372
Merged
Merged
Conversation
…l main textual#215 gave KeyDeclaration the KeyDeclarationType metaclass, while Action also inherits DeclaredFamily's FamilyMeta; neither metaclass subclasses the other, so `import toad.widget_actions` raises a metaclass conflict and agent-comms' debt-src/debt-tools die importing the Toad cutover tools on every head. KeyFamilyMeta(FamilyMeta, KeyDeclarationType) is the one class both bases require; same lines as toad#1338's fix, so its merge of main resolves to them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XbFMSoWgC3ZwKzjT4SwMDu
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
trissim
enabled auto-merge
October 30, 2026 18:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In numbers: 1 file, +8/-3, 1 commit. Fixes the import crash that turns debt-src and debt-tools red on every fresh agent-comms head (#3723, #3697, #3670, #3566 seen red; older heads passed).
Mechanism
Before:
class Action(KeyDeclaration[Context], Command, DeclaredFamily, Generic[Context], affix="Action"). Its two metaclassesKeyDeclarationType(ABCMeta)(textualkeys.py:21, from textual#215) andFamilyMeta(AutoRegisterMeta, ABCMeta)are unrelated, soimport toad.widget_actionsraisesTypeError: metaclass conflict. The agent-comms NRA gate importstools/cutover/carry_toad_key_mode.py:15→toad.preferences→ … →widget_actionsand dies.After:
class KeyFamilyMeta(FamilyMeta, KeyDeclarationType), the one metaclass both bases require, andAction(..., metaclass=KeyFamilyMeta, affix="Action"). Multiple parents, nothing restated. These are the same lines as toad#1338's fix, landed alone because #1338 is red on its own unrelated growth (menus.py OwnTypeTest +1, TypeCheckingImport +5, TypeErrors +4). Its merge of main resolves to these lines unchanged.Proof
On fresh mains of toad (1d85311), textual (76f9ef770) and agent-comms: before,
import toad.preferencesraises the metaclass conflict. After,toad.preferences,cutover.carry_toad_key_mode,cutover.carry_toad_arrow_keysandtoad.appall import.type(Action).__mro__startsKeyFamilyMeta → FamilyMeta → AutoRegisterMeta.Deleted
Nothing.
Assumed: no other Toad class mixes
KeyDeclarationwithDeclaredFamilyon main; the gate's import path andtoad.appimport cleanly, which covers every module the app loads at start.🤖 Generated with Claude Code
https://claude.ai/code/session_01XbFMSoWgC3ZwKzjT4SwMDu