Yetr AI Agent: A Chat Page That Imports Five Modules Its Folder Does Not Have
yetr-ai-agent is a public TypeScript repository of mine under github.com/yethikrishna, a Next.js 14 front end for an MCP based task runner, with Tailwind and a README that lists Vercel, Netlify, GitHub Pages and Docker deployment. I read frontend/src/pages/chat/index.tsx, 279 lines, and the login page. I did not build it.
What it does
The chat page keeps the input in state, creates a conversation on the first message, sends the message, and starts a streaming handler when a conversation id exists. Enter sends and Shift Enter adds a new line. It scrolls to the newest message, shows four suggested prompts, and the send button turns into a Stop label while a send is in flight. The login page validates that a username and a password of at least 6 characters are present before calling login.
Where it goes wrong
In handleSendMessage the input is cleared before the send is awaited, and the catch block only calls console.error. If the request fails, the person sees nothing and the text they typed is gone. The Stop label also appears while sending but the button is disabled in the same state, as far as I can read, so it cannot stop anything.
The bigger issue is structure. The chat page imports Layout, Button, LoadingScreen, the chat store and the utils module. The frontend/src folder in the repo has 13 files, and none of those five paths exist in it. The repo root has its own src folder with different files. So at this commit the chat page does not look buildable on its own, and I cannot say whether the pieces live somewhere else or were never committed.
What I would change
My opinion: restore the input text when a send fails and show an error in the thread. Either wire Stop to an abort call or remove the label. Pick one source folder and delete the other, then make the build run in CI so a missing import fails a check instead of a reader. This repo grew from a template, and the README describes more than the code in the folder supports.