Skip to content

AI Chat: rewrite to modern composer + tool architecture #1047

Closed

Description

@datlechin

The current chat panel has 5 providers but a flat text-in/text-out model. Rewrite the chat layer so it can do what Zed, VSCode Copilot Chat, and Cursor do.

What it should do

  • Model picker inline in the composer. No Settings detour.
  • @-mentions for tables, schemas, current query, query results, saved queries.
  • Slash commands: /explain, /fix, /optimize, plus user-defined.
  • Tool calling that re-uses the existing MCP tools in TablePro/Core/MCP/Protocol/Tools/. Chat consumes its own MCP layer instead of duplicating schema fetch and query exec.
  • Per-turn provider attribution. Switching mid-conversation is tracked.
  • Opt-in context. No auto-shoveling schema into every prompt.

Architecture target

Replace AIProvider (text only) with three abstractions:

  1. ChatTransport. Sends [ChatTurn] with content blocks (.text, .toolUse, .toolResult, .attachment). Yields ChatStreamEvent.
  2. ContextItem. Discriminated union for @-mention attachments. Rendered as chips in the message bubble.
  3. ChatTool. Wraps the existing MCP tools so chat and external MCP clients share one implementation.

Apple Intelligence (Foundation Models on macOS 26+) becomes another ChatTransport once this lands.

Out of scope

Apple Intelligence integration. Tracked separately.

Activity

  1. added
    enhancement
    on May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions