Skip to content

claude-code-chat-browser: Frontend tool registry — link to backend dispatch table via generated manifest #100

Description

@clean6378-max-it

Calendar Day

Tuesday, July 1, 2026 (PR 2 of 2)

Planned Effort

3 story points (Medium–High) — sprint item #4

Depends on: Tuesday PR 1 (tool dispatch coordination #3) — static/tool_types.json is generated from KNOWN_TOOL_TYPES.

Problem

The frontend JavaScript SPA maintains its own independent registry of tool-type renderers (mapping tool type strings to DOM rendering functions). This registry was built by reading the backend dispatch table at development time but has no runtime or build-time linkage. If the backend adds support for a new tool type, the frontend silently falls through to a generic "unknown tool" renderer — producing a degraded but non-failing user experience that masks the gap.

Goal

One merged PR that generates static/tool_types.json from KNOWN_TOOL_TYPES, has the SPA cross-check its renderer map on init, logs console.warn for unknown types, and improves the fallback renderer to show raw type name and JSON payload.

Scope

Touch points

  • Build step — writes static/tool_types.json from KNOWN_TOOL_TYPES (Option A: generated manifest; no new API endpoint)
  • Frontend SPA — fetch manifest on init; cross-check renderer map; console.warn for backend types lacking a specific renderer
  • Fallback "unknown tool" renderer — display raw tool type name and JSON payload
  • CI check (part of test_tool_dispatch_sync.py from PR 1) — verify frontend registry completeness against manifest

Out of scope

  • GET /api/tool-types endpoint (Option B — not recommended)
  • New tool type implementations beyond existing renderers

Acceptance Criteria

  • static/tool_types.json is generated from KNOWN_TOOL_TYPES and committed or produced at build time
  • SPA fetches manifest on init and cross-checks its renderer map
  • Unknown backend tool types log console.warn with the type name (not silent fallback)
  • Fallback renderer displays raw tool type name and JSON payload
  • CI sync test verifies frontend registry completeness against manifest
  • Full pytest, mypy --strict, and ruff pass
  • PR approved by at least 1 reviewer

Verification

cd C:\Users\Jasen\CppAliance\claude-code-chat-browser
.\.venv\Scripts\Activate.ps1
pytest tests/test_tool_dispatch_sync.py -q
pytest -q

Manual: load session with a tool type missing a specific renderer — confirm console warning and fallback display.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions