Skip to content

refactor: rename ChatAgent → Agent across the contract surface#137

Merged
blove merged 6 commits into
mainfrom
feat/rename-chat-agent-to-agent
Apr 25, 2026
Merged

refactor: rename ChatAgent → Agent across the contract surface#137
blove merged 6 commits into
mainfrom
feat/rename-chat-agent-to-agent

Conversation

@blove

@blove blove commented Apr 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Renames ChatAgent / ChatAgentWithHistory to Agent / AgentWithHistory.
  • Strips Chat prefix from message/data types: Message, Role, ToolCall, ContentBlock, Subagent.
  • Prefixes Agent on names that would collide otherwise: AgentCustomEvent (vs DOM), AgentInterrupt / AgentCheckpoint (vs @langchain/langgraph-sdk), AgentStatus (clarity), AgentSubmitInput / AgentSubmitOptions (clarity).
  • Renames toChatAgenttoAgent, mockChatAgentmockAgent, conformance helpers analogously.
  • File renames via `git mv` so blame/log preserve.
  • No backwards-compat aliases — fresh names only.
  • Component class names (`ChatMessagesComponent` etc.) intentionally NOT renamed — they're chat UI components, not contract types.

Motivation

Naming clarity. The contract is agent-general; the `Chat` prefix obscured this and misaligned with industry vocabulary (OpenAI Agents SDK, AG-UI, Mastra, CrewAI, Pydantic AI all use `Agent`).

Test Plan

  • `nx run-many -t lint,test,build -p chat,langgraph` passes
  • `nx affected -t build` passes for all cockpit demos
  • No residual `ChatAgent` / `ChatMessage` / etc. type references in `libs/` or `cockpit/`
  • Cockpit demos render correctly in browser

Design + plan

  • Spec: `docs/superpowers/specs/2026-04-24-agent-rename-design.md`
  • Plan: `docs/superpowers/plans/2026-04-24-agent-rename.md`

🤖 Generated with Claude Code

blove and others added 6 commits April 24, 2026 13:44
Scope: contract types strip prefix (Agent, AgentWithHistory). Data
types go bare (Message, Role, ToolCall, ContentBlock, Subagent).
Collision-prone types prefix with Agent (AgentCustomEvent,
AgentInterrupt, AgentStatus, AgentSubmit*, AgentCheckpoint).
No backwards-compat aliases, no structural changes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
8 tasks: rename agent/ files, testing/ files, exports, primitives +
compositions, langgraph adapter file, cockpit consumers, then verify.
git mv preserves history; ordered find/replace avoids partial matches.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Strip Chat prefix from contract types (Agent, AgentWithHistory)
- Strip Chat prefix from data types (Message, Role, ToolCall, ContentBlock, Subagent)
- Prefix Agent on collision-prone types (AgentStatus, AgentInterrupt, AgentCustomEvent, AgentSubmit*, AgentCheckpoint)
- Rename mockChatAgent → mockAgent, conformance helpers analogously
- File renames via git mv preserve history

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adapter function renamed to match Agent rename in @cacheplane/chat.
ChatAgent → Agent, ChatAgentWithHistory → AgentWithHistory in return
type and translation helpers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Updates imports of toChatAgent → toAgent and any direct Type
references (ChatAgent, ChatMessage, etc.) to the new bare/Agent-
prefixed names. Component class imports (ChatMessagesComponent etc.)
are unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 25, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment Apr 25, 2026 0:49am
cacheplane-minting-service Ready Ready Preview, Comment Apr 25, 2026 0:49am

Request Review

@blove blove merged commit 891fcb7 into main Apr 25, 2026
15 checks passed
@blove blove deleted the feat/rename-chat-agent-to-agent branch May 7, 2026 16:30
blove added a commit that referenced this pull request Jun 9, 2026
* docs: ChatAgent → Agent rename design

Scope: contract types strip prefix (Agent, AgentWithHistory). Data
types go bare (Message, Role, ToolCall, ContentBlock, Subagent).
Collision-prone types prefix with Agent (AgentCustomEvent,
AgentInterrupt, AgentStatus, AgentSubmit*, AgentCheckpoint).
No backwards-compat aliases, no structural changes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs: ChatAgent → Agent rename implementation plan

8 tasks: rename agent/ files, testing/ files, exports, primitives +
compositions, langgraph adapter file, cockpit consumers, then verify.
git mv preserves history; ordered find/replace avoids partial matches.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor(chat): rename ChatAgent → Agent and paired types

- Strip Chat prefix from contract types (Agent, AgentWithHistory)
- Strip Chat prefix from data types (Message, Role, ToolCall, ContentBlock, Subagent)
- Prefix Agent on collision-prone types (AgentStatus, AgentInterrupt, AgentCustomEvent, AgentSubmit*, AgentCheckpoint)
- Rename mockChatAgent → mockAgent, conformance helpers analogously
- File renames via git mv preserve history

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor(langgraph): rename toChatAgent → toAgent

Adapter function renamed to match Agent rename in @cacheplane/chat.
ChatAgent → Agent, ChatAgentWithHistory → AgentWithHistory in return
type and translation helpers.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* refactor(cockpit): adopt Agent rename across demos

Updates imports of toChatAgent → toAgent and any direct Type
references (ChatAgent, ChatMessage, etc.) to the new bare/Agent-
prefixed names. Component class imports (ChatMessagesComponent etc.)
are unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs(chat): update README to reference Agent contract

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant