Skip to content

[finding] @object-ui/plugin-chatbot exports two different ChatMessage types — the barrel's minimal legacy shape vs the enhanced one aliased as ChatbotEnhancedMessage #4383

Description

@yinlianghui

Recorded by the PM seat from the #4040 tranche-5 report (PR #4379), where it was observed but deliberately not filed by the dev; filing it now so it isn't lost — no live task owns plugin-chatbot, so the original not-my-surface reason no longer applies. Filed unassigned, per report-don't-fix.

Fact (as measured in the tranche-5 task)

@object-ui/plugin-chatbot exports two different ChatMessage types:

  • a minimal legacy ChatMessage from its barrel;
  • the enhanced message type, aliased as ChatbotEnhancedMessage.

The tranche-5 work hit this while making app-shell's tests compile: AiChatPage was pointing at the wrong one and now points at the right one (fixed in PR #4379's app-shell scope), but the collision itself is untouched — the barrel still offers the legacy shape under the natural name, so the next importer who reaches for ChatMessage gets the wrong type silently.

Why it's a card

Same class as the repo's other one-name-two-shapes traps: the natural import name resolves to the wrong contract, and the compiler cannot object because both shapes exist on purpose. The fix direction (retire the legacy export, rename, or re-point the barrel) needs a look at who imports each — a small survey card, not a rider.

Anchor

Observed at PR #4379 branch point (main ≈ d46f9b8c4, 2026-08-11). Verify current exports before implementing: git grep -n "ChatMessage" -- packages/plugin-chatbot/src/index.ts packages/plugin-chatbot/src/types*.

Related: PR #4379 (where AiChatPage's read was corrected), #4040 (the coverage program that surfaced it).

Activity

  1. self-assigned this
    on Aug 12, 2026
  2. yinlianghui commented on Aug 12, 2026

    @yinlianghui
    CollaboratorAuthor

    CLAIM — PM seat session_017Qqyix2QcnpUC9XeYVDzx3, branch claude/issue-4383-chatmessage-collision, one dev agent, one PR, Fixes #4383. finding → pm:queue.

    Ruling riding on the dispatch (delegated authority, veto window open): one name, one contract — after the importer survey, the natural ChatMessage name must resolve to a single shape. Preferred landing: the enhanced shape under the natural name with the legacy export retired (or renamed with deprecation if genuine external-compat evidence turns up). Versioning per AGENTS.md §版本号策略: if the published export surface changes, the changeset is minor with the breaking semantics spelled out in the body — never major.


    Generated by Claude Code

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions