Skip to content

Conversation

@esclipse
Copy link
Owner

Motivation

  • Resolve a TypeScript compile error caused by chat messages lacking explicit user/assistant typing in the creative chat streaming flow.
  • Ensure the OpenAI client streaming code has properly typed messages so the app can build and stream assistant output reliably.
  • Preserve and align recent changes: proxying stock analysis to the hosted /analyze endpoint, front-end streaming UX, and improved diagnostics.
  • Improve error handling and logging for AI-related endpoints to provide clearer failure details.

Description

  • Cast sanitized messages to { role: 'user' | 'assistant', content: string } in app/api/creative-chat/route.ts to satisfy the OpenAI SDK types.
  • Refactor creative-chat to create an OpenAI client explicitly, stream chat completions, and return an SSE text/event-stream Response with improved logging and error mapping.
  • Update app/api/stock-analysis/route.ts to proxy to the hosted /analyze path, accept scoring, score, aiPrompt, and settings, and optionally call the AI to generate analysis when aiPrompt is present.
  • Align front-end pages by updating app/stock/page.tsx to send symbol lists and score booleans, update app/translate/page.tsx to consume streaming creative-chat responses and show a live assistant placeholder, remove the local python_service and the next.config.js rewrite, and update .env.local/README.md to the hosted PYTHON_SERVICE_URL.

Testing

  • The TypeScript build was run and initially failed due to the chat message typing error, which this change addresses.
  • After applying the typing fix, no automated CI/build was re-run in this rollout.
  • No unit or integration tests were executed as part of this change.

Codex Task

@vercel
Copy link

vercel bot commented Dec 31, 2025

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

Project Deployment Review Updated (UTC)
mcp-test Ready Ready Preview, Comment Dec 31, 2025 9:39am

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants