Skip to content

consolidation(extensions): collapse the duplicate extensions/ package into middleware/ and remove it #9794

Closed

Description

@mrveiss

PR #9787 shimmed the 3 duplicate builtin/ extensions, but the top-level extensions/ package is still a near-verbatim duplicate of middleware/ (renamed in #7426). It is kept alive only by tests — no production code imports the top-level extensions.* (verified: only chat_workflow/*_test.py and transcriber/tests/test_extension.py reference extensions.base/.manager/.hooks).

Duplication evidence (extensions/ vs middleware/)

file differing lines size
extension_manifest.py 0 (identical) 8
hooks.py 2 232
base.py 4 556
manager.py 4 404
hook_invoker.py 8 358

Duplicated classes: Extension, HookContext (base.py ×2), ExtensionManager (manager.py ×2), HookPoint (hooks.py), ExtensionManifest. Two parallel class hierarchies coexist; ExtensionManager.register() is duck-typed (name-only) so they don't clash at runtime — masking the duplication.

Proposed work

  1. Repoint the remaining test importers (chat_workflow/prompt_hooks_test.py, wired_hooks_test.py, transcriber/tests/test_extension.py, extensions/extension_hooks_test.py) to middleware.*.
  2. Replace the top-level extensions/*.py with thin re-export shims (matching the fix(extensions): repair None|None crash + shim duplicate builtin extensions (#9786, #9779) #9787 builtin shims), then remove the extensions/ package once no importers remain.
  3. Keep TranscriberExtension (the one genuinely-unique builtin) — migrate it to middleware/builtin/.

Notes

Completes the #7426 rename + #9779/#9786/PR #9787 line of work. Discovered while reviewing PR #9787. The None | None base-class fix already landed on PR #9787's branch.

Activity

  1. mrveiss commented on Jun 10, 2026

    @mrveiss
    OwnerAuthor

    Bug sweep 2026-06-10 → TOO-BIG (not behavior-preserving). Confirmed the top-level autobot-backend/extensions/ package is still a near-verbatim duplicate of middleware/ (e.g. extensions/base.py is the full Issue #658 implementation, not a re-export shim). Collapsing it requires repointing the remaining test importers (chat_workflow/*_test.py, transcriber/tests/test_extension.py) to middleware.*, replacing the modules with shims, migrating TranscriberExtension to middleware/builtin/, then removing the package — a multi-file consolidation with test churn, not a localized fix. Leaving for a dedicated PR.

  2. github-actions commented on Jun 12, 2026

    @github-actions
    Contributor

    PR #10004 (merged to Dev_new_gui) references this issue with a close keyword.

    refactor(extensions): collapse duplicate extensions/ package into middleware/ (#9794)

    If this issue is fully resolved, close it manually. If work remains, no action is needed.

  3. mrveiss commented on Jun 12, 2026

    @mrveiss
    OwnerAuthor

    Closed — merged to Dev_new_gui. Commit: d211625 (PR #10004). Criteria met: top-level extensions/ package removed (12 pure-shim files verified by diff before deletion); all test importers repointed to middleware.* (151 tests pass); TranscriberExtension already existed identically in middleware/builtin/; CI find-path, telemetry-plugin import, boundary lint tool, semgrep rule and live docs retargeted. Discoveries: none (review findings fixed in-PR). Completes the #7426 rename line of work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions