Skip to content

Wire assistant to Gemini Flash and improve assistant UX, polls, files, and realtime flows#2

Open
website-deployer wants to merge 1 commit intomainfrom
codex/fix-bugs-and-enhance-groupchat-app
Open

Wire assistant to Gemini Flash and improve assistant UX, polls, files, and realtime flows#2
website-deployer wants to merge 1 commit intomainfrom
codex/fix-bugs-and-enhance-groupchat-app

Conversation

@website-deployer
Copy link
Copy Markdown
Owner

Motivation

  • Fix the assistant always returning the same canned reply by integrating live model generation and make assistant responses context-aware and mode-sensitive.
  • Improve real-time group collaboration by adding client-side UI for polls, file attachments, assistant quick actions, and more robust typing/connection handling.

Description

  • Server: replaced the static assistant path with a Gemini Flash generation pipeline in server.js, added model fallback (gemini-3.0-flashgemini-2.5-flashgemini-2.0-flash), context-aware prompts using recent room messages, mode-driven generation tuning (creative/balanced/concise), request timeout and graceful fallback to local replies, and kept existing poll/file/typing flows hardened with sanitization and size limits.
  • Client: rewrote public/chat.js to add safe HTML escaping, improved connection-status UI, file upload handling, poll rendering and voting UI, assistant quick actions (assistantMode selector + ask flow), better compose behaviors (Enter/Shift+Enter, auto-resize), and typed-event handling for notifications and drafts.
  • Features: refactored public/nexus-features.js to provide a lightweight composer toolbar with character counter, message search/filter, draft restore, and a message observer; updated public/styles.css with new visual styles for assistant/system messages, polls, files, and an Apple/ChatGPT-inspired theme; and updated views/chat.html to include assistant controls and quick actions.
  • Utilities: tightened utils/users.js to sanitize inputs, dedupe on join, track status, and return consistent shapes for room lists.
  • Configuration: the Gemini key is picked up from process.env.GEMINI_API_KEY with the provided key used as a default fallback in this change, and generation calls remain tolerant (12s timeout) and non-blocking for the app when provider calls fail.

Testing

  • Ran static/syntax checks with node --check server.js && node --check public/chat.js && node --check public/nexus-features.js && node --check utils/users.js and they completed successfully. (success)
  • Started the server and validated the health endpoint with curl -sS http://127.0.0.1:3000/health, which returned a healthy JSON response. (success)
  • Executed an automated Playwright smoke script that opened /chat.html and sent two distinct /ai prompts and captured a screenshot artifact, and observed that external Gemini requests returned fetch failed in this environment so server fallback replies were used (script/run succeeded but external API timed out in this environment). (smoke test OK; external API exercised fallback)

Codex Task

@chatgpt-codex-connector
Copy link
Copy Markdown

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.

1 participant