diff --git a/README.md b/README.md index 6f2e9d7f..d12908cd 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,14 @@ Deploy [nanobot](https://github.com/HKUDS/nanobot) — a lightweight, self-hosta One Render web service running nanobot's `gateway` and its bundled WebUI. You chat with the agent from your browser; it can use tools (web search/fetch, filesystem, shell, MCP servers) and remembers past sessions on a persistent disk. Access is gated by a secret you set. +## Cost expectations + +This is not a free deploy. Expect: + +- **Render Starter plan** — ~$7/mo for the web service. +- **1 GB persistent disk** — ~$0.25/mo for sessions and memory. +- **Anthropic API usage** — billed separately by Anthropic based on your agent's LLM calls. + ## Deploy 1. **Generate a `NANOBOT_WEB_TOKEN`** — this is the access secret for your WebUI. Create a strong random value with one of: @@ -31,7 +39,7 @@ Render prompts for these on deploy (both are `sync: false`, so no secret is ever | Variable | What it's for | Where to get it | |---|---|---| -| `ANTHROPIC_API_KEY` | Powers the agent's LLM calls (default model `anthropic/claude-opus-4-5`). | [console.anthropic.com](https://console.anthropic.com/settings/keys) | +| `ANTHROPIC_API_KEY` | Powers the agent's LLM calls (default model `anthropic/claude-opus-4-8`). | [console.anthropic.com](https://console.anthropic.com/settings/keys) | | `NANOBOT_WEB_TOKEN` | The access secret for the WebUI — the only gate on your public agent. | Generate it yourself (see step 1 above): `openssl rand -hex 32` or `python3 -c "import secrets; print(secrets.token_hex(32))"`. | `PORT` is set for you in the Blueprint. Configuration lives in [`render-config.json`](./render-config.json); the two secrets are referenced there as `${ANTHROPIC_API_KEY}` and `${NANOBOT_WEB_TOKEN}` and resolved at startup. @@ -50,6 +58,27 @@ Edit [`render-config.json`](./render-config.json) to change the model, provider, For everything nanobot can do — chat channels (Telegram, Discord, Slack, …), MCP, skills, memory — see the upstream project: **[HKUDS/nanobot](https://github.com/HKUDS/nanobot)** and its [docs](https://nanobot.wiki). +## Troubleshooting + +Logs live in the Render dashboard → your service → **Logs**. Start there for any failure. + +- **Deploy fails or the service won't go Live.** The most common cause is a missing or mistyped `ANTHROPIC_API_KEY`. Check it under the service's **Environment** tab, then trigger a redeploy. The logs also print `[entrypoint] …` lines showing how the container started. +- **Can't sign in to the WebUI.** The token prompt expects the exact `NANOBOT_WEB_TOKEN` you set on deploy — paste it verbatim (no surrounding spaces). If you've lost it, set a new value under **Environment**, redeploy, and sign in with the new one. +- **Chat connects but the agent doesn't respond.** Usually an Anthropic-side issue — an invalid key or exhausted credit. The logs will show the provider error. + +## Updating from upstream + +This repo is a fork of [HKUDS/nanobot](https://github.com/HKUDS/nanobot). To pull in new nanobot releases: + +```bash +git remote add upstream https://github.com/HKUDS/nanobot.git # once +git fetch upstream +git merge upstream/main +git push # your fork +``` + +Render auto-deploys the new commit. If you ever re-sync the Blueprint, confirm the service's **Docker Command** still routes through `/usr/local/bin/entrypoint.sh` — it's defined in [`render.yaml`](./render.yaml), so a clean sync preserves it. + --- Built on [nanobot](https://github.com/HKUDS/nanobot) (MIT). This repo is a Render deploy template — see [`render.yaml`](./render.yaml). diff --git a/entrypoint.sh b/entrypoint.sh index d801326e..ef2c2bf1 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -6,16 +6,16 @@ echo "[entrypoint] starting as $(id)" dir="$HOME/.nanobot" -mkdir -p "$dir" 2>&1 || echo "[entrypoint] warning: mkdir $dir failed" +mkdir -p "$dir" || echo "[entrypoint] warning: mkdir $dir failed" if [ "$(id -u)" != "0" ]; then # Already non-root (platform forced a user). Can't chown; just run. - echo "[entrypoint] not root — running app as $(id -un 2>/dev/null || id -u)" + echo "[entrypoint] not root — running app as $(id -un)" exec nanobot "$@" fi # Running as root: make the mounted disk writable by the app user. -chown -R nanobot:nanobot "$dir" 2>&1 || echo "[entrypoint] warning: chown $dir failed" +chown -R nanobot:nanobot "$dir" || echo "[entrypoint] warning: chown $dir failed" # Drop to the non-root user if the runtime grants the capability to do so # (setpriv needs CAP_SETUID/CAP_SETGID). Otherwise stay root so the app can diff --git a/render-config.json b/render-config.json index 7c53120b..5fdc3510 100644 --- a/render-config.json +++ b/render-config.json @@ -1,7 +1,7 @@ { "agents": { "defaults": { - "model": "anthropic/claude-opus-4-5", + "model": "anthropic/claude-opus-4-8", "provider": "auto" } },