Skip to content

refactor(actionagent): spell the MCP constants with the MCP acronym - #368

Merged
TonsOfFun merged 3 commits into
mainfrom
mcp-catalog-acronym
Aug 19, 2026
Merged

refactor(actionagent): spell the MCP constants with the MCP acronym#368
TonsOfFun merged 3 commits into
mainfrom
mcp-catalog-acronym

Conversation

@TonsOfFun

@TonsOfFun TonsOfFun commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Renames the engine's MCP-named constants to the acronym spelling their names are built from:

Before After
ActionAgent::McpCatalog ActionAgent::MCPCatalog
ActionAgent::Api::McpController ActionAgent::Api::MCPController
ActionAgent::Api::McpServersController ActionAgent::Api::MCPServersController
ActionAgent::McpRecordingMiddleware ActionAgent::MCPRecordingMiddleware
ActionAgent::PlaywrightMcpClient ActionAgent::PlaywrightMCPClient

Files keep their mcp_*.rb names; INFLECTION_OVERRIDES (added in v1.2.2 for exactly this case) gains the five entries, so Zeitwerk autoloads the acronym constants identically in every host — plain-inflection hosts and hosts that register API/MCP acronyms alike.

The controller renames need one new mechanism: a plain-inflection host's router camelizes action_agent/api/mcp_servers to Api::McpServersController, which no longer exists. The const_missing shim gains the reverse bridge (DEFAULT_SPELLINGS, derived from the overrides): a missing constant matching an override's default spelling resolves to the acronym constant. The same bridge keeps caller code written against the pre-acronym names (ActionAgent::McpCatalog, PlaywrightMcpClient, …) resolving, so the rename is not a breaking change.

Covered by a new engine test asserting each default spelling resolves to its acronym constant, plus the existing route-mapping and eager-load tests, which exercise both directions in the dummy (plain-inflection) host.

Out of scope, deliberately: Api/ApiKey keep their default spellings (the existing shim already serves acronym hosts there), and the test-suite-local Mcp* class names in test/ are not autoloaded constants.

Verified mounted inside Sparkle (a host that registers both API and MCP acronyms) against actionagent 1.2.2 + activeagent 1.3.0: the Tools and MCP Services views render and trace ingest works.

TonsOfFun and others added 2 commits August 18, 2026 21:00
The catalog's constant now uses the acronym spelling its name is built
from, registered through the engine's INFLECTION_OVERRIDES so every host
autoloads it the same way regardless of its own inflections.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MCPController, MCPServersController, MCPRecordingMiddleware and
PlaywrightMCPClient join MCPCatalog in INFLECTION_OVERRIDES. The
const_missing shim gains the reverse bridge the controller renames
require: a plain-inflection host's router camelizes the mcp_* files to
Mcp* names, which DEFAULT_SPELLINGS resolves to the acronym constants —
and the same bridge keeps caller code written against the pre-acronym
names working.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@TonsOfFun TonsOfFun changed the title refactor(actionagent): spell the MCP catalog constant MCPCatalog refactor(actionagent): spell the MCP constants with the MCP acronym Aug 19, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@TonsOfFun
TonsOfFun marked this pull request as ready for review August 19, 2026 04:21
@TonsOfFun
TonsOfFun merged commit a761428 into main Aug 19, 2026
8 checks passed
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