Skip to content

Conversation

kentcdodds
Copy link
Member

@kentcdodds kentcdodds commented Oct 10, 2025

  • Removed the ReactRouterChatSDKBootstrap component from the root layout.
  • Updated the catch-all route to throw a 404 response for unmatched URLs.
  • Simplified the NotFound component to utilize the GeneralErrorBoundary for error handling.
  • Adjusted routes to include 'index.html' for better routing consistency.

Note

Adds Apps SDK compatibility (adapter + widgets) with a new ChatGPT-hosted UI route, overhauls design tokens, and updates build/config/deps (incl. staging env, CORS, and Vite base).

  • Apps SDK & UI:
    • Add #app/utils/mcp-ui-compat.client.ts to adapt MCP-UI messages to OpenAI Apps SDK (window.openai.*) and provide render-data bridging.
    • New ChatGPT-hosted route routes/chat-gpt-app/index.tsx to render entries and support delete via MCP tool.
    • Update #app/utils/mcp.ts to use Apps SDK for tool calls and render data; simplify waiting logic.
  • MCP Server & Widgets:
    • Add worker/mcp/widgets.ts and register widgets via registerWidgets in EpicMeMCP.init(); provide versioned ui://widget/... resources.
    • Disable legacy UI tools in worker/mcp/tools.ts (comment out view_journal, view_entry, update_entry, update_tag).
  • Styling:
    • Overhaul app/app.css: system fonts, color-scheme: light dark, transparent backgrounds, light/dark tokens via light-dark(), larger radius, simplified typography scale and container spacing.
  • Routing:
    • Add index.html route mapping to routes/chat-gpt-app/index.tsx; set routeDiscovery: initial.
  • Root & Error Handling:
    • Add <meta name="color-scheme" content="light dark" />; log errors in ErrorBoundary.
  • Build/Config:
    • vite.config.ts: env-based base, BUILD_TIMESTAMP, Cloudflare headers/redirects dev support.
    • Add CORS headers in public/_headers.
    • wrangler.jsonc: add staging env with separate DB/KV; types updated.
    • New scripts: build:staging, deploy:staging (via cross-env).
  • Dependencies:
    • Bump packages (@modelcontextprotocol/sdk, react-router, wrangler, Cloudflare plugins, ESLint/types); add cross-env.

Written by Cursor Bugbot for commit 87a4615. This will update automatically on new commits. Configure here.

- Removed the ReactRouterChatSDKBootstrap component from the root layout.
- Updated the catch-all route to throw a 404 response for unmatched URLs.
- Simplified the NotFound component to utilize the GeneralErrorBoundary for error handling.
- Adjusted routes to include 'index.html' for better routing consistency.
cursor[bot]

This comment was marked as outdated.

- Removed the initial route discovery mode from the React Router configuration.
- Updated Vite configuration to define a BUILD_TIMESTAMP instead of BUILD_VERSION.
- Cleaned up the root layout by removing the suppressHydrationWarning attribute from the HTML tag.
- Deleted the unused test route and its associated component.
- Enhanced CORS headers in the worker to conditionally allow specific methods and headers based on the request URL.
- Updated widget versioning to use BUILD_TIMESTAMP for consistency.
- Updated routing to serve the new chat-gpt-app component at /index.html.
- Introduced chat-gpt-app.tsx with a client loader and a simple UI widget for interaction.
- Removed the previous route configuration for index.html in favor of the new implementation.
- Adjusted widget registration to reflect the new routing structure.
cursor[bot]

This comment was marked as outdated.

}),
)
}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Promise Nesting and Direct API Access

The sendMcpMessage function's new tool type handling resolves its promise with a nested promise, rather than the final value. It also directly accesses window.openai and its methods without checking for their existence, which can cause runtime errors, and bypasses the standard message system's error handling and response schema validation.

Fix in Cursor Fix in Web

import { type Route } from './+types/journal-viewer.tsx'

export async function clientLoader({ request }: Route.ClientLoaderArgs) {
export async function clientLoader() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Client Loader Missing Request Object

The clientLoader no longer receives the request object, which means waitForRenderData loses its signal option. This removes request cancellation support, potentially causing memory leaks, unnecessary network requests, and race conditions if a user navigates away.

Fix in Cursor Fix in Web

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