Skip to content

TheaTask depends on the retired TheaProvider shape via a no-op shim (abstraction inversion) #247

Description

@sydneyrenee

The domain object TheaTask still hard-depends on the TheaProvider interface. TaskManager.createProviderShim() (src/core/TaskManager.ts) fakes that interface with no-op postMessageToWebview / postStateToWebview, and the inline comment says "TheaTask currently expects TheaProvider — well need to update it."

It works only because TheaTask also emits message events (src/core/TheaTask.ts:295,302) that the chat participant subscribes to (src/ux/chat/registerChatParticipant.ts).

Problems

  • Core/domain layer is coupled to a retired UI-provider shape (inverted dependency).
  • The chat handler drops all partial messages (registerChatParticipant.ts:127 returns early on message.partial), so there is no incremental/streaming output in the chat UI — only completed blocks render.

Proposed

  • Define a small TaskHost/TaskContext interface (context, state, mcpHub, event sink) and have TheaTask depend on that instead of TheaProvider.
  • Stream partials to ChatResponseStream.markdown() (or progress) instead of discarding them.

Acceptance

  • TheaTask no longer imports TheaProvider.
  • Chat output streams incrementally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    architectureArchitecture / wiring / structural concernstech-debtCleanup, dead code, migration debt

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions