mirror of
https://github.com/hanzoai/chat.git
synced 2026-08-07 02:51:52 +00:00
main
`CHAT_CODE_API_KEY` was the browser half of the plumbing the previous commit removed on the server: a form that stored a per-user plugin credential for a shared service key no user ever held, in front of a tool that now runs under the signed-in user's own Hanzo IAM bearer. Gone: useAuthCodeTool, useCodeApiKeyForm, SidePanel/Agents/Code/ApiKeyDialog, and the four places that mounted them. Each had grown a branch that can no longer be reached now that verifyToolAuth answers SYSTEM_DEFINED for execute_code: - ToolsDropdown's gear was `codeAuthData?.message !== SYSTEM_DEFINED`, i.e. never. - RunCode opened the dialog when `!isAuthenticated`, which is never — and the client-side gate went with it: a caller with no session should get the server's honest refusal, not a form asking for a credential that does not exist. - The agent builder's checkbox had a third state where an unchecked box opened the dialog instead of checking itself. It is a checkbox now. - BadgeRowContext passed the form's `setIsDialogOpen` into useToolToggle, where the parameter is optional; unset, the toggle simply toggles. Verified in a browser against a real hanzo.id session, not inferred from types: the Tools menu still lists File Search / Web Search / Code Interpreter, the toggle still arms the tool, and both execution paths still return real output from a real pod (below). `tsc --noEmit` is 814 errors against the 817 baseline in CLAUDE.md — three fewer, none new. The credentials spec's pin of the deleted `[undefined]` guard goes too, replaced by two tests that state what loadAuthValues is now for. Its other six failures assert a `user_provided` sentinel filter the source has never implemented and are untouched by this.
…
…
…
…
…
…
…
…
…
…
…
Hanzo Chat
The chat surface of the Hanzo AI cloud: multi-model chat with agents, tools, and retrieval, running on Hanzo's backend. Live at hanzo.chat.
Hanzo Chat is a sibling to hanzo.app (the app builder) and the Hanzo console (admin). All inference, code execution, and web search route through the unified Hanzo API at api.hanzo.ai/v1, and sign-in is federated to Hanzo IAM (hanzo.id).
Features
- Multi-model chat — the Zen model family and other frontier models, served through
api.hanzo.ai. - Agents — build agents in the thread, or run your Hanzo Cloud agents (
/v1/agents) with an/agentcommand or@mention. - MCP tools — connect Model Context Protocol servers for tool use.
- RAG — chat over your own files and documents.
- Web search — grounded answers via Hanzo web search.
- Code interpreter — run code in a sandboxed runtime.
- Image generation — generate images inline.
- Guest chat — try a free Zen model with no account (optional, off by default).
Requirements
- Node.js 24 (see
.nvmrc) - pnpm 10
- A Hanzo API key — get one at hanzo.ai/dashboard
Quick start (Docker)
git clone https://github.com/hanzoai/chat.git
cd chat
cp .env.example .env # set HANZO_API_KEY
make up
Open http://localhost:3080. make up starts the full stack (app, MongoDB, Meilisearch) from compose.yml; make down stops it.
Development
pnpm install # install workspace dependencies
pnpm build:packages # build the shared workspace packages
pnpm backend:dev # API server on :3080 (nodemon)
pnpm frontend:dev # Vite client dev server (second terminal)
Tests and checks:
pnpm test:all # all workspace tests
pnpm e2e # Playwright end-to-end tests
pnpm lint # ESLint
pnpm format # Prettier
Configuration
Secrets live in .env; the model catalog and endpoints live in chat.yaml (copy chat.example.yaml). Key variables:
HANZO_API_KEY= # Hanzo API key — inference, tools, search
MONGO_URI= # MongoDB connection — chat history, users
JWT_SECRET= # session token signing
CREDS_KEY= # credential encryption
CREDS_IV=
Sign-in is federated to Hanzo IAM over OpenID Connect (OPENID_ISSUER=https://hanzo.id, client hanzo-chat).
Workspace
api/ Express backend (:3080) — routes, controllers, Mongoose models
client/ React frontend (Vite)
packages/ data-provider · data-schemas · api · client · agents · mcp
Documentation
- Docs: https://hanzo.ai/docs/chat
- Deployment, IAM, and platform notes:
docs/ - Issues: https://github.com/hanzoai/chat/issues
License
Languages
TypeScript
68.3%
JavaScript
22%
Python
6.4%
HTML
2.1%
CSS
0.5%
Other
0.6%