Skip to content

[stage 2] Delete the deprecated, inert chatbot key maxToolRoundtrips (gated on the stage-1 deprecation shipping) #5919

Description

@claude

Blocked-by: #5605 stage 1 shipping in a release (PR #5918). Do not start this before then.

Stage 2 of the two-stage retirement of the inert chatbot key maxToolRoundtrips, per the maintainer's 2026-08-22 item-13 ruling that retiring a published surface is deprecate-for-a-release, then delete.

Why it is being retired (measured in #5605, not re-litigate-able here)

The key cannot be honoured from this repo. @ai-sdk/react's useChat takes ChatInit plus throttle/resume, and ChatInit declares exactly one loop control — the boolean predicate sendAutomaticallyWhen — and no numeric cap under any spelling; the numeric knob was removed from useChat in a major, and its successor became stopWhen / stepCountIs, declared only on the server-side generateText / streamText / tool-loop-agent settings. ObjectUI is backend-agnostic, so it owns no server loop either. The platform's working cap is planning.maxIterations on the agent.

What stage 2 deletes — in one pass, no half-removal

  • packages/types/src/complex.ts — the ChatbotSchema.maxToolRoundtrips interface field.
  • packages/types/src/zod/complex.zod.ts — the zod declaration.
  • packages/plugin-chatbot/src/renderer.tsx — all three maxToolRoundtrips: schema.maxToolRoundtrips call sites.
  • packages/plugin-chatbot/src/useObjectChat.ts — the option, the destructure, and the stage-1 deprecation notice (warnMaxToolRoundtripsInert, resetMaxToolRoundtripsWarning, and its useEffect).
  • content/docs/plugins/plugin-chatbot.mdx — both locations.
  • packages/plugin-chatbot/src/__tests__/useObjectChat.maxToolRoundtrips.test.tsx — the stage-1 pin, which is written to fail on exactly this deletion.

⚠️ One measured trap for whoever takes this

BaseSchema is .passthrough() (packages/types/src/zod/base.zod.ts:197), so deleting the declaration will not make an authoring document fail — a document setting maxToolRoundtrips keeps parsing green, silently. Do not expect a parse error to signal the removal, and do not add one on the way past: a strictness change is a separate, much wider decision. This was measured during stage 1 — an assertion built on the opposite assumption passed while the declaration was ablated away.

Consequently the stage-1 pin asserts ChatbotSchema.shape membership rather than a parse result. Stage 2 should delete that test rather than try to keep it green.

Done when

The key appears nowhere in packages/, content/docs/, with a changeset, and the deprecation notice is gone with it.


Generated by Claude Code


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:on-hold

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions