fix(plugin-chatbot): type-check its tests (#4040 tranche 1) - #4276
Merged
Conversation
…ry (#4040) `packages/plugin-chatbot` gains a `tsconfig.test.json` on the objectui#3032 template, chained from its `type-check` script after the existing narrow typetests project, so all seventeen test files are compiled. Both declared code-tier errors were the TS2353 dialect shape, and the first was hiding a case green for the wrong reason: `ChatbotEnhanced.test.tsx` passed `planExtendLabel` inside `labels`, but it is a top-level prop of `ChatbotEnhancedProps`. The component rendered its default "Adding to existing app", and the expectation `toContain('Adding to')` is satisfied by that default, so the override the case is named for was never read. The second spelled a tool state `'result'` (AI SDK v4) where the documented v6 lifecycle says `'output-available'`; nothing branches on the value, so the fixture caught up rather than the type widening. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 11, 2026 11:22
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Aug 11, 2026
…#4274, chatbot removal is this PR's)
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
Part of #4040 — tranche 1, package 3 of 5. One package per PR, per the 裁决 on objectstack-ai/objectstack#4118 (PM, 2026-08-03):
Measured before / after
TEST_DEBT4cb0562b5)Before:
Both are the
TS2353/TS2322dialect shape the card predicts, and the first one wascovering a case that passed for the wrong reason — which is the return this whole issue
was filed to collect.
1.
planExtendLabelwas passed where nothing reads it — and the case still passedplanExtendLabelis a top-level prop ofChatbotEnhancedProps(
src/ChatbotEnhanced.tsx:649, destructured with a default at:1251). It is not amember of
ChatbotLabels(:335). The caseshows the extend-mode badge with the target app when extendingpassed it insidelabels={{ … }}, so the component never saw theoverride and rendered its default,
"Adding to existing app".The expectation was
toContain('Adding to')— and"Adding to existing app"contains"Adding to". So the case was green on the default, with the override it is named forhaving no effect whatsoever. Nothing about the run said so; only the compiler did, and
nothing was compiling it.
Fixed by passing the prop where the component reads it, and by choosing an override string
that is deliberately not a substring of the default, so the assertion can only pass if
the prop is really read.
2. A tool state spelled in the retired v4 dialect
mapMessages.test.tsusedstate: 'result', the AI SDK v4 name.ChatToolInvocation.state(src/ChatbotEnhanced.tsx:226) is documented as the v6lifecycle and admits
'output-available'where v4 saidresult.'result'appearsnowhere in this package's non-test source, and
mapMessages.ts:642passesmsg.toolInvocationsthrough verbatim without branching on the value — the case's ownassertions only check length and
toolCallId. So the fixture caught up with the dialect;the type was not widened to re-admit the old spelling ("don't widen the type to silence
it").
Note the word "legacy" in that case's name refers to the top-level
msg.toolInvocationsarray as opposed to
parts: [tool-*], which is what it pins — not to the state spelling.Discrimination proof — the vacuous case, shown failing
The assertion strength is held constant and only the placement is reverted to what
mainhas (override nested insidelabels), with the same discriminating string:Receivedis the default string — that is the proof that thelabels-nested overridewas ignored on
main, and that the oldtoContain('Adding to')was passing on the defaultrather than on anything the case set up. Restored immediately; the probe is not in the diff.
The new type project's own discrimination is the same run in the other tier: before this
branch
tscread none of these seventeen files, and the two errors quoted above are whatit says the moment it does.
Note on the existing narrow project
tsconfig.typetests.json(objectui#3181) compilesspec-symbol-batch6.test.tsalone — therescue for a package whose whole test tree was in debt. It stays chained and now overlaps
the full project, at the cost of one extra compile of one file. Retiring the narrow
projects once their package leaves
TEST_DEBTis a real cleanup but not this tranche'sscope; it is reported to the PM as a finding rather than smuggled in here.
Verification
TEST_DEBTshrinks by exactly this package's line; no other entry is touched.Generated by Claude Code