docs: remove manual paragraph line wraps (#6131)
* docs: remove manual paragraph line wraps * docs: preserve GitHub alert marker line breaks
This commit is contained in:
1 parent
36c36a1324
commit
50256940be
58 files changed
+848
-3130
No files matched your search
@@ -1,8 +1,6 @@
|
||||
# How AI Agent Memory Works in nanobot
|
||||
|
||||
This guide explains how to use nanobot's long-term AI agent memory: session
|
||||
history, compressed archives, durable memory files, Dream consolidation, and
|
||||
Git-backed memory changes.
|
||||
This guide explains how to use nanobot's long-term AI agent memory: session history, compressed archives, durable memory files, Dream consolidation, and Git-backed memory changes.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -13,10 +11,7 @@ Git-backed memory changes.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use memory when an agent should remember stable preferences, project facts,
|
||||
decisions, and recurring context across sessions. Do not use memory as a dumping
|
||||
ground for every raw transcript; nanobot separates short-term messages from
|
||||
curated durable knowledge.
|
||||
Use memory when an agent should remember stable preferences, project facts, decisions, and recurring context across sessions. Do not use memory as a dumping ground for every raw transcript; nanobot separates short-term messages from curated durable knowledge.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -40,8 +35,7 @@ Inspect recent memory changes:
|
||||
/dream-log
|
||||
```
|
||||
|
||||
The exact files live in the active workspace, usually under
|
||||
`~/.nanobot/workspace/`.
|
||||
The exact files live in the active workspace, usually under `~/.nanobot/workspace/`.
|
||||
|
||||
## Production notes
|
||||
|
||||
@@ -53,15 +47,13 @@ The exact files live in the active workspace, usually under
|
||||
## Security notes
|
||||
|
||||
- Memory files may contain sensitive user or project facts.
|
||||
- Avoid sharing workspaces without reviewing `SOUL.md`, `USER.md`, and
|
||||
`memory/MEMORY.md`.
|
||||
- Avoid sharing workspaces without reviewing `SOUL.md`, `USER.md`, and `memory/MEMORY.md`.
|
||||
- Use separate workspaces for personal and team contexts.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If memory feels stale, run `/dream` and inspect `/dream-log`.
|
||||
- If memory changed incorrectly, use `/dream-restore` to inspect and restore
|
||||
previous versions.
|
||||
- If memory changed incorrectly, use `/dream-restore` to inspect and restore previous versions.
|
||||
- If a new session lacks context, confirm it uses the same workspace.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# How to Use an AI Agent WebUI with nanobot
|
||||
|
||||
nanobot includes a browser WebUI for persistent chat sessions, visible agent
|
||||
activity, workspace controls, Apps, MCP presets, Skills, settings, and
|
||||
Automations.
|
||||
nanobot includes a browser WebUI for persistent chat sessions, visible agent activity, workspace controls, Apps, MCP presets, Skills, settings, and Automations.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -13,9 +11,7 @@ Automations.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use the WebUI when you want a local AI agent interface that is easier to operate
|
||||
than a terminal, especially for project work, file attachments, model switching,
|
||||
workspace selection, Apps, Skills, and scheduled automations.
|
||||
Use the WebUI when you want a local AI agent interface that is easier to operate than a terminal, especially for project work, file attachments, model switching, workspace selection, Apps, Skills, and scheduled automations.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -25,8 +21,7 @@ nanobot onboard --wizard
|
||||
nanobot agent -m "Hello!"
|
||||
```
|
||||
|
||||
The published wheel already includes the WebUI bundle. You only need the
|
||||
`webui/` source directory when changing the frontend.
|
||||
The published wheel already includes the WebUI bundle. You only need the `webui/` source directory when changing the frontend.
|
||||
|
||||
## Minimal working example
|
||||
|
||||
@@ -34,37 +29,27 @@ The published wheel already includes the WebUI bundle. You only need the
|
||||
nanobot webui
|
||||
```
|
||||
|
||||
The launcher checks setup, enables the local WebSocket channel after
|
||||
confirmation, starts the gateway, and opens the browser.
|
||||
The launcher checks setup, enables the local WebSocket channel after confirmation, starts the gateway, and opens the browser.
|
||||
|
||||
When nanobot edits a file, the WebUI activity timeline can show the changed
|
||||
line counts, a unified diff, and an **Open file** action for a read-only
|
||||
preview. File previews use the chat's current workspace access mode: restricted
|
||||
access stays inside the selected workspace, while Full Access can preview files
|
||||
outside the workspace when the gateway allows it.
|
||||
When nanobot edits a file, the WebUI activity timeline can show the changed line counts, a unified diff, and an **Open file** action for a read-only preview. File previews use the chat's current workspace access mode: restricted access stays inside the selected workspace, while Full Access can preview files outside the workspace when the gateway allows it.
|
||||
|
||||
## Production notes
|
||||
|
||||
- Use `nanobot gateway --background` when you do not want to keep a terminal open, then open the
|
||||
configured WebUI URL in a browser.
|
||||
- Use `nanobot gateway status`, `logs`, `restart`, and `stop` to manage a
|
||||
background gateway.
|
||||
- If you expose the WebUI beyond localhost, set a token issue secret and review
|
||||
workspace/tool access.
|
||||
- Use `nanobot gateway --background` when you do not want to keep a terminal open, then open the configured WebUI URL in a browser.
|
||||
- Use `nanobot gateway status`, `logs`, `restart`, and `stop` to manage a background gateway.
|
||||
- If you expose the WebUI beyond localhost, set a token issue secret and review workspace/tool access.
|
||||
|
||||
## Security notes
|
||||
|
||||
- The first-run WebUI path binds to `127.0.0.1` by default.
|
||||
- Do not expose the WebUI on a LAN or public host without an intentional access
|
||||
model.
|
||||
- Do not expose the WebUI on a LAN or public host without an intentional access model.
|
||||
- Keep file and shell tools scoped to the workspace before inviting other users.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- The WebUI is served by the WebSocket channel on port `8765` by default.
|
||||
- The gateway health endpoint is separate from the browser UI.
|
||||
- If the page opens but messages fail, check provider setup with
|
||||
`nanobot agent -m "Hello!"`.
|
||||
- If the page opens but messages fail, check provider setup with `nanobot agent -m "Hello!"`.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# How to Build a Personal AI Agent with nanobot
|
||||
|
||||
This guide builds a personal AI agent you can run locally, talk to from the
|
||||
terminal or browser, and later connect to chat apps, memory, tools, and
|
||||
automations.
|
||||
This guide builds a personal AI agent you can run locally, talk to from the terminal or browser, and later connect to chat apps, memory, tools, and automations.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -13,18 +11,11 @@ automations.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use this when you want a personal AI agent that you control rather than a hosted
|
||||
chat-only interface. nanobot is useful when the agent needs local workspace
|
||||
access, tool calls, session history, memory, scheduled work, or chat app
|
||||
delivery.
|
||||
Use this when you want a personal AI agent that you control rather than a hosted chat-only interface. nanobot is useful when the agent needs local workspace access, tool calls, session history, memory, scheduled work, or chat app delivery.
|
||||
|
||||
## Install
|
||||
|
||||
Follow [Quick Start](../quick-start.md) to install nanobot using the recommended
|
||||
method for your operating system and configure one model. Return here after
|
||||
you receive the first reply. If terminals and config files are new to you, use
|
||||
[Start Without Technical Background](../start-without-technical-background.md)
|
||||
instead.
|
||||
Follow [Quick Start](../quick-start.md) to install nanobot using the recommended method for your operating system and configure one model. Return here after you receive the first reply. If terminals and config files are new to you, use [Start Without Technical Background](../start-without-technical-background.md) instead.
|
||||
|
||||
## Minimal working example
|
||||
|
||||
@@ -40,35 +31,27 @@ Then open the browser workbench:
|
||||
nanobot webui
|
||||
```
|
||||
|
||||
The WebUI starts the local gateway, opens a browser, and keeps persistent chat
|
||||
sessions for longer work.
|
||||
The WebUI starts the local gateway, opens a browser, and keeps persistent chat sessions for longer work.
|
||||
|
||||
## Production notes
|
||||
|
||||
- Keep one workspace per project or personal context.
|
||||
- Use `modelPresets` when you want stable names for fast, deep, local, or
|
||||
fallback models.
|
||||
- Keep `nanobot gateway` running for WebUI, chat apps, automations, and the
|
||||
WebSocket channel.
|
||||
- Use the Python SDK or OpenAI-compatible API when another program should call
|
||||
the agent.
|
||||
- Use `modelPresets` when you want stable names for fast, deep, local, or fallback models.
|
||||
- Keep `nanobot gateway` running for WebUI, chat apps, automations, and the WebSocket channel.
|
||||
- Use the Python SDK or OpenAI-compatible API when another program should call the agent.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Do not store API keys directly in shared files; use environment variables.
|
||||
- Prefer chat app pairing for first setup. Use `allowFrom` only for static
|
||||
allowlists, and keep those lists narrow.
|
||||
- Enable workspace restriction before exposing file or shell tools to other
|
||||
users.
|
||||
- Prefer chat app pairing for first setup. Use `allowFrom` only for static allowlists, and keep those lists narrow.
|
||||
- Enable workspace restriction before exposing file or shell tools to other users.
|
||||
- Use a separate workspace for experiments that can modify files.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- `nanobot status` shows the config path, workspace path, and active model.
|
||||
- If `nanobot agent -m "Hello!"` fails, fix provider setup before opening the
|
||||
WebUI or chat apps.
|
||||
- If the WebUI opens but does not answer, check gateway logs and provider
|
||||
credentials.
|
||||
- If `nanobot agent -m "Hello!"` fails, fix provider setup before opening the WebUI or chat apps.
|
||||
- If the WebUI opens but does not answer, check gateway logs and provider credentials.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# How to Connect an AI Agent to Chat Apps with nanobot
|
||||
|
||||
nanobot can run as a self-hosted chatbot or AI agent in Telegram, Discord,
|
||||
Slack, WeChat, Email, Mattermost, and other chat apps. The gateway receives chat
|
||||
messages, runs the agent, and sends replies back to the same channel.
|
||||
nanobot can run as a self-hosted chatbot or AI agent in Telegram, Discord, Slack, WeChat, Email, Mattermost, and other chat apps. The gateway receives chat messages, runs the agent, and sends replies back to the same channel.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -13,8 +11,7 @@ messages, runs the agent, and sends replies back to the same channel.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use chat apps when the agent should live where users already communicate:
|
||||
private DMs, team channels, group chats, email threads, or bot workspaces.
|
||||
Use chat apps when the agent should live where users already communicate: private DMs, team channels, group chats, email threads, or bot workspaces.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -69,23 +66,19 @@ Use the full [Chat Apps reference](../chat-apps.md) when you manage `config.json
|
||||
- Keep the gateway running as a service for always-on chat apps.
|
||||
- Use mention-only group policies before opening a bot to busy channels.
|
||||
- Use one channel at a time while debugging.
|
||||
- Prefer DMs for first tests; pairing only works in DMs, and group chats add
|
||||
permissions and routing behavior.
|
||||
- Prefer DMs for first tests; pairing only works in DMs, and group chats add permissions and routing behavior.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Prefer pairing or explicit allowlists; do not use `allowFrom: ["*"]` outside
|
||||
an intentional sandbox.
|
||||
- Prefer pairing or explicit allowlists; do not use `allowFrom: ["*"]` outside an intentional sandbox.
|
||||
- Rotate bot tokens if they are pasted into logs or shared files.
|
||||
- Review file, shell, and web tool access before inviting other users.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If `nanobot channels status` does not show the channel, the config key or
|
||||
optional dependency is likely missing.
|
||||
- If `nanobot channels status` does not show the channel, the config key or optional dependency is likely missing.
|
||||
- If the first DM returns a pairing code, approve the pending request in the WebUI or use `/pairing approve <code>` from an authorized chat.
|
||||
- If messages do not arrive, run `nanobot gateway --verbose` and compare
|
||||
platform credentials, event permissions, and allow lists.
|
||||
- If messages do not arrive, run `nanobot gateway --verbose` and compare platform credentials, event permissions, and allow lists.
|
||||
- If group replies are unexpected, review that channel's group policy.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# How to Configure Langfuse Observability for nanobot
|
||||
|
||||
nanobot can trace supported OpenAI-compatible provider calls through Langfuse's
|
||||
OpenAI SDK wrapper.
|
||||
nanobot can trace supported OpenAI-compatible provider calls through Langfuse's OpenAI SDK wrapper.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -11,8 +10,7 @@ OpenAI SDK wrapper.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use Langfuse when you need observability for model requests, latency, errors,
|
||||
cost, or prompt behavior during development or production operation.
|
||||
Use Langfuse when you need observability for model requests, latency, errors, cost, or prompt behavior during development or production operation.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -55,20 +53,17 @@ nanobot agent -m "Hello!"
|
||||
- Langfuse is configured with environment variables, not `config.json`.
|
||||
- Start services from an environment that exports the same variables.
|
||||
- Add tracing after the provider works; it should not be the first setup step.
|
||||
- Native providers that do not use the OpenAI-compatible client path may not
|
||||
produce Langfuse OpenAI-wrapper traces.
|
||||
- Native providers that do not use the OpenAI-compatible client path may not produce Langfuse OpenAI-wrapper traces.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Treat Langfuse projects as observability stores for sensitive prompts and
|
||||
outputs.
|
||||
- Treat Langfuse projects as observability stores for sensitive prompts and outputs.
|
||||
- Use separate projects for personal, staging, and production traffic.
|
||||
- Keep Langfuse keys out of committed service files.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If no traces appear, confirm the service process sees the environment
|
||||
variables.
|
||||
- If no traces appear, confirm the service process sees the environment variables.
|
||||
- Confirm the provider path is OpenAI-compatible.
|
||||
- Run one local `nanobot agent -m "Hello!"` call before debugging service logs.
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# How to Configure MCP Tools in nanobot
|
||||
|
||||
This guide adds an MCP server to nanobot so the agent can use external tools
|
||||
through the Model Context Protocol.
|
||||
This guide adds an MCP server to nanobot so the agent can use external tools through the Model Context Protocol.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -11,8 +10,7 @@ through the Model Context Protocol.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use MCP when the capability you need already exists as an MCP server, or when
|
||||
you want external tools to be managed outside nanobot core.
|
||||
Use MCP when the capability you need already exists as an MCP server, or when you want external tools to be managed outside nanobot core.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -22,20 +20,14 @@ nanobot onboard --wizard
|
||||
nanobot agent -m "Hello!"
|
||||
```
|
||||
|
||||
Install the MCP server runtime separately. Many examples use `npx`, `uvx`, or a
|
||||
remote HTTP endpoint.
|
||||
Install the MCP server runtime separately. Many examples use `npx`, `uvx`, or a remote HTTP endpoint.
|
||||
|
||||
## Minimal working example
|
||||
|
||||
For local interactive setup:
|
||||
|
||||
1. Run `nanobot webui` and open **Apps**.
|
||||
2. Choose a known MCP server preset, or add a custom stdio, HTTP, or SSE server.
|
||||
For a custom OAuth server, choose **OAuth** under **Authentication**, save it,
|
||||
and click **Connect**. Presets such as Xmind, Notion, and Linear go straight to
|
||||
**Connect**. Approve access in the browser window. HTTPS and localhost WebUIs
|
||||
return automatically. From a remote plain-HTTP WebUI, copy the complete
|
||||
localhost callback URL from the browser address bar and paste it into nanobot.
|
||||
2. Choose a known MCP server preset, or add a custom stdio, HTTP, or SSE server. For a custom OAuth server, choose **OAuth** under **Authentication**, save it, and click **Connect**. Presets such as Xmind, Notion, and Linear go straight to **Connect**. Approve access in the browser window. HTTPS and localhost WebUIs return automatically. From a remote plain-HTTP WebUI, copy the complete localhost callback URL from the browser address bar and paste it into nanobot.
|
||||
3. Limit the enabled tools when the server exposes more than the task needs.
|
||||
4. Save and restart when prompted.
|
||||
5. Mention the connected MCP server with `@` in the next message and ask for a small test action.
|
||||
@@ -63,26 +55,22 @@ Restart nanobot and ask a question that requires the MCP tool.
|
||||
- Prefer `enabledTools` over exposing every tool by default.
|
||||
- Use `toolTimeout` for slow MCP operations.
|
||||
- Use HTTP MCP only for endpoints you trust.
|
||||
- For deployment-managed OAuth servers, set `auth` to `oauth` and complete the
|
||||
browser connection from **Apps → MCP**.
|
||||
- For deployment-managed OAuth servers, set `auth` to `oauth` and complete the browser connection from **Apps → MCP**.
|
||||
- Keep MCP server commands stable and versioned in deployment docs or scripts.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Stdio MCP starts a local process; review the command before enabling it.
|
||||
- HTTP/SSE MCP uses nanobot's SSRF guard, including OAuth discovery, registration,
|
||||
token exchange, and redirects.
|
||||
- HTTP/SSE MCP uses nanobot's SSRF guard, including OAuth discovery, registration, token exchange, and redirects.
|
||||
- OAuth credentials live in the nanobot data directory, not in `config.json`.
|
||||
- Allow private HTTP MCP hosts only with narrow `tools.ssrfWhitelist` CIDRs.
|
||||
- Do not place secrets in command arguments when environment variables or
|
||||
headers can be used.
|
||||
- Do not place secrets in command arguments when environment variables or headers can be used.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Run the MCP command outside nanobot first.
|
||||
- Start `nanobot gateway --verbose` and inspect tool registration logs.
|
||||
- If an HTTP MCP URL is blocked, check whether it points to loopback or a
|
||||
private address that needs explicit allowlisting.
|
||||
- If an HTTP MCP URL is blocked, check whether it points to loopback or a private address that needs explicit allowlisting.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# How to Configure Model Fallback in nanobot
|
||||
|
||||
Model fallback lets nanobot try a primary model first, then fall back to one or
|
||||
more named presets when the primary provider fails or rate-limits.
|
||||
Model fallback lets nanobot try a primary model first, then fall back to one or more named presets when the primary provider fails or rate-limits.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -11,8 +10,7 @@ more named presets when the primary provider fails or rate-limits.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use fallback when you want better reliability across rate limits, provider
|
||||
outages, local model downtime, or cost-sensitive routing.
|
||||
Use fallback when you want better reliability across rate limits, provider outages, local model downtime, or cost-sensitive routing.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -26,8 +24,7 @@ Verify each provider works before adding it as a fallback.
|
||||
|
||||
## Minimal working example
|
||||
|
||||
Merge this shape into `~/.nanobot/config.json` and replace provider/model names
|
||||
with ones you control:
|
||||
Merge this shape into `~/.nanobot/config.json` and replace provider/model names with ones you control:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -56,21 +53,12 @@ with ones you control:
|
||||
}
|
||||
```
|
||||
|
||||
String entries in `fallbackModels` are preset names, not raw model IDs.
|
||||
Replace the placeholder model IDs with currently supported model IDs from your
|
||||
provider. The [Provider Cookbook](../provider-cookbook.md) has concrete recipes
|
||||
for common providers.
|
||||
String entries in `fallbackModels` are preset names, not raw model IDs. Replace the placeholder model IDs with currently supported model IDs from your provider. The [Provider Cookbook](../provider-cookbook.md) has concrete recipes for common providers.
|
||||
|
||||
## Production notes
|
||||
|
||||
- In the WebUI, a reply produced by a named fallback preset shows its provider
|
||||
logo and preset name next to the reply timestamp. Hover, focus, or click the
|
||||
badge for an explanation. The composer still shows your selected preset;
|
||||
primary replies have no fallback badge. Saved replies retain the name used
|
||||
for that invocation, even after a preset is renamed or deleted. Older replies
|
||||
without recorded attribution and unnamed inline fallback objects are not labeled.
|
||||
- Keep fallback context windows realistic; smaller fallback windows constrain
|
||||
how much context can fit.
|
||||
- In the WebUI, a reply produced by a named fallback preset shows its provider logo and preset name next to the reply timestamp. Hover, focus, or click the badge for an explanation. The composer still shows your selected preset; primary replies have no fallback badge. Saved replies retain the name used for that invocation, even after a preset is renamed or deleted. Older replies without recorded attribution and unnamed inline fallback objects are not labeled.
|
||||
- Keep fallback context windows realistic; smaller fallback windows constrain how much context can fit.
|
||||
- Put cheaper or faster fallbacks before expensive ones when acceptable.
|
||||
- Use `/model <preset>` for runtime switching without editing config.
|
||||
- Keep preset names human-readable; the same name appears in the WebUI and `/model`.
|
||||
@@ -83,12 +71,9 @@ for common providers.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If a fallback never triggers, confirm the primary error is treated as
|
||||
retryable/fallbackable.
|
||||
- If startup fails, check that each fallback string matches a key under
|
||||
`modelPresets`.
|
||||
- If output is truncated after fallback, review `maxTokens` and
|
||||
`contextWindowTokens`.
|
||||
- If a fallback never triggers, confirm the primary error is treated as retryable/fallbackable.
|
||||
- If startup fails, check that each fallback string matches a key under `modelPresets`.
|
||||
- If output is truncated after fallback, review `maxTokens` and `contextWindowTokens`.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
# How to Improve Ollama Tool-Calling Prompt Cache Reuse in nanobot
|
||||
|
||||
Some Ollama model templates move or remove tool definitions as a conversation
|
||||
switches between user, assistant, and tool messages. nanobot can send a correct
|
||||
append-only chat request while the model template still renders a different token
|
||||
prefix. On slower local hardware, re-evaluating that prefix can add tens of seconds
|
||||
to an otherwise simple tool-using turn.
|
||||
Some Ollama model templates move or remove tool definitions as a conversation switches between user, assistant, and tool messages. nanobot can send a correct append-only chat request while the model template still renders a different token prefix. On slower local hardware, re-evaluating that prefix can add tens of seconds to an otherwise simple tool-using turn.
|
||||
|
||||
This guide shows how to diagnose that specific pattern and create a derived
|
||||
`llama3.1:8b` tag with a prefix-stable tool template. It does not modify nanobot or
|
||||
overwrite the original Ollama model.
|
||||
This guide shows how to diagnose that specific pattern and create a derived `llama3.1:8b` tag with a prefix-stable tool template. It does not modify nanobot or overwrite the original Ollama model.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -22,18 +16,14 @@ Use this guide when all of the following are true:
|
||||
|
||||
- direct Ollama responses are reasonably fast;
|
||||
- nanobot becomes slow after the model calls a tool;
|
||||
- Ollama logs show a long main prompt, a much shorter tool follow-up, and low
|
||||
initial cache reuse on the next main prompt;
|
||||
- the model is `llama3.1:8b` with a template that renders concrete tools only for
|
||||
the final user message.
|
||||
- Ollama logs show a long main prompt, a much shorter tool follow-up, and low initial cache reuse on the next main prompt;
|
||||
- the model is `llama3.1:8b` with a template that renders concrete tools only for the final user message.
|
||||
|
||||
Do not apply this template to another model family without checking that model's
|
||||
tool-call format first.
|
||||
Do not apply this template to another model family without checking that model's tool-call format first.
|
||||
|
||||
## Diagnose the rendered prompt
|
||||
|
||||
Stop any existing Ollama process, then start a single-slot debug server. A single
|
||||
slot makes the cache sequence easier to read.
|
||||
Stop any existing Ollama process, then start a single-slot debug server. A single slot makes the cache sequence easier to read.
|
||||
|
||||
**macOS or Linux**
|
||||
|
||||
@@ -53,8 +43,7 @@ $env:OLLAMA_DEBUG = "1"
|
||||
ollama serve
|
||||
```
|
||||
|
||||
In another terminal, use a fresh session and explicitly request a tool so both
|
||||
turns exercise the agent loop:
|
||||
In another terminal, use a fresh session and explicitly request a tool so both turns exercise the agent loop:
|
||||
|
||||
```bash
|
||||
nanobot agent --session cli:ollama-cache-check \
|
||||
@@ -63,9 +52,7 @@ nanobot agent --session cli:ollama-cache-check \
|
||||
--message "Use the exec tool to calculate 4+7, then answer"
|
||||
```
|
||||
|
||||
In the Ollama output, find each `new prompt` line and the first
|
||||
`cached n_tokens` line that follows it. Later increasing `cached n_tokens` lines
|
||||
are prompt-evaluation progress, not additional initial cache hits.
|
||||
In the Ollama output, find each `new prompt` line and the first `cached n_tokens` line that follows it. Later increasing `cached n_tokens` lines are prompt-evaluation progress, not additional initial cache hits.
|
||||
|
||||
A cache-unfriendly tool template may produce a pattern like this:
|
||||
|
||||
@@ -75,18 +62,13 @@ turn 1 tool follow-up: 3713 / 3758 initially cached
|
||||
turn 2 main: 3767 / 8519 initially cached
|
||||
```
|
||||
|
||||
The cache is working, but the next main request can reuse only the shorter prompt.
|
||||
Hardware throughput determines how expensive the remaining evaluation is.
|
||||
The cache is working, but the next main request can reuse only the shorter prompt. Hardware throughput determines how expensive the remaining evaluation is.
|
||||
|
||||
To inspect the API request bodies as well, add
|
||||
`OLLAMA_DEBUG_LOG_REQUESTS=1` before starting Ollama. These logs can contain system
|
||||
prompts, workspace context, and user messages. Keep them local and disable request
|
||||
logging after diagnosis.
|
||||
To inspect the API request bodies as well, add `OLLAMA_DEBUG_LOG_REQUESTS=1` before starting Ollama. These logs can contain system prompts, workspace context, and user messages. Keep them local and disable request logging after diagnosis.
|
||||
|
||||
## Why this happens with the stock template
|
||||
|
||||
The tested `llama3.1:8b` template conditionally expands the tool definitions inside
|
||||
a user message:
|
||||
The tested `llama3.1:8b` template conditionally expands the tool definitions inside a user message:
|
||||
|
||||
```gotemplate
|
||||
{{- if and $.Tools $last }}
|
||||
@@ -94,19 +76,13 @@ a user message:
|
||||
{{- end }}
|
||||
```
|
||||
|
||||
The first request ends with a user message, so the tools are rendered there. After
|
||||
nanobot appends an assistant tool call and its result, that user message is no
|
||||
longer last, so the same API request history renders without the concrete tool
|
||||
block. On the next user turn, the tools reappear at a new position.
|
||||
The first request ends with a user message, so the tools are rendered there. After nanobot appends an assistant tool call and its result, that user message is no longer last, so the same API request history renders without the concrete tool block. On the next user turn, the tools reappear at a new position.
|
||||
|
||||
This is a model-template behavior. At the API boundary, nanobot continues to append
|
||||
the assistant tool call and tool result and sends the same tool definitions.
|
||||
This is a model-template behavior. At the API boundary, nanobot continues to append the assistant tool call and tool result and sends the same tool definitions.
|
||||
|
||||
## Create a prefix-stable derived model
|
||||
|
||||
Create `PrefixStable.Modelfile` with the content below. The template keeps concrete
|
||||
tool definitions in the system block, where they remain in the same position across
|
||||
user and tool messages.
|
||||
Create `PrefixStable.Modelfile` with the content below. The template keeps concrete tool definitions in the system block, where they remain in the same position across user and tool messages.
|
||||
|
||||
```dockerfile
|
||||
FROM llama3.1:8b
|
||||
@@ -164,8 +140,7 @@ ollama create llama3.1:8b-prefix-stable-v1 -f PrefixStable.Modelfile
|
||||
ollama list
|
||||
```
|
||||
|
||||
Ollama reuses the existing model layers. The new tag adds a small template and
|
||||
manifest instead of copying the base weights.
|
||||
Ollama reuses the existing model layers. The new tag adds a small template and manifest instead of copying the base weights.
|
||||
|
||||
## Select the derived model in nanobot
|
||||
|
||||
@@ -205,15 +180,11 @@ nanobot agent --session cli:ollama-stable-check \
|
||||
--message "Use the exec tool to calculate 4+7, then answer"
|
||||
```
|
||||
|
||||
In one controlled test with Ollama 0.32.1, `llama3.1:8b`, and one slot, the second
|
||||
main request improved from `3767 / 8519` initially cached (44.22%) to
|
||||
`8505 / 8520` (99.82%). The number of re-evaluated tokens fell from 4752 to 15.
|
||||
Treat these numbers as a diagnostic example, not a performance guarantee.
|
||||
In one controlled test with Ollama 0.32.1, `llama3.1:8b`, and one slot, the second main request improved from `3767 / 8519` initially cached (44.22%) to `8505 / 8520` (99.82%). The number of re-evaluated tokens fell from 4752 to 15. Treat these numbers as a diagnostic example, not a performance guarantee.
|
||||
|
||||
## Roll back
|
||||
|
||||
Switch `agents.defaults.modelPreset` back to the original preset. When no config
|
||||
uses the derived tag, remove it with:
|
||||
Switch `agents.defaults.modelPreset` back to the original preset. When no config uses the derived tag, remove it with:
|
||||
|
||||
```bash
|
||||
ollama rm llama3.1:8b-prefix-stable-v1
|
||||
@@ -225,10 +196,8 @@ Removing the derived tag does not remove `llama3.1:8b`.
|
||||
|
||||
- The template above is specific to the tested `llama3.1:8b` tool-call format.
|
||||
- Ollama or the model publisher may update the stock template in a later release.
|
||||
- Validate multiple tool calls, tool errors, parallel calls, and long conversations
|
||||
before using a custom template for unattended workloads.
|
||||
- A higher cache ratio reduces prompt evaluation, but model generation, tool
|
||||
execution, process startup, and storage can still dominate end-to-end latency.
|
||||
- Validate multiple tool calls, tool errors, parallel calls, and long conversations before using a custom template for unattended workloads.
|
||||
- A higher cache ratio reduces prompt evaluation, but model generation, tool execution, process startup, and storage can still dominate end-to-end latency.
|
||||
- Multiple Ollama slots change cache scheduling and may produce different results.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# How to Configure an OpenAI-Compatible Provider in nanobot
|
||||
|
||||
nanobot can call OpenAI-compatible model providers by configuring an `apiBase`,
|
||||
optional `apiKey`, and a model preset that references that provider name.
|
||||
nanobot can call OpenAI-compatible model providers by configuring an `apiBase`, optional `apiKey`, and a model preset that references that provider name.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -11,9 +10,7 @@ optional `apiKey`, and a model preset that references that provider name.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use this for local or hosted services that expose OpenAI-compatible endpoints,
|
||||
including internal gateways, local model servers, and provider proxies that are
|
||||
not already named in nanobot.
|
||||
Use this for local or hosted services that expose OpenAI-compatible endpoints, including internal gateways, local model servers, and provider proxies that are not already named in nanobot.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -67,8 +64,7 @@ nanobot agent -m "Hello!"
|
||||
|
||||
- Include the version path in `apiBase` when the service expects `/v1`.
|
||||
- Use separate provider names for separate endpoints.
|
||||
- Use a placeholder key such as `EMPTY` only when the endpoint requires a
|
||||
non-empty key but does not validate it.
|
||||
- Use a placeholder key such as `EMPTY` only when the endpoint requires a non-empty key but does not validate it.
|
||||
- Leave the preset's API selection on Auto for ordinary Chat Completions services.
|
||||
- If the service requires Responses or Anthropic Messages, set its supported APIs and default in the connection's **Advanced options**. To choose an API for an individual model, use **Settings → Models → a preset → Advanced options → API connection**. See [connection settings](../configuration.md#custom-connection-apis) and [preset settings](../configuration.md#preset-request-api) for JSON examples.
|
||||
|
||||
@@ -81,10 +77,8 @@ nanobot agent -m "Hello!"
|
||||
## Troubleshooting
|
||||
|
||||
- If `curl /models` fails, fix the provider endpoint before changing nanobot.
|
||||
- If nanobot says the model is unknown, check the model ID expected by the
|
||||
provider.
|
||||
- If auth fails, confirm whether the provider wants Bearer auth and whether the
|
||||
key is present in the environment that starts nanobot.
|
||||
- If nanobot says the model is unknown, check the model ID expected by the provider.
|
||||
- If auth fails, confirm whether the provider wants Bearer auth and whether the key is present in the environment that starts nanobot.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# How to Configure Web Search for a nanobot AI Agent
|
||||
|
||||
nanobot includes built-in web search and web fetch tools. Search uses
|
||||
DuckDuckGo by default and can be configured for API-backed or self-hosted
|
||||
providers.
|
||||
nanobot includes built-in web search and web fetch tools. Search uses DuckDuckGo by default and can be configured for API-backed or self-hosted providers.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -12,8 +10,7 @@ providers.
|
||||
|
||||
## When to use this
|
||||
|
||||
Configure web search when the agent needs current information, public web
|
||||
research, source discovery, or page fetching during a task.
|
||||
Configure web search when the agent needs current information, public web research, source discovery, or page fetching during a task.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -23,8 +20,7 @@ nanobot onboard --wizard
|
||||
nanobot agent -m "Hello!"
|
||||
```
|
||||
|
||||
Web tools are enabled by default. Configure them only when you want a specific
|
||||
provider, API key, proxy, fetch behavior, or SSRF allowlist.
|
||||
Web tools are enabled by default. Configure them only when you want a specific provider, API key, proxy, fetch behavior, or SSRF allowlist.
|
||||
|
||||
## Minimal working example
|
||||
|
||||
@@ -66,8 +62,7 @@ Or use an API-backed provider:
|
||||
}
|
||||
```
|
||||
|
||||
Ask a question that requires current information and inspect the tool activity
|
||||
in the WebUI or logs.
|
||||
Ask a question that requires current information and inspect the tool activity in the WebUI or logs.
|
||||
|
||||
## Production notes
|
||||
|
||||
@@ -79,15 +74,10 @@ in the WebUI or logs.
|
||||
## Security notes
|
||||
|
||||
- Web fetch and HTTP MCP share an SSRF guard.
|
||||
- Private, loopback, link-local, and cloud metadata addresses are blocked by
|
||||
default.
|
||||
- With `useJinaReader` enabled (the default), fetched URLs are disclosed to the
|
||||
remote reader service. Credential-bearing URLs (userinfo or token/signature
|
||||
query parameters) are fetched locally instead; path-embedded secrets cannot
|
||||
be detected, so disable the remote reader when URLs must stay local.
|
||||
- Private, loopback, link-local, and cloud metadata addresses are blocked by default.
|
||||
- With `useJinaReader` enabled (the default), fetched URLs are disclosed to the remote reader service. Credential-bearing URLs (userinfo or token/signature query parameters) are fetched locally instead; path-embedded secrets cannot be detected, so disable the remote reader when URLs must stay local.
|
||||
- Add `tools.ssrfWhitelist` only for narrow trusted CIDRs.
|
||||
- Do not give public chat users unrestricted web and shell access without
|
||||
review.
|
||||
- Do not give public chat users unrestricted web and shell access without review.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
|
||||
@@ -1,21 +1,16 @@
|
||||
# How to Deploy a Long-Running nanobot AI Agent Gateway
|
||||
|
||||
The nanobot gateway is the long-running self-hosted AI agent process that keeps
|
||||
WebUI sessions, chat apps, automations, local triggers, heartbeat jobs, Dream,
|
||||
and WebSocket delivery online.
|
||||
The nanobot gateway is the long-running self-hosted AI agent process that keeps WebUI sessions, chat apps, automations, local triggers, heartbeat jobs, Dream, and WebSocket delivery online.
|
||||
|
||||
## What you will build
|
||||
|
||||
- a verified nanobot config
|
||||
- a gateway process
|
||||
- a service or container deployment path with Docker, systemd, or macOS
|
||||
LaunchAgent
|
||||
- a service or container deployment path with Docker, systemd, or macOS LaunchAgent
|
||||
|
||||
## When to use this
|
||||
|
||||
Use this when nanobot should keep running after a single CLI turn. Chat apps,
|
||||
browser sessions, background automations, local triggers, and server-side
|
||||
integrations all depend on a live gateway.
|
||||
Use this when nanobot should keep running after a single CLI turn. Chat apps, browser sessions, background automations, local triggers, and server-side integrations all depend on a live gateway.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -49,27 +44,21 @@ Open the configured WebUI URL in a browser, or run `nanobot webui` as a foregrou
|
||||
- Docker Compose is the most repeatable Linux container path.
|
||||
- systemd user services are useful for Linux user-level gateway deployments.
|
||||
- macOS LaunchAgent keeps the gateway alive after login.
|
||||
- Persist the active config directory's `sessions/` folder together with the workspace
|
||||
(including `.nanobot/workspace-id`), memory files, channel login state, and generated artifacts.
|
||||
- Persist the active config directory's `sessions/` folder together with the workspace (including `.nanobot/workspace-id`), memory files, channel login state, and generated artifacts.
|
||||
- Restart the gateway after editing `config.json`.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Plan ports before exposing services. Gateway health defaults to `18790`,
|
||||
WebUI/WebSocket defaults to `8765`, and `nanobot serve` defaults to `8900`.
|
||||
- Plan ports before exposing services. Gateway health defaults to `18790`, WebUI/WebSocket defaults to `8765`, and `nanobot serve` defaults to `8900`.
|
||||
- Bind externally only when you have configured tokens or API keys.
|
||||
- Keep chat access control intentional before deploying.
|
||||
- Use Docker or Linux sandboxing when shell tools are enabled for unattended
|
||||
work.
|
||||
- Use Docker or Linux sandboxing when shell tools are enabled for unattended work.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Use the same `--config` and `--workspace` flags for status checks and service
|
||||
startup.
|
||||
- Check logs with `docker compose logs`, `journalctl`, LaunchAgent logs, or
|
||||
`nanobot gateway --verbose`.
|
||||
- If Docker port publishing does not work, confirm the service is not bound only
|
||||
to container loopback.
|
||||
- Use the same `--config` and `--workspace` flags for status checks and service startup.
|
||||
- Check logs with `docker compose logs`, `journalctl`, LaunchAgent logs, or `nanobot gateway --verbose`.
|
||||
- If Docker port publishing does not work, confirm the service is not bound only to container loopback.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Build a Discord AI Agent with nanobot
|
||||
|
||||
This guide connects nanobot to Discord so a Discord user or server channel can
|
||||
talk to your self-hosted AI agent through the nanobot gateway.
|
||||
This guide connects nanobot to Discord so a Discord user or server channel can talk to your self-hosted AI agent through the nanobot gateway.
|
||||
|
||||
## What this guide builds
|
||||
|
||||
@@ -36,8 +35,7 @@ Install the optional channel dependency:
|
||||
nanobot plugins enable discord
|
||||
```
|
||||
|
||||
Create a Discord application, add a bot, copy the token, and enable
|
||||
`MESSAGE CONTENT INTENT` in the bot settings.
|
||||
Create a Discord application, add a bot, copy the token, and enable `MESSAGE CONTENT INTENT` in the bot settings.
|
||||
|
||||
Merge this snippet into `~/.nanobot/config.json`:
|
||||
|
||||
@@ -56,13 +54,11 @@ Merge this snippet into `~/.nanobot/config.json`:
|
||||
}
|
||||
```
|
||||
|
||||
Omitting `allowFrom` enables pairing-only mode. A new user should DM the bot
|
||||
first, get a pairing code, and be approved before using the bot in servers.
|
||||
Omitting `allowFrom` enables pairing-only mode. A new user should DM the bot first, get a pairing code, and be approved before using the bot in servers.
|
||||
|
||||
Invite the bot with permissions to read history and send messages.
|
||||
|
||||
Set `replyToMessage` to `true` to make responses use Discord's native reply UI.
|
||||
It defaults to `false`, preserving the existing behavior.
|
||||
Set `replyToMessage` to `true` to make responses use Discord's native reply UI. It defaults to `false`, preserving the existing behavior.
|
||||
|
||||
## Run nanobot gateway
|
||||
|
||||
@@ -73,8 +69,7 @@ nanobot gateway
|
||||
|
||||
## Test a message
|
||||
|
||||
Send the bot a DM first. It should return a pairing code. Approve it from a
|
||||
trusted local surface:
|
||||
Send the bot a DM first. It should return a pairing code. Approve it from a trusted local surface:
|
||||
|
||||
```bash
|
||||
nanobot agent -m "/pairing approve ABCD-EFGH"
|
||||
@@ -90,8 +85,7 @@ After approval, mention it in an allowed server channel:
|
||||
|
||||
- Keep `groupPolicy` as `mention` for first deployment.
|
||||
- Use `allowChannels` for server channels where the bot should operate.
|
||||
- Prefer pairing-only mode for user access; add `allowFrom` only when you want a
|
||||
static allowlist.
|
||||
- Prefer pairing-only mode for user access; add `allowFrom` only when you want a static allowlist.
|
||||
- Avoid open group behavior in busy channels until session routing is clear.
|
||||
- Review tool access before inviting the bot into shared servers.
|
||||
|
||||
@@ -99,8 +93,7 @@ After approval, mention it in an allowed server channel:
|
||||
|
||||
- If no messages arrive, confirm Message Content intent is enabled.
|
||||
- If a DM returns a pairing code, approve it before testing normal replies.
|
||||
- If server messages are ignored, check pairing approval, `allowChannels`, and
|
||||
whether the bot was mentioned.
|
||||
- If server messages are ignored, check pairing approval, `allowChannels`, and whether the bot was mentioned.
|
||||
- If the bot cannot reply, confirm the invite permissions and channel overrides.
|
||||
|
||||
## Next: memory, automations, MCP tools
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Build an Email AI Agent with nanobot
|
||||
|
||||
This guide turns nanobot into an email AI agent that polls IMAP for accepted
|
||||
messages and replies through SMTP.
|
||||
This guide turns nanobot into an email AI agent that polls IMAP for accepted messages and replies through SMTP.
|
||||
|
||||
## What this guide builds
|
||||
|
||||
@@ -19,8 +18,7 @@ nanobot agent -m "Hello!"
|
||||
```
|
||||
|
||||
- A mailbox for the bot.
|
||||
- IMAP and SMTP access. For Gmail, use an app password rather than your account
|
||||
password.
|
||||
- IMAP and SMTP access. For Gmail, use an app password rather than your account password.
|
||||
|
||||
## Install nanobot
|
||||
|
||||
@@ -31,8 +29,7 @@ nanobot onboard --wizard
|
||||
|
||||
## Enable the Email channel
|
||||
|
||||
Merge this snippet into `~/.nanobot/config.json` and replace the addresses and
|
||||
passwords:
|
||||
Merge this snippet into `~/.nanobot/config.json` and replace the addresses and passwords:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -66,42 +63,24 @@ nanobot gateway
|
||||
|
||||
## Test a message
|
||||
|
||||
Send an email from an address in `allowFrom` to the bot mailbox. Keep the
|
||||
gateway running long enough for the polling interval to receive it.
|
||||
Send an email from an address in `allowFrom` to the bot mailbox. Keep the gateway running long enough for the polling interval to receive it.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Use a dedicated mailbox, not your primary personal inbox.
|
||||
- Set `consentGranted` to `false` to fully disable mailbox access.
|
||||
- Email does not use DM pairing. Keep `allowFrom` narrow; `["*"]` accepts mail
|
||||
from anyone.
|
||||
- Keep SPF/DKIM verification enabled and set `trustedAuthservIds` to the exact
|
||||
`authserv-id` added by your receiving mail service. For Gmail this is normally
|
||||
`mx.google.com`. The service must prepend one consolidated
|
||||
`Authentication-Results` header and remove inbound headers claiming the same
|
||||
identity. nanobot rejects authenticated email when this trust anchor is missing
|
||||
or appears more than once.
|
||||
- Email does not use DM pairing. Keep `allowFrom` narrow; `["*"]` accepts mail from anyone.
|
||||
- Keep SPF/DKIM verification enabled and set `trustedAuthservIds` to the exact `authserv-id` added by your receiving mail service. For Gmail this is normally `mx.google.com`. The service must prepend one consolidated `Authentication-Results` header and remove inbound headers claiming the same identity. nanobot rejects authenticated email when this trust anchor is missing or appears more than once.
|
||||
- Use environment variables for mailbox passwords.
|
||||
- Enable attachment types only when the agent needs them.
|
||||
|
||||
## Upgrading to v0.3.5
|
||||
|
||||
Email authentication now requires an explicit receiving-service trust anchor.
|
||||
This is a security-related configuration change: an existing email channel with
|
||||
`verifySpf` or `verifyDkim` enabled will not start without `trustedAuthservIds`.
|
||||
Other channels, mailbox credentials, stored messages, and `allowFrom` do not need
|
||||
to be migrated. Existing values are not automatically rewritten.
|
||||
Email authentication now requires an explicit receiving-service trust anchor. This is a security-related configuration change: an existing email channel with `verifySpf` or `verifyDkim` enabled will not start without `trustedAuthservIds`. Other channels, mailbox credentials, stored messages, and `allowFrom` do not need to be migrated. Existing values are not automatically rewritten.
|
||||
|
||||
1. Back up your configuration and temporarily disable the Email channel while
|
||||
configuring the receiver. Do not turn off SPF/DKIM verification as an upgrade
|
||||
workaround.
|
||||
2. Confirm with your receiving mail service or administrator which exact
|
||||
`authserv-id` it adds, and that it strips externally supplied headers claiming
|
||||
that identity. It must provide one consolidated `Authentication-Results`
|
||||
header. A name visible in a received email is not, by itself, proof of trust;
|
||||
do not infer it from your IMAP hostname or copy it from an arbitrary message.
|
||||
3. In Email settings, open **Advanced** and set **Trusted authentication services**,
|
||||
or merge the following fields into `channels.email` in your existing config:
|
||||
1. Back up your configuration and temporarily disable the Email channel while configuring the receiver. Do not turn off SPF/DKIM verification as an upgrade workaround.
|
||||
2. Confirm with your receiving mail service or administrator which exact `authserv-id` it adds, and that it strips externally supplied headers claiming that identity. It must provide one consolidated `Authentication-Results` header. A name visible in a received email is not, by itself, proof of trust; do not infer it from your IMAP hostname or copy it from an arbitrary message.
|
||||
3. In Email settings, open **Advanced** and set **Trusted authentication services**, or merge the following fields into `channels.email` in your existing config:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -111,39 +90,19 @@ to be migrated. Existing values are not automatically rewritten.
|
||||
}
|
||||
```
|
||||
|
||||
The example is for a receiver using `mx.google.com`; use your confirmed
|
||||
receiver identity instead. JSON uses a list; the WebUI accepts comma-separated
|
||||
values. Wildcards and URLs are not accepted. Multiple configured identities
|
||||
are alternatives, not permission to combine multiple trusted result headers.
|
||||
4. Check the IMAP/SMTP connection, re-enable Email, and restart the gateway after
|
||||
editing a configuration file. Send one ordinary message from an allowed
|
||||
address and confirm receipt and reply. A successful connection check verifies
|
||||
credentials and configuration, not your mail service's header-stripping policy.
|
||||
The example is for a receiver using `mx.google.com`; use your confirmed receiver identity instead. JSON uses a list; the WebUI accepts comma-separated values. Wildcards and URLs are not accepted. Multiple configured identities are alternatives, not permission to combine multiple trusted result headers.
|
||||
4. Check the IMAP/SMTP connection, re-enable Email, and restart the gateway after editing a configuration file. Send one ordinary message from an allowed address and confirm receipt and reply. A successful connection check verifies credentials and configuration, not your mail service's header-stripping policy.
|
||||
|
||||
Each enabled verification method must pass and identify the visible sender's
|
||||
domain, or a parent/subdomain of it. DKIM uses `header.d` when present, otherwise
|
||||
the domain of the receiver-reported `header.i`. This is not a full DMARC policy
|
||||
implementation, and domain authentication does not independently authenticate
|
||||
the mailbox local part. Forwarders, mailing lists, or receivers that emit separate
|
||||
SPF and DKIM result headers may need mail-service changes. Keep Email disabled
|
||||
if the receiver cannot meet the trust contract.
|
||||
Each enabled verification method must pass and identify the visible sender's domain, or a parent/subdomain of it. DKIM uses `header.d` when present, otherwise the domain of the receiver-reported `header.i`. This is not a full DMARC policy implementation, and domain authentication does not independently authenticate the mailbox local part. Forwarders, mailing lists, or receivers that emit separate SPF and DKIM result headers may need mail-service changes. Keep Email disabled if the receiver cannot meet the trust contract.
|
||||
|
||||
Authentication failures remain skipped messages. Keep the default
|
||||
`postActionIgnoreSkipped: true` while checking the migration; setting it to
|
||||
`false` allows your configured move/delete action to affect skipped mail too.
|
||||
If the migration cannot be completed, disable Email rather than reverting to an
|
||||
older authentication policy.
|
||||
Authentication failures remain skipped messages. Keep the default `postActionIgnoreSkipped: true` while checking the migration; setting it to `false` allows your configured move/delete action to affect skipped mail too. If the migration cannot be completed, disable Email rather than reverting to an older authentication policy.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If login fails, confirm IMAP/SMTP access and app-password setup.
|
||||
- If Email will not start and reports `trusted_authserv_ids` as missing, complete
|
||||
the upgrade steps above. A configured receiver still needs to emit compatible,
|
||||
aligned authentication results for each enabled verification method.
|
||||
- If the bot reads but does not reply, check `autoReplyEnabled`, SMTP settings,
|
||||
and allowed sender addresses.
|
||||
- If attachments are missing, review `allowedAttachmentTypes`, size limits, and
|
||||
gateway logs.
|
||||
- If Email will not start and reports `trusted_authserv_ids` as missing, complete the upgrade steps above. A configured receiver still needs to emit compatible, aligned authentication results for each enabled verification method.
|
||||
- If the bot reads but does not reply, check `autoReplyEnabled`, SMTP settings, and allowed sender addresses.
|
||||
- If attachments are missing, review `allowedAttachmentTypes`, size limits, and gateway logs.
|
||||
|
||||
## Next: memory, automations, MCP tools
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# Build a Feishu AI Agent with nanobot
|
||||
|
||||
This guide connects nanobot to Feishu or Lark through the `feishu` channel. The
|
||||
channel uses a WebSocket long connection, so the first setup does not require a
|
||||
public webhook URL.
|
||||
This guide connects nanobot to Feishu or Lark through the `feishu` channel. The channel uses a WebSocket long connection, so the first setup does not require a public webhook URL.
|
||||
|
||||
## What this guide builds
|
||||
|
||||
@@ -43,11 +41,9 @@ The easiest path is QR login:
|
||||
nanobot channels login feishu
|
||||
```
|
||||
|
||||
Open the printed URL or scan the QR code. nanobot writes the generated `appId`,
|
||||
`appSecret`, `domain`, and `enabled` fields into the active config.
|
||||
Open the printed URL or scan the QR code. nanobot writes the generated `appId`, `appSecret`, `domain`, and `enabled` fields into the active config.
|
||||
|
||||
If QR login is unavailable, create a Feishu/Lark app manually and merge this
|
||||
shape into `~/.nanobot/config.json`:
|
||||
If QR login is unavailable, create a Feishu/Lark app manually and merge this shape into `~/.nanobot/config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -64,12 +60,9 @@ shape into `~/.nanobot/config.json`:
|
||||
}
|
||||
```
|
||||
|
||||
Omitting `allowFrom` enables pairing-only mode. A new user should DM the bot,
|
||||
get a pairing code, and be approved before using the bot normally.
|
||||
Omitting `allowFrom` enables pairing-only mode. A new user should DM the bot, get a pairing code, and be approved before using the bot normally.
|
||||
|
||||
For manual apps, enable the Bot capability, receive-message events, and Long
|
||||
Connection mode. If your app cannot get the `cardkit:card:write` permission,
|
||||
set `"streaming": false`.
|
||||
For manual apps, enable the Bot capability, receive-message events, and Long Connection mode. If your app cannot get the `cardkit:card:write` permission, set `"streaming": false`.
|
||||
|
||||
## Run nanobot gateway
|
||||
|
||||
@@ -80,8 +73,7 @@ nanobot gateway
|
||||
|
||||
## Test a message
|
||||
|
||||
DM the bot first. It should return a pairing code. Approve it from a trusted
|
||||
local surface:
|
||||
DM the bot first. It should return a pairing code. Approve it from a trusted local surface:
|
||||
|
||||
```bash
|
||||
nanobot agent -m "/pairing approve ABCD-EFGH"
|
||||
@@ -95,22 +87,17 @@ After approval, DM the bot again or mention it in a group chat:
|
||||
|
||||
## Security notes
|
||||
|
||||
- Prefer pairing-only mode for first setup. Add `allowFrom` only when you want a
|
||||
static allowlist.
|
||||
- Prefer pairing-only mode for first setup. Add `allowFrom` only when you want a static allowlist.
|
||||
- Keep `groupPolicy` as `"mention"` before inviting the bot into busy groups.
|
||||
- Store app secrets through environment variables for deployed services.
|
||||
- Review file, shell, and web tool access before adding more users.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If QR login is unavailable, use manual app setup from the full chat-apps
|
||||
reference.
|
||||
- If streaming cards fail, confirm `cardkit:card:write` or set
|
||||
`"streaming": false`.
|
||||
- If no messages arrive, check Feishu/Lark event permissions, Long Connection
|
||||
mode, and `nanobot gateway --verbose`.
|
||||
- If a first DM returns a pairing code, approve it before testing normal
|
||||
replies.
|
||||
- If QR login is unavailable, use manual app setup from the full chat-apps reference.
|
||||
- If streaming cards fail, confirm `cardkit:card:write` or set `"streaming": false`.
|
||||
- If no messages arrive, check Feishu/Lark event permissions, Long Connection mode, and `nanobot gateway --verbose`.
|
||||
- If a first DM returns a pairing code, approve it before testing normal replies.
|
||||
|
||||
## Next: memory, automations, MCP tools
|
||||
|
||||
|
||||
@@ -1,42 +1,21 @@
|
||||
# iOS PWA top-edge rendering
|
||||
|
||||
[Issue #5772](https://github.com/HKUDS/nanobot/issues/5772) tracks washed-out
|
||||
controls at the top of an installed iOS PWA. This is separate from the mobile
|
||||
sidebar focus and double-tap fixes in #5839.
|
||||
[Issue #5772](https://github.com/HKUDS/nanobot/issues/5772) tracks washed-out controls at the top of an installed iOS PWA. This is separate from the mobile sidebar focus and double-tap fixes in #5839.
|
||||
|
||||
## Compatibility surface
|
||||
|
||||
The initial HTML includes one empty, non-interactive `.pwa-status-bar-surface`
|
||||
outside React's root. It only renders in standalone mode on engines supporting
|
||||
`-webkit-touch-callout` and text background clipping. Normal browser tabs and
|
||||
Chromium PWAs keep it `display: none`.
|
||||
The initial HTML includes one empty, non-interactive `.pwa-status-bar-surface` outside React's root. It only renders in standalone mode on engines supporting `-webkit-touch-callout` and text background clipping. Normal browser tabs and Chromium PWAs keep it `display: none`.
|
||||
|
||||
The pinned WebKit [fixed-container sampling implementation](https://github.com/WebKit/WebKit/blob/d620932d8ce37cf83f60d5c50dace2d50fed4f80/Source/WebCore/page/LocalFrameView.cpp#L2088)
|
||||
looks for fixed/sticky elements near the viewport edge, covering at least 90% of
|
||||
its width. A primary background must exceed the 10px thin-border threshold and
|
||||
must not be hidden or nearly transparent. Sampling can ignore `pointer-events`.
|
||||
Nanobot's relative/absolute header and small button backgrounds do not provide
|
||||
that full-width surface. This supports the candidate mechanism; it does not prove
|
||||
which WebKit revision ships on an affected device or establish the reported root
|
||||
cause. The CSS capability check is not an iOS version check: older compatible
|
||||
standalone WebKit engines also receive the surface.
|
||||
The pinned WebKit [fixed-container sampling implementation](https://github.com/WebKit/WebKit/blob/d620932d8ce37cf83f60d5c50dace2d50fed4f80/Source/WebCore/page/LocalFrameView.cpp#L2088) looks for fixed/sticky elements near the viewport edge, covering at least 90% of its width. A primary background must exceed the 10px thin-border threshold and must not be hidden or nearly transparent. Sampling can ignore `pointer-events`. Nanobot's relative/absolute header and small button backgrounds do not provide that full-width surface. This supports the candidate mechanism; it does not prove which WebKit revision ships on an affected device or establish the reported root cause. The CSS capability check is not an iOS version check: older compatible standalone WebKit engines also receive the surface.
|
||||
|
||||
The surface is 11px high, viewport-fixed, full-width, and above the application
|
||||
layers. It inherits the body's background color, including startup and live theme
|
||||
changes. Clipping that background to empty text prevents it from painting over
|
||||
controls while retaining the background style for WebKit's sampler. It has no
|
||||
focusable content and cannot intercept taps. It does not add padding, move the
|
||||
header, change viewport fitting, or animate an artificial overlay.
|
||||
The surface is 11px high, viewport-fixed, full-width, and above the application layers. It inherits the body's background color, including startup and live theme changes. Clipping that background to empty text prevents it from painting over controls while retaining the background style for WebKit's sampler. It has no focusable content and cannot intercept taps. It does not add padding, move the header, change viewport fitting, or animate an artificial overlay.
|
||||
|
||||
This is a compatibility workaround, **not a supported Apple status-bar API**.
|
||||
First-person device experiments describing the same mechanism:
|
||||
This is a compatibility workaround, **not a supported Apple status-bar API**. First-person device experiments describing the same mechanism:
|
||||
|
||||
- [Empty-text fixed surface on iOS 27](https://qiita.com/na-trium-144/items/0add98a80ca2391e3f17)
|
||||
- [iOS PWA blur experiments, CSS-only update](https://tips.ojapp.app/en/ios-27-pwa-top-blur-workaround-2/)
|
||||
|
||||
Keep `viewport-fit=auto` and the existing status-bar metadata. Do not replace this
|
||||
with a guessed safe-area inset or claim that a desktop screenshot verifies iOS
|
||||
system compositing.
|
||||
Keep `viewport-fit=auto` and the existing status-bar metadata. Do not replace this with a guessed safe-area inset or claim that a desktop screenshot verifies iOS system compositing.
|
||||
|
||||
## What the evidence establishes
|
||||
|
||||
@@ -47,33 +26,18 @@ system compositing.
|
||||
| DOM/CSS contract tests | The surface is empty, outside the React root, conditionally enabled, and retains its sampling styles | Browser layout, hit testing, or system compositing |
|
||||
| Desktop browser probe with platform conditions bypassed | Layout, paint, click-through and theme behavior under the tested conditions | Native iOS capability detection or standalone-shell rendering |
|
||||
|
||||
Do not make the surface invisible with `opacity: 0`, `visibility: hidden`, or a
|
||||
transparent background: those remove the background the sampler is intended to
|
||||
find. Empty-text clipping keeps the background style without painting a strip.
|
||||
Do not make the surface invisible with `opacity: 0`, `visibility: hidden`, or a transparent background: those remove the background the sampler is intended to find. Empty-text clipping keeps the background style without painting a strip.
|
||||
|
||||
## Device acceptance gate
|
||||
|
||||
HTML/CSS contract tests and desktop layout checks verify scoping, color inheritance,
|
||||
non-interference and safe-area preservation. They cannot prove the reported iOS
|
||||
system blur is gone. Before marking the issue resolved, record the actual device,
|
||||
full iOS version, nanobot commit and served frontend asset version, then compare
|
||||
the same device before/after. Confirm the pre-fix version reproduces the issue:
|
||||
HTML/CSS contract tests and desktop layout checks verify scoping, color inheritance, non-interference and safe-area preservation. They cannot prove the reported iOS system blur is gone. Before marking the issue resolved, record the actual device, full iOS version, nanobot commit and served frontend asset version, then compare the same device before/after. Confirm the pre-fix version reproduces the issue:
|
||||
|
||||
1. Completely quit and relaunch the installed PWA; verify the latest HTML is served.
|
||||
2. Check sidebar/theme controls on new and existing chats, before and after scrolling
|
||||
and switching chats. A related [WebKit navigation regression](https://bugs.webkit.org/show_bug.cgi?id=305546)
|
||||
shows why a correct first frame is not sufficient; it is not confirmation of
|
||||
this report's root cause.
|
||||
2. Check sidebar/theme controls on new and existing chats, before and after scrolling and switching chats. A related [WebKit navigation regression](https://bugs.webkit.org/show_bug.cgi?id=305546) shows why a correct first frame is not sufficient; it is not confirmation of this report's root cause.
|
||||
3. Switch light/dark themes, rotate portrait/landscape, and open/close the keyboard.
|
||||
4. Open and close the sidebar and settings; verify top controls and one-tap navigation.
|
||||
5. Compare an ordinary Safari tab and, when available, an unaffected older iOS PWA
|
||||
to rule out added space, painted strips, blocked input or zoom regressions.
|
||||
5. Compare an ordinary Safari tab and, when available, an unaffected older iOS PWA to rule out added space, painted strips, blocked input or zoom regressions.
|
||||
|
||||
Record results as **pass**, **fail**, or **not tested**, with before/after screenshots.
|
||||
If the old build does not reproduce, report that explicitly rather than attributing
|
||||
the absence of blur to this patch. Do not clear site data or reinstall the PWA just
|
||||
to obtain fresh assets; preserve user preferences and local state.
|
||||
Record results as **pass**, **fail**, or **not tested**, with before/after screenshots. If the old build does not reproduce, report that explicitly rather than attributing the absence of blur to this patch. Do not clear site data or reinstall the PWA just to obtain fresh assets; preserve user preferences and local state.
|
||||
|
||||
If the workaround stops matching WebKit behavior, re-check the upstream sampling
|
||||
implementation and device results rather than increasing padding or layer sizes.
|
||||
The separately reported portrait `@` selection failure is not addressed here.
|
||||
If the workaround stops matching WebKit behavior, re-check the upstream sampling implementation and device results rather than increasing padding or layer sizes. The separately reported portrait `@` selection failure is not addressed here.
|
||||
+75
-268
@@ -1,57 +1,34 @@
|
||||
# Connect nanobot as a Native Linear Agent
|
||||
|
||||
This guide takes you from an empty Linear channel configuration to a working
|
||||
@mention or delegated issue. The recommended path uses the nanobot WebUI and a
|
||||
pre-filled Linear app manifest. Review the generated URLs and subscriptions,
|
||||
and confirm that webhook delivery is enabled before testing a task.
|
||||
This guide takes you from an empty Linear channel configuration to a working @mention or delegated issue. The recommended path uses the nanobot WebUI and a pre-filled Linear app manifest. Review the generated URLs and subscriptions, and confirm that webhook delivery is enabled before testing a task.
|
||||
|
||||
> [!NOTE]
|
||||
> Linear's Agent APIs are currently a Developer Preview. Their schema may
|
||||
> change. Keep nanobot current when you use this channel.
|
||||
> Linear's Agent APIs are currently a Developer Preview. Their schema may change. Keep nanobot current when you use this channel.
|
||||
|
||||
## What this channel does
|
||||
|
||||
- A new task starts when someone explicitly @mentions the installed app or
|
||||
delegates an issue to it.
|
||||
- A new task starts when someone explicitly @mentions the installed app or delegates an issue to it.
|
||||
- An ordinary issue comment does not invoke nanobot.
|
||||
- A follow-up inside the existing Agent Session continues the same nanobot
|
||||
session without another @mention.
|
||||
- Linear's stop control asks nanobot to cancel the active turn. The sender must
|
||||
have access, just as for other requests. An activity already delivered to
|
||||
Linear cannot be recalled.
|
||||
- nanobot reports its acknowledgement, tool activity, reasoning, and final
|
||||
answer as native Linear Agent Activities.
|
||||
- Button choices are sent as Linear selection activities, and local outbound
|
||||
files are uploaded to Linear before they are linked in the response.
|
||||
- Private `uploads.linear.app` links in the session prompt are downloaded with
|
||||
the workspace OAuth token and passed to nanobot as inbound media after access
|
||||
checks. A prompt can import up to 10 attachments and 40 MB in total; skipped
|
||||
or unavailable files are called out in the prompt instead of failing silently.
|
||||
- A follow-up inside the existing Agent Session continues the same nanobot session without another @mention.
|
||||
- Linear's stop control asks nanobot to cancel the active turn. The sender must have access, just as for other requests. An activity already delivered to Linear cannot be recalled.
|
||||
- nanobot reports its acknowledgement, tool activity, reasoning, and final answer as native Linear Agent Activities.
|
||||
- Button choices are sent as Linear selection activities, and local outbound files are uploaded to Linear before they are linked in the response.
|
||||
- Private `uploads.linear.app` links in the session prompt are downloaded with the workspace OAuth token and passed to nanobot as inbound media after access checks. A prompt can import up to 10 attachments and 40 MB in total; skipped or unavailable files are called out in the prompt instead of failing silently.
|
||||
|
||||
The OAuth request includes `app:mentionable` and `app:assignable`, in addition
|
||||
to `read` and `write`. Existing workspace installations must be reconnected to
|
||||
grant `app:assignable`.
|
||||
The OAuth request includes `app:mentionable` and `app:assignable`, in addition to `read` and `write`. Existing workspace installations must be reconnected to grant `app:assignable`.
|
||||
|
||||
The native channel owns Agent Session transport. Connect the Linear MCP app when
|
||||
the agent also needs tools for searching or changing Linear issues; OAuth scopes
|
||||
on the channel do not expose those actions as nanobot tools. MCP does not replace
|
||||
the channel's OAuth installation, webhook, or Agent Session transport.
|
||||
The native channel owns Agent Session transport. Connect the Linear MCP app when the agent also needs tools for searching or changing Linear issues; OAuth scopes on the channel do not expose those actions as nanobot tools. MCP does not replace the channel's OAuth installation, webhook, or Agent Session transport.
|
||||
|
||||
## Before you start
|
||||
|
||||
There are two separate decisions: **connect a workspace**, then **choose who can
|
||||
use nanobot**. The administrator sets up the app once; teammates do not need to
|
||||
create their own apps, paste credentials, or scan a code.
|
||||
There are two separate decisions: **connect a workspace**, then **choose who can use nanobot**. The administrator sets up the app once; teammates do not need to create their own apps, paste credentials, or scan a code.
|
||||
|
||||
```text
|
||||
Prepare HTTPS → Create the Linear app → Save credentials in nanobot
|
||||
→ Authorize a workspace → Enable members → Try an @mention
|
||||
```
|
||||
|
||||
The HTTPS address receives Linear events. OAuth installs the app in a workspace.
|
||||
Member access controls who may ask your nanobot to do work. These steps serve
|
||||
different purposes; authorizing a workspace does not automatically approve all
|
||||
its members.
|
||||
The HTTPS address receives Linear events. OAuth installs the app in a workspace. Member access controls who may ask your nanobot to do work. These steps serve different purposes; authorizing a workspace does not automatically approve all its members.
|
||||
|
||||
Prepare these four things:
|
||||
|
||||
@@ -62,9 +39,7 @@ Prepare these four things:
|
||||
| Public HTTPS origin | A reachable address such as `https://nanobot.example.com`; use a fixed hostname for ongoing use |
|
||||
| Local route | The public address forwards to nanobot's Linear listener, which defaults to port `3979` |
|
||||
|
||||
The public address is an **origin**, not a complete endpoint. Enter
|
||||
`https://nanobot.example.com`, not
|
||||
`https://nanobot.example.com/linear/webhook`.
|
||||
The public address is an **origin**, not a complete endpoint. Enter `https://nanobot.example.com`, not `https://nanobot.example.com/linear/webhook`.
|
||||
|
||||
The four network fields have different jobs:
|
||||
|
||||
@@ -77,14 +52,9 @@ The four network fields have different jobs:
|
||||
|
||||
### Webhook and networking requirements
|
||||
|
||||
The native Linear Agent transport requires a webhook; there is no polling mode.
|
||||
The OAuth callback also needs to reach the same nanobot instance.
|
||||
The native Linear Agent transport requires a webhook; there is no polling mode. The OAuth callback also needs to reach the same nanobot instance.
|
||||
|
||||
You do **not** need a public IP address when using an HTTPS tunnel such as
|
||||
Cloudflare Tunnel or Tailscale Funnel. On a publicly reachable server, Caddy,
|
||||
nginx, or another reverse proxy can provide HTTPS and forward requests to
|
||||
`127.0.0.1:3979`. Use a stable hostname for normal use: if the hostname changes,
|
||||
update **Public HTTPS URL** in nanobot and both registered URLs in the Linear app.
|
||||
You do **not** need a public IP address when using an HTTPS tunnel such as Cloudflare Tunnel or Tailscale Funnel. On a publicly reachable server, Caddy, nginx, or another reverse proxy can provide HTTPS and forward requests to `127.0.0.1:3979`. Use a stable hostname for normal use: if the hostname changes, update **Public HTTPS URL** in nanobot and both registered URLs in the Linear app.
|
||||
|
||||
Choose the simplest option that matches your deployment:
|
||||
|
||||
@@ -102,35 +72,21 @@ https://nanobot.example.com/linear/oauth/callback -> 127.0.0.1:3979
|
||||
https://nanobot.example.com/linear/webhook -> 127.0.0.1:3979
|
||||
```
|
||||
|
||||
If the proxy or tunnel runs on the same machine, set the advanced **Listen
|
||||
host** field to `127.0.0.1` so the listener is not exposed directly on the local
|
||||
network. Containers and separate reverse-proxy hosts may require `0.0.0.0`.
|
||||
The Linear listener serves plain HTTP locally; terminate HTTPS at the proxy or
|
||||
tunnel instead of exposing port `3979` directly to the internet.
|
||||
If the proxy or tunnel runs on the same machine, set the advanced **Listen host** field to `127.0.0.1` so the listener is not exposed directly on the local network. Containers and separate reverse-proxy hosts may require `0.0.0.0`. The Linear listener serves plain HTTP locally; terminate HTTPS at the proxy or tunnel instead of exposing port `3979` directly to the internet.
|
||||
|
||||
Only the callback and webhook need public routes. Keep the nanobot WebUI and
|
||||
admin API private, for example behind a VPN or SSH tunnel. Do not point your
|
||||
public hostname at the WebUI port. An HTTPS endpoint is not an invitation to run
|
||||
the agent: webhooks must pass signature checks, and senders must pass access checks.
|
||||
Only the callback and webhook need public routes. Keep the nanobot WebUI and admin API private, for example behind a VPN or SSH tunnel. Do not point your public hostname at the WebUI port. An HTTPS endpoint is not an invitation to run the agent: webhooks must pass signature checks, and senders must pass access checks.
|
||||
|
||||
### Temporary HTTPS for a local test
|
||||
|
||||
Install [cloudflared](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/),
|
||||
then run it in a separate terminal:
|
||||
Install [cloudflared](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/downloads/), then run it in a separate terminal:
|
||||
|
||||
```bash
|
||||
cloudflared tunnel --url http://127.0.0.1:3979
|
||||
```
|
||||
|
||||
Use the printed `https://<random-name>.trycloudflare.com` origin as **Public
|
||||
HTTPS URL** in the setup below. Keep the tunnel running throughout authorization
|
||||
and testing. The listener starts when you select **Connect Linear**, so a 502
|
||||
before that step can mean the local listener has not started yet.
|
||||
Use the printed `https://<random-name>.trycloudflare.com` origin as **Public HTTPS URL** in the setup below. Keep the tunnel running throughout authorization and testing. The listener starts when you select **Connect Linear**, so a 502 before that step can mean the local listener has not started yet.
|
||||
|
||||
[Quick Tunnels](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare/)
|
||||
are intended for testing and generate a new hostname on restart. Update the
|
||||
nanobot public URL and the Linear app's Redirect URI and Webhook URL before
|
||||
continuing with a new hostname.
|
||||
[Quick Tunnels](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare/) are intended for testing and generate a new hostname on restart. Update the nanobot public URL and the Linear app's Redirect URI and Webhook URL before continuing with a new hostname.
|
||||
|
||||
These settings must be updated together:
|
||||
|
||||
@@ -140,9 +96,7 @@ These settings must be updated together:
|
||||
| Linear **Redirect URIs** | `https://<new-hostname>.trycloudflare.com/linear/oauth/callback` |
|
||||
| Linear **Webhooks → URL** | `https://<new-hostname>.trycloudflare.com/linear/webhook` |
|
||||
|
||||
Updating only the Redirect URI allows OAuth to succeed but leaves task events
|
||||
pointing at the old tunnel. After updating the Webhook URL, also check its
|
||||
**Delivery status**; a correct URL does not enable delivery by itself.
|
||||
Updating only the Redirect URI allows OAuth to succeed but leaves task events pointing at the old tunnel. After updating the Webhook URL, also check its **Delivery status**; a correct URL does not enable delivery by itself.
|
||||
|
||||
## Recommended setup in the WebUI
|
||||
|
||||
@@ -151,19 +105,15 @@ Keep `nanobot webui` running throughout the setup.
|
||||
### 1. Enter the public address
|
||||
|
||||
1. Open **Settings → Channels → Linear**.
|
||||
2. Enter your public origin in **Public HTTPS URL**, for example
|
||||
`https://nanobot.example.com`.
|
||||
2. Enter your public origin in **Public HTTPS URL**, for example `https://nanobot.example.com`.
|
||||
3. Leave the three credential fields empty for now.
|
||||
4. Wait for **Settings saved.**, then select **Create Linear app**. Selecting it
|
||||
before entering an address shows a prompt and returns focus to the URL field.
|
||||
4. Wait for **Settings saved.**, then select **Create Linear app**. Selecting it before entering an address shows a prompt and returns focus to the URL field.
|
||||
|
||||
Saving a partial configuration at this point is expected. You will create the
|
||||
credentials in the next step.
|
||||
Saving a partial configuration at this point is expected. You will create the credentials in the next step.
|
||||
|
||||
### 2. Create the Linear app
|
||||
|
||||
1. Select **Create Linear app**. Sign in to the Linear workspace in
|
||||
which you want to create the app.
|
||||
1. Select **Create Linear app**. Sign in to the Linear workspace in which you want to create the app.
|
||||
2. Review the pre-filled form. It should describe a **private** app and contain:
|
||||
|
||||
```text
|
||||
@@ -172,23 +122,14 @@ credentials in the next step.
|
||||
Webhook types: AgentSessionEvent, PermissionChange, OAuthAuthorization
|
||||
```
|
||||
|
||||
3. Choose a short, recognizable app name and icon if you want to customize how
|
||||
nanobot appears in Linear.
|
||||
3. Choose a short, recognizable app name and icon if you want to customize how nanobot appears in Linear.
|
||||
4. Create the app.
|
||||
5. In the app's **Webhooks** section, check **Delivery status**. If it is
|
||||
**Disabled**, use the adjacent **…** menu to enable delivery. Confirm the URL
|
||||
points to the current public origin and that **Events** includes
|
||||
**Agent session events** (`AgentSessionEvent`).
|
||||
5. In the app's **Webhooks** section, check **Delivery status**. If it is **Disabled**, use the adjacent **…** menu to enable delivery. Confirm the URL points to the current public origin and that **Events** includes **Agent session events** (`AgentSessionEvent`).
|
||||
|
||||
> [!IMPORTANT]
|
||||
> OAuth authorization and webhook delivery are separate. Authorization can
|
||||
> succeed while webhook delivery is disabled. In that state, Linear can create
|
||||
> an Agent Session, but nanobot receives no task and Linear may report
|
||||
> **Agent didn't start** or **nanobot failed to start**.
|
||||
> OAuth authorization and webhook delivery are separate. Authorization can succeed while webhook delivery is disabled. In that state, Linear can create an Agent Session, but nanobot receives no task and Linear may report **Agent didn't start** or **nanobot failed to start**.
|
||||
|
||||
Do not add a `Comment` webhook subscription. Linear delivers new @mentions and
|
||||
Agent Session follow-ups through `AgentSessionEvent`; subscribing to comments
|
||||
would add events that this channel intentionally ignores.
|
||||
Do not add a `Comment` webhook subscription. Linear delivers new @mentions and Agent Session follow-ups through `AgentSessionEvent`; subscribing to comments would add events that this channel intentionally ignores.
|
||||
|
||||
### 3. Copy the three credentials into nanobot
|
||||
|
||||
@@ -200,61 +141,32 @@ In the new Linear app's settings, copy these values:
|
||||
| Client Secret | **OAuth client secret** |
|
||||
| Webhook signing secret | **Webhook signing secret** |
|
||||
|
||||
Return to **Settings → Channels → Linear** and paste all three values. Ordinary
|
||||
fields save automatically after a short pause. For each secret, select **Save**
|
||||
beside that field and wait for its **Saved** status.
|
||||
**Connect Linear** becomes available once the required settings are saved.
|
||||
Listener settings, callback paths, and allowed users are in **Advanced**; setup
|
||||
guides are in the dialog's **Help** menu.
|
||||
Return to **Settings → Channels → Linear** and paste all three values. Ordinary fields save automatically after a short pause. For each secret, select **Save** beside that field and wait for its **Saved** status. **Connect Linear** becomes available once the required settings are saved. Listener settings, callback paths, and allowed users are in **Advanced**; setup guides are in the dialog's **Help** menu.
|
||||
|
||||
A masked value with **Saved** means this instance already has the secret; it is
|
||||
not an empty input. To change it, select **Replace**, enter the new secret, then
|
||||
**Save**. **Cancel** or Escape leaves the saved secret unchanged. Leaving the
|
||||
field or showing the newly typed value does not save it. A failed save retains
|
||||
the draft for retry; the old secret is never sent back to the browser.
|
||||
A masked value with **Saved** means this instance already has the secret; it is not an empty input. To change it, select **Replace**, enter the new secret, then **Save**. **Cancel** or Escape leaves the saved secret unchanged. Leaving the field or showing the newly typed value does not save it. A failed save retains the draft for retry; the old secret is never sent back to the browser.
|
||||
|
||||
Closing the dialog waits for in-flight saves, but does not save an unsubmitted
|
||||
secret draft. Save each secret explicitly before continuing.
|
||||
Closing the dialog waits for in-flight saves, but does not save an unsubmitted secret draft. Save each secret explicitly before continuing.
|
||||
|
||||
Treat the Client Secret and Webhook signing secret like passwords. They belong
|
||||
only in the nanobot configuration and the Linear application settings.
|
||||
Treat the Client Secret and Webhook signing secret like passwords. They belong only in the nanobot configuration and the Linear application settings.
|
||||
|
||||
### 4. Authorize the workspace
|
||||
|
||||
1. Select **Connect Linear**.
|
||||
2. Select **Continue in Linear** to open authorization in your browser. There is
|
||||
no QR step.
|
||||
3. Choose the workspace, review the app's permissions and team access, and
|
||||
approve the installation as a workspace admin.
|
||||
4. Return to nanobot and wait for the **Channel running** badge. The
|
||||
**Authorized workspaces** section lists the workspace separately.
|
||||
2. Select **Continue in Linear** to open authorization in your browser. There is no QR step.
|
||||
3. Choose the workspace, review the app's permissions and team access, and approve the installation as a workspace admin.
|
||||
4. Return to nanobot and wait for the **Channel running** badge. The **Authorized workspaces** section lists the workspace separately.
|
||||
|
||||
nanobot enables the channel automatically after authorization. The gateway must
|
||||
remain running so Linear can deliver webhooks. Reopening the panel shows the
|
||||
running channel and its authorized workspaces without another authorization
|
||||
attempt. Use **… → Remove workspace** on a workspace to revoke its Linear OAuth
|
||||
tokens and remove the local installation; see the lifecycle controls below for
|
||||
what is kept.
|
||||
nanobot enables the channel automatically after authorization. The gateway must remain running so Linear can deliver webhooks. Reopening the panel shows the running channel and its authorized workspaces without another authorization attempt. Use **… → Remove workspace** on a workspace to revoke its Linear OAuth tokens and remove the local installation; see the lifecycle controls below for what is kept.
|
||||
|
||||
The pre-filled manifest creates a private app for the current workspace. A
|
||||
distributable OAuth app can authorize additional workspaces; nanobot stores and
|
||||
refreshes each workspace installation separately.
|
||||
The pre-filled manifest creates a private app for the current workspace. A distributable OAuth app can authorize additional workspaces; nanobot stores and refreshes each workspace installation separately.
|
||||
|
||||
### 5. Choose who can use nanobot
|
||||
|
||||
Under the workspace card, expand **Member access**, find yourself, and turn on
|
||||
your switch. Do the same for any teammates you want to invite. Wait for **Saved**
|
||||
beside each member; they can then use the agent without a pairing code.
|
||||
Under the workspace card, expand **Member access**, find yourself, and turn on your switch. Do the same for any teammates you want to invite. Wait for **Saved** beside each member; they can then use the agent without a pairing code.
|
||||
|
||||
You manage two levels here: **workspace → members**. A Linear team groups issues
|
||||
and has its own workflow; it is not another installation to configure in nanobot.
|
||||
The app can only work within the teams authorized in Linear. A member switch
|
||||
does not expand that team access or grant access to the nanobot admin UI.
|
||||
You manage two levels here: **workspace → members**. A Linear team groups issues and has its own workflow; it is not another installation to configure in nanobot. The app can only work within the teams authorized in Linear. A member switch does not expand that team access or grant access to the nanobot admin UI.
|
||||
|
||||
Pairing codes remain available as an alternative: a member without an explicit
|
||||
switch setting can send a first prompt, have an administrator approve the code,
|
||||
and repeat the prompt. An explicit **off** switch overrides pairing approval;
|
||||
turn the switch on again to restore access.
|
||||
Pairing codes remain available as an alternative: a member without an explicit switch setting can send a first prompt, have an administrator approve the code, and repeat the prompt. An explicit **off** switch overrides pairing approval; turn the switch on again to restore access.
|
||||
|
||||
### 6. Test the first task
|
||||
|
||||
@@ -266,151 +178,63 @@ turn the switch on again to restore access.
|
||||
```
|
||||
|
||||
You can instead delegate the issue to the app to start the Agent Session.
|
||||
3. Open the Agent Session. You should first see a starting acknowledgement,
|
||||
followed by agent activity and a final response.
|
||||
4. Send a follow-up inside that Agent Session. You do not need to @mention the
|
||||
app again there.
|
||||
3. Open the Agent Session. You should first see a starting acknowledgement, followed by agent activity and a final response.
|
||||
4. Send a follow-up inside that Agent Session. You do not need to @mention the app again there.
|
||||
|
||||
### Member access details
|
||||
|
||||
The list contains active human members of teams this app can access. It does not
|
||||
grant access to additional Linear teams or to the nanobot admin UI. Names are for
|
||||
display; permissions use stable user IDs scoped to the OAuth client and workspace.
|
||||
Profile images come from Linear's `avatarUrl` field and load directly from its
|
||||
`public.linear.app` or `uploads.linear.app` CDN without a referrer. Missing,
|
||||
unsupported or failed images fall back to initials; no extra account linking is needed.
|
||||
Workspace logos use Linear's optional `Organization.logoUrl` field with the same
|
||||
CDN restrictions. They load independently of the workspace and member lists; a
|
||||
missing or unavailable logo falls back to a workspace icon. Existing installations
|
||||
do not need to authorize again to retrieve a logo.
|
||||
Use **Refresh members** to refresh the directory and effective permission state.
|
||||
The UI prefetches on hover or keyboard focus and keeps visited lists in memory,
|
||||
scoped to this gateway, admin login, app configuration and workspace. Lists older
|
||||
than one minute stay visible while refreshing. This display cache is not used to
|
||||
authorize agent requests.
|
||||
Workspace cards are also cached for one minute within the current gateway, admin
|
||||
login and app configuration. Refreshing keeps existing cards visible, and a slow
|
||||
logo request never blocks member access controls. Expand **Advanced** to inspect
|
||||
OAuth scopes; authorization problems remain visible on the workspace card.
|
||||
The list contains active human members of teams this app can access. It does not grant access to additional Linear teams or to the nanobot admin UI. Names are for display; permissions use stable user IDs scoped to the OAuth client and workspace. Profile images come from Linear's `avatarUrl` field and load directly from its `public.linear.app` or `uploads.linear.app` CDN without a referrer. Missing, unsupported or failed images fall back to initials; no extra account linking is needed. Workspace logos use Linear's optional `Organization.logoUrl` field with the same CDN restrictions. They load independently of the workspace and member lists; a missing or unavailable logo falls back to a workspace icon. Existing installations do not need to authorize again to retrieve a logo. Use **Refresh members** to refresh the directory and effective permission state. The UI prefetches on hover or keyboard focus and keeps visited lists in memory, scoped to this gateway, admin login, app configuration and workspace. Lists older than one minute stay visible while refreshing. This display cache is not used to authorize agent requests. Workspace cards are also cached for one minute within the current gateway, admin login and app configuration. Refreshing keeps existing cards visible, and a slow logo request never blocks member access controls. Expand **Advanced** to inspect OAuth scopes; authorization problems remain visible on the workspace card.
|
||||
|
||||
Each switch changes only after the server confirms the save; other members remain
|
||||
editable while it saves. A failed save may have an uncertain outcome (for example,
|
||||
after a timeout), so refresh before editing that member again. Failed refreshes keep
|
||||
the last confirmed list visible and show an error, rather than an empty directory.
|
||||
Each switch changes only after the server confirms the save; other members remain editable while it saves. A failed save may have an uncertain outcome (for example, after a timeout), so refresh before editing that member again. Failed refreshes keep the last confirmed list visible and show an error, rather than an empty directory.
|
||||
|
||||
New members are off by default. Existing pairing approvals and **Advanced →
|
||||
Allowed Linear users** remain valid until explicitly overridden by a member
|
||||
switch. An explicit **off** wins over both legacy approvals and `*`, even if a
|
||||
new pairing code is subsequently approved. Use the switch to enable that member
|
||||
again. If you keep `*`, new members will still be allowed automatically; the UI
|
||||
displays a warning. Remove `*` to require approval for new members.
|
||||
New members are off by default. Existing pairing approvals and **Advanced → Allowed Linear users** remain valid until explicitly overridden by a member switch. An explicit **off** wins over both legacy approvals and `*`, even if a new pairing code is subsequently approved. Use the switch to enable that member again. If you keep `*`, new members will still be allowed automatically; the UI displays a warning. Remove `*` to require approval for new members.
|
||||
|
||||
Pairing remains a fallback for members without an explicit switch setting:
|
||||
approve their pending request in the WebUI pairing dialog, then repeat the prompt
|
||||
in the same Agent Session. You may also keep a static list of IDs in **Allowed
|
||||
Linear users**. Other channels' pairing behavior is unchanged.
|
||||
Pairing remains a fallback for members without an explicit switch setting: approve their pending request in the WebUI pairing dialog, then repeat the prompt in the same Agent Session. You may also keep a static list of IDs in **Allowed Linear users**. Other channels' pairing behavior is unchanged.
|
||||
|
||||
At request admission nanobot checks current team membership through the app's
|
||||
Linear API authorization, including active status and excluding app accounts.
|
||||
Directory/API failure does not authorize a task; transient failures use the
|
||||
channel's bounded webhook retry path. This adds API requests and latency, rather
|
||||
than relying on stale cached permissions. Turning a member off blocks new
|
||||
requests (including stop requests); it does not cancel already admitted/running
|
||||
tasks or recall replies. Administrators should stop ongoing tasks separately.
|
||||
At request admission nanobot checks current team membership through the app's Linear API authorization, including active status and excluding app accounts. Directory/API failure does not authorize a task; transient failures use the channel's bounded webhook retry path. This adds API requests and latency, rather than relying on stale cached permissions. Turning a member off blocks new requests (including stop requests); it does not cancel already admitted/running tasks or recall replies. Administrators should stop ongoing tasks separately.
|
||||
|
||||
By default, reasoning is posted as Linear thought activities. Turn off **Show
|
||||
reasoning** under **Advanced** for a quieter session. Use **Configure Linear
|
||||
MCP**, to the left of **Create Linear app**, to open Linear MCP's connection
|
||||
settings when prompts need to search, edit, or transition issues. Pairing and
|
||||
access guidance is available in the dialog's **Help** menu.
|
||||
By default, reasoning is posted as Linear thought activities. Turn off **Show reasoning** under **Advanced** for a quieter session. Use **Configure Linear MCP**, to the left of **Create Linear app**, to open Linear MCP's connection settings when prompts need to search, edit, or transition issues. Pairing and access guidance is available in the dialog's **Help** menu.
|
||||
|
||||
## Connect, remove, or reset workspaces
|
||||
|
||||
Each nanobot instance uses one configured Linear OAuth app, which may have
|
||||
multiple workspace installations. A **private** app can only be installed in its
|
||||
own workspace. To use the same app in another workspace, its distribution must
|
||||
allow that installation in Linear; changing a nanobot field cannot bypass this.
|
||||
Each nanobot instance uses one configured Linear OAuth app, which may have multiple workspace installations. A **private** app can only be installed in its own workspace. To use the same app in another workspace, its distribution must allow that installation in Linear; changing a nanobot field cannot bypass this.
|
||||
|
||||
- **Connect workspace** uses the current app and opens the same browser
|
||||
authorization flow. Choose the other workspace in Linear, review team access,
|
||||
and authorize. You do not need another HTTPS address or another set of app
|
||||
credentials for the same app. Review member access in the new workspace.
|
||||
- **… → Reauthorize** on a workspace updates its connection, without creating a
|
||||
duplicate or clearing its member choices. Use it to renew authorization or
|
||||
grant missing scopes. Cancelling authorization leaves existing connections alone.
|
||||
- **… → Remove workspace** revokes that workspace's tokens and clears its local
|
||||
installation and member switches. Other workspaces are unaffected. Removing
|
||||
the last workspace also stops the channel. App credentials remain available
|
||||
for connecting again.
|
||||
- **Advanced → Reset Linear connection** removes all installations for the
|
||||
current app, stops the channel, and clears this instance's Linear app settings,
|
||||
including its saved credentials. Use this when starting over or switching apps.
|
||||
If a step fails, the UI reports an incomplete reset; removed workspaces stay
|
||||
removed, and you can retry the remaining steps.
|
||||
- **Connect workspace** uses the current app and opens the same browser authorization flow. Choose the other workspace in Linear, review team access, and authorize. You do not need another HTTPS address or another set of app credentials for the same app. Review member access in the new workspace.
|
||||
- **… → Reauthorize** on a workspace updates its connection, without creating a duplicate or clearing its member choices. Use it to renew authorization or grant missing scopes. Cancelling authorization leaves existing connections alone.
|
||||
- **… → Remove workspace** revokes that workspace's tokens and clears its local installation and member switches. Other workspaces are unaffected. Removing the last workspace also stops the channel. App credentials remain available for connecting again.
|
||||
- **Advanced → Reset Linear connection** removes all installations for the current app, stops the channel, and clears this instance's Linear app settings, including its saved credentials. Use this when starting over or switching apps. If a step fails, the UI reports an incomplete reset; removed workspaces stay removed, and you can retry the remaining steps.
|
||||
|
||||
If authorization changes while a member refresh or removal is in progress,
|
||||
nanobot discards the stale result instead of restoring a removed connection or
|
||||
overwriting a new authorization. Refresh the workspace/member list and retry the
|
||||
action against the current connection.
|
||||
If authorization changes while a member refresh or removal is in progress, nanobot discards the stale result instead of restoring a removed connection or overwriting a new authorization. Refresh the workspace/member list and retry the action against the current connection.
|
||||
|
||||
Neither removal nor reset deletes the Linear workspace, app, issues or comments,
|
||||
nor nanobot conversation history or pairing approvals. Deleting the app itself
|
||||
is a separate action in Linear. After removing and reconnecting a workspace,
|
||||
member switches start fresh, but retained pairing approvals or an `allowFrom`
|
||||
entry can still grant access. **Reset is not a wipe of all authorization history.**
|
||||
Neither removal nor reset deletes the Linear workspace, app, issues or comments, nor nanobot conversation history or pairing approvals. Deleting the app itself is a separate action in Linear. After removing and reconnecting a workspace, member switches start fresh, but retained pairing approvals or an `allowFrom` entry can still grant access. **Reset is not a wipe of all authorization history.**
|
||||
|
||||
## Updating a remote installation
|
||||
|
||||
Member management includes both Python channel code and WebUI assets. A local
|
||||
branch does not update an already running remote gateway, and the browser UI
|
||||
served by that remote gateway is not replaced by installing a local client.
|
||||
Member management includes both Python channel code and WebUI assets. A local branch does not update an already running remote gateway, and the browser UI served by that remote gateway is not replaced by installing a local client.
|
||||
|
||||
1. Develop and test in a separate checkout with test-only config/state. Do not
|
||||
copy production OAuth tokens, model keys, or pairing state into a development
|
||||
profile, or run a second gateway against the production webhook installation.
|
||||
2. After review and deployment approval, back up the remote config, pairing file,
|
||||
and Linear SQLite state consistently (stop the gateway or use SQLite backup;
|
||||
copying just the database while WAL writes are active is not sufficient).
|
||||
3. Update the remote source and dependencies to the reviewed revision, build the
|
||||
WebUI from that same revision, and restart the gateway. Preserve remote
|
||||
credentials and state. Existing OAuth scopes and webhook routes need not change.
|
||||
4. Verify member listing, the existing owner's access, enable/disable behavior,
|
||||
and that the admin UI remains private. Grant teammate access only deliberately.
|
||||
1. Develop and test in a separate checkout with test-only config/state. Do not copy production OAuth tokens, model keys, or pairing state into a development profile, or run a second gateway against the production webhook installation.
|
||||
2. After review and deployment approval, back up the remote config, pairing file, and Linear SQLite state consistently (stop the gateway or use SQLite backup; copying just the database while WAL writes are active is not sufficient).
|
||||
3. Update the remote source and dependencies to the reviewed revision, build the WebUI from that same revision, and restart the gateway. Preserve remote credentials and state. Existing OAuth scopes and webhook routes need not change.
|
||||
4. Verify member listing, the existing owner's access, enable/disable behavior, and that the admin UI remains private. Grant teammate access only deliberately.
|
||||
|
||||
Member switches are stored in the instance's `linear/state.sqlite3`, separately
|
||||
from legacy pairing and config. Older code ignores those overrides: **do not
|
||||
blindly roll back after revoking access with a switch**, because old code could
|
||||
re-enable a member through a retained pairing approval or wildcard. Keep the
|
||||
channel disabled during rollback until the older allowlist/pairing configuration
|
||||
has been reconciled. Ordinary restarts and reconnecting the same OAuth app keep
|
||||
the saved member choices.
|
||||
Member switches are stored in the instance's `linear/state.sqlite3`, separately from legacy pairing and config. Older code ignores those overrides: **do not blindly roll back after revoking access with a switch**, because old code could re-enable a member through a retained pairing approval or wildcard. Keep the channel disabled during rollback until the older allowlist/pairing configuration has been reconciled. Ordinary restarts and reconnecting the same OAuth app keep the saved member choices.
|
||||
|
||||
## Verify the setup
|
||||
|
||||
The setup is complete when all of these checks pass:
|
||||
|
||||
- **Settings → Channels → Linear** shows the channel as on with no runtime error.
|
||||
- The Linear app's **Webhooks → Delivery status** is enabled, its URL uses the
|
||||
current public origin, and **Events** includes **Agent session events**.
|
||||
- While the channel is running, opening
|
||||
`http://127.0.0.1:3979/linear/health` on the nanobot machine returns
|
||||
`{"ok":true}`. Use your configured host and port if you changed them.
|
||||
- If your proxy also forwards `/linear/health`, its public URL returns
|
||||
`{"ok":true}`. This is optional: a proxy exposing only the callback and webhook
|
||||
can correctly return 404 for public health. Use successful OAuth and webhook
|
||||
delivery to verify those two routes; do not expose the admin UI for this check.
|
||||
- A new comment with an explicit @mention creates an Agent Session and receives
|
||||
a response.
|
||||
- The Linear app's **Webhooks → Delivery status** is enabled, its URL uses the current public origin, and **Events** includes **Agent session events**.
|
||||
- While the channel is running, opening `http://127.0.0.1:3979/linear/health` on the nanobot machine returns `{"ok":true}`. Use your configured host and port if you changed them.
|
||||
- If your proxy also forwards `/linear/health`, its public URL returns `{"ok":true}`. This is optional: a proxy exposing only the callback and webhook can correctly return 404 for public health. Use successful OAuth and webhook delivery to verify those two routes; do not expose the admin UI for this check.
|
||||
- A new comment with an explicit @mention creates an Agent Session and receives a response.
|
||||
- Delegating an issue to the app creates an Agent Session and receives a response.
|
||||
- A normal issue comment without an @mention does nothing.
|
||||
- A follow-up inside the Agent Session receives a response without another
|
||||
@mention.
|
||||
- A follow-up inside the Agent Session receives a response without another @mention.
|
||||
|
||||
## Manual configuration
|
||||
|
||||
Use this path when deployment tooling manages `~/.nanobot/config.json` directly.
|
||||
The WebUI path above is easier because it generates the Linear app definition
|
||||
and completes OAuth for you.
|
||||
Use this path when deployment tooling manages `~/.nanobot/config.json` directly. The WebUI path above is easier because it generates the Linear app definition and completes OAuth for you.
|
||||
|
||||
Merge this section into `~/.nanobot/config.json`:
|
||||
|
||||
@@ -441,31 +265,18 @@ OAuth callback: https://nanobot.example.com/linear/oauth/callback
|
||||
Webhook: https://nanobot.example.com/linear/webhook
|
||||
```
|
||||
|
||||
Subscribe the webhook to exactly `AgentSessionEvent`, `PermissionChange`, and
|
||||
`OAuthAuthorization` and enable webhook delivery in the Linear app's settings.
|
||||
Do not subscribe to `Comment`. The OAuth connection step
|
||||
in the WebUI is still required: it installs the app and stores the
|
||||
workspace-scoped access and refresh tokens.
|
||||
Subscribe the webhook to exactly `AgentSessionEvent`, `PermissionChange`, and `OAuthAuthorization` and enable webhook delivery in the Linear app's settings. Do not subscribe to `Comment`. The OAuth connection step in the WebUI is still required: it installs the app and stores the workspace-scoped access and refresh tokens.
|
||||
|
||||
## Security and reliability
|
||||
|
||||
- OAuth uses authorization code flow, PKCE, a short-lived CSRF state, and the
|
||||
Linear app actor.
|
||||
- Webhooks are verified against `Linear-Signature` using the raw request body
|
||||
before JSON parsing. nanobot also checks the delivery timestamp and configured
|
||||
OAuth Client ID.
|
||||
- OAuth uses authorization code flow, PKCE, a short-lived CSRF state, and the Linear app actor.
|
||||
- Webhooks are verified against `Linear-Signature` using the raw request body before JSON parsing. nanobot also checks the delivery timestamp and configured OAuth Client ID.
|
||||
- `Linear-Delivery` IDs are deduplicated.
|
||||
- Verified events are committed to a local SQLite queue before nanobot returns
|
||||
HTTP 200. Queued webhook deliveries that have not yet been dispatched are
|
||||
retried after a restart. This does not guarantee resumption of an interrupted
|
||||
agent turn.
|
||||
- Access and rotating refresh tokens are stored in the Linear channel state
|
||||
database, not in `config.json` or the browser.
|
||||
- Verified events are committed to a local SQLite queue before nanobot returns HTTP 200. Queued webhook deliveries that have not yet been dispatched are retried after a restart. This does not guarantee resumption of an interrupted agent turn.
|
||||
- Access and rotating refresh tokens are stored in the Linear channel state database, not in `config.json` or the browser.
|
||||
- OAuth revocation removes the affected workspace installation locally.
|
||||
|
||||
Back up the nanobot instance data directory as carefully as other credentials.
|
||||
Do not publish `linear/state.sqlite3`, the Client Secret, or the Webhook signing
|
||||
secret.
|
||||
Back up the nanobot instance data directory as carefully as other credentials. Do not publish `linear/state.sqlite3`, the Client Secret, or the Webhook signing secret.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
@@ -489,8 +300,4 @@ secret.
|
||||
| The agent can discuss an issue but cannot search or change it | Connect the Linear MCP app from **Configure Linear MCP**. The native channel transports the conversation but does not add issue-management tools. |
|
||||
| Authorization reports missing scopes | Reconnect from nanobot. Do not reuse an authorization URL that omits `read`, `write`, `app:mentionable`, or `app:assignable`. |
|
||||
|
||||
For Linear's platform-side behavior, see the official
|
||||
[Agents guide](https://linear.app/developers/agents),
|
||||
[OAuth app manifest reference](https://linear.app/developers/oauth-app-manifests),
|
||||
[OAuth guide](https://linear.app/developers/oauth-2-0-authentication), and
|
||||
[webhook reference](https://linear.app/developers/webhooks).
|
||||
For Linear's platform-side behavior, see the official [Agents guide](https://linear.app/developers/agents), [OAuth app manifest reference](https://linear.app/developers/oauth-app-manifests), [OAuth guide](https://linear.app/developers/oauth-2-0-authentication), and [webhook reference](https://linear.app/developers/webhooks).
|
||||
@@ -1,8 +1,6 @@
|
||||
# How to Run a Long-Running AI Agent with nanobot
|
||||
|
||||
nanobot can keep agent work alive across turns through sustained goals,
|
||||
persistent sessions, scheduled automations, local triggers, and a gateway
|
||||
process that stays running.
|
||||
nanobot can keep agent work alive across turns through sustained goals, persistent sessions, scheduled automations, local triggers, and a gateway process that stays running.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -13,9 +11,7 @@ process that stays running.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use this when the task is not a one-shot answer: project work, recurring checks,
|
||||
scheduled summaries, file maintenance, multi-step research, or local triggers
|
||||
from scripts and build jobs.
|
||||
Use this when the task is not a one-shot answer: project work, recurring checks, scheduled summaries, file maintenance, multi-step research, or local triggers from scripts and build jobs.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -39,13 +35,11 @@ From the WebUI or a chat session, start a sustained goal:
|
||||
/goal Review this workspace, identify missing tests, and propose the smallest next fix.
|
||||
```
|
||||
|
||||
For scheduled or trigger-based runs, create the automation from the target chat
|
||||
so nanobot can link it to the correct session and workspace.
|
||||
For scheduled or trigger-based runs, create the automation from the target chat so nanobot can link it to the correct session and workspace.
|
||||
|
||||
## Production notes
|
||||
|
||||
- Keep the gateway running for chat apps, WebUI sessions, automations, and local
|
||||
triggers.
|
||||
- Keep the gateway running for chat apps, WebUI sessions, automations, and local triggers.
|
||||
- Use stable session keys or chat sessions for work that should preserve context.
|
||||
- Keep goals bounded and explicit about done-ness.
|
||||
- Review Automations in the WebUI before relying on a schedule.
|
||||
@@ -59,10 +53,8 @@ so nanobot can link it to the correct session and workspace.
|
||||
## Troubleshooting
|
||||
|
||||
- If a goal appears stuck, inspect the active session and gateway logs.
|
||||
- If an automation does not run, check that it is linked to a chat/session and
|
||||
that the gateway is still running.
|
||||
- If a local trigger fails, check the command copied from the WebUI Automations
|
||||
view.
|
||||
- If an automation does not run, check that it is linked to a chat/session and that the gateway is still running.
|
||||
- If a local trigger fails, check the command copied from the WebUI Automations view.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Build a Mattermost AI Agent with nanobot
|
||||
|
||||
This guide connects nanobot to Mattermost through the built-in Mattermost
|
||||
channel, using WebSocket events and the Mattermost REST API.
|
||||
This guide connects nanobot to Mattermost through the built-in Mattermost channel, using WebSocket events and the Mattermost REST API.
|
||||
|
||||
## What this guide builds
|
||||
|
||||
@@ -51,20 +50,11 @@ Merge this snippet into `~/.nanobot/config.json`:
|
||||
}
|
||||
```
|
||||
|
||||
`teamId` scopes the channel to a Mattermost team. Keep `groupPolicy` as
|
||||
`mention` for the first test. `groupPolicyInThread` can be `"mention"`,
|
||||
`"open"`, or `"allowlist"` and controls messages that reply inside a
|
||||
thread. If it is omitted, it inherits `groupPolicy`, preserving the behavior
|
||||
of existing configurations. Set it to `"open"` explicitly when follow-up
|
||||
messages in threads should not require another @mention.
|
||||
`teamId` scopes the channel to a Mattermost team. Keep `groupPolicy` as `mention` for the first test. `groupPolicyInThread` can be `"mention"`, `"open"`, or `"allowlist"` and controls messages that reply inside a thread. If it is omitted, it inherits `groupPolicy`, preserving the behavior of existing configurations. Set it to `"open"` explicitly when follow-up messages in threads should not require another @mention.
|
||||
|
||||
When `groupPolicy` is `"allowlist"`, `groupAllowFrom` remains the outer
|
||||
channel boundary for root posts and thread replies. A thread policy cannot open
|
||||
a channel that is not on that allowlist.
|
||||
When `groupPolicy` is `"allowlist"`, `groupAllowFrom` remains the outer channel boundary for root posts and thread replies. A thread policy cannot open a channel that is not on that allowlist.
|
||||
|
||||
Mattermost DMs are open by default. Setting `dm.policy` to `"allowlist"` with no
|
||||
`dm.allowFrom` entries makes new DM senders receive a pairing code. Approve the
|
||||
code before using the bot normally.
|
||||
Mattermost DMs are open by default. Setting `dm.policy` to `"allowlist"` with no `dm.allowFrom` entries makes new DM senders receive a pairing code. Approve the code before using the bot normally.
|
||||
|
||||
## Run nanobot gateway
|
||||
|
||||
@@ -75,8 +65,7 @@ nanobot gateway
|
||||
|
||||
## Test a message
|
||||
|
||||
DM the bot account. It should return a pairing code. Approve it from a trusted
|
||||
local surface:
|
||||
DM the bot account. It should return a pairing code. Approve it from a trusted local surface:
|
||||
|
||||
```bash
|
||||
nanobot agent -m "/pairing approve ABCD-EFGH"
|
||||
@@ -97,13 +86,10 @@ Then DM the bot again, or mention it in a channel where the bot has access:
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If startup logs say `serverUrl and token must be configured`, check the
|
||||
camelCase config keys.
|
||||
- If startup logs say `serverUrl and token must be configured`, check the camelCase config keys.
|
||||
- If DMs are ignored, review the `dm` policy and pairing approval state.
|
||||
- If channel messages are ignored, confirm the bot is mentioned and belongs to
|
||||
the team/channel.
|
||||
- If thread replies are surprising, review `groupPolicyInThread`,
|
||||
`replyInThread`, and `includeThreadContext`.
|
||||
- If channel messages are ignored, confirm the bot is mentioned and belongs to the team/channel.
|
||||
- If thread replies are surprising, review `groupPolicyInThread`, `replyInThread`, and `includeThreadContext`.
|
||||
|
||||
## Next: memory, automations, MCP tools
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# How to Add MCP Tools to an AI Agent with nanobot
|
||||
|
||||
nanobot can connect MCP servers and expose their tools to the agent alongside
|
||||
built-in file, shell, web, cron, image generation, and subagent tools.
|
||||
nanobot can connect MCP servers and expose their tools to the agent alongside built-in file, shell, web, cron, image generation, and subagent tools.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -11,9 +10,7 @@ built-in file, shell, web, cron, image generation, and subagent tools.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use MCP when a tool already exists as an MCP server, when another application
|
||||
publishes an MCP adapter, or when you want a clean boundary between nanobot and
|
||||
external tool logic.
|
||||
Use MCP when a tool already exists as an MCP server, when another application publishes an MCP adapter, or when you want a clean boundary between nanobot and external tool logic.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -23,8 +20,7 @@ nanobot onboard --wizard
|
||||
nanobot agent -m "Hello!"
|
||||
```
|
||||
|
||||
Install the MCP server's own runtime separately. For example, many local MCP
|
||||
servers use `npx` or `uvx`.
|
||||
Install the MCP server's own runtime separately. For example, many local MCP servers use `npx` or `uvx`.
|
||||
|
||||
## Minimal working example
|
||||
|
||||
@@ -58,15 +54,13 @@ Restart nanobot, then ask a question that needs the MCP tool.
|
||||
- HTTP/SSE MCP URLs use the same SSRF guard as web fetch.
|
||||
- Local/private HTTP endpoints require an explicit `tools.ssrfWhitelist` entry.
|
||||
- Stdio MCP servers run local processes; review their command and arguments.
|
||||
- Do not pass secrets in command-line args when environment variables or headers
|
||||
are available.
|
||||
- Do not pass secrets in command-line args when environment variables or headers are available.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Start `nanobot gateway --verbose` and check MCP startup logs.
|
||||
- Confirm the MCP command works by itself before debugging nanobot.
|
||||
- If an HTTP MCP server is blocked, review the SSRF whitelist and use a narrow
|
||||
host CIDR.
|
||||
- If an HTTP MCP server is blocked, review the SSRF whitelist and use a narrow host CIDR.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# How to Run an OpenAI-Compatible Agent API with nanobot
|
||||
|
||||
nanobot can expose a local OpenAI-compatible endpoint behind
|
||||
`/v1/chat/completions`. This lets existing OpenAI-style clients talk to a
|
||||
tool-using nanobot agent instead of a raw model.
|
||||
nanobot can expose a local OpenAI-compatible endpoint behind `/v1/chat/completions`. This lets existing OpenAI-style clients talk to a tool-using nanobot agent instead of a raw model.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -13,9 +11,7 @@ tool-using nanobot agent instead of a raw model.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use this when an existing client, another language, or a separate process
|
||||
already knows how to call an OpenAI-compatible API. Use the Python SDK when you
|
||||
want in-process access to sessions, memory, runtime helpers, and hooks.
|
||||
Use this when an existing client, another language, or a separate process already knows how to call an OpenAI-compatible API. Use the Python SDK when you want in-process access to sessions, memory, runtime helpers, and hooks.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -56,14 +52,12 @@ curl http://127.0.0.1:8900/v1/chat/completions \
|
||||
|
||||
- Local `127.0.0.1` usage does not require an API key.
|
||||
- If `api.host` is `0.0.0.0` or `::`, configure `api.apiKey` before startup.
|
||||
- Treat the API as agent access, not just model access: tools and workspace
|
||||
permissions still matter.
|
||||
- Treat the API as agent access, not just model access: tools and workspace permissions still matter.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If `/v1/chat/completions` fails, test `nanobot agent -m "Hello!"` first.
|
||||
- If remote clients cannot connect, check `api.host`, `api.port`, firewall, and
|
||||
API key configuration.
|
||||
- If remote clients cannot connect, check `api.host`, `api.port`, firewall, and API key configuration.
|
||||
- If sessions mix together, pass unique `session_id` values.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
# Nanobot Python SDK: Run an AI Agent from Python
|
||||
|
||||
This guide shows when to use the Nanobot Python SDK instead of calling a model
|
||||
directly. The SDK runs the same agent runtime used by the CLI: model routing,
|
||||
tools, workspace access, session history, memory, streaming events, and runtime
|
||||
helpers.
|
||||
This guide shows when to use the Nanobot Python SDK instead of calling a model directly. The SDK runs the same agent runtime used by the CLI: model routing, tools, workspace access, session history, memory, streaming events, and runtime helpers.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -13,12 +10,9 @@ helpers.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use the Python SDK for notebooks, evals, product backends, local scripts,
|
||||
workflow runners, and integrations that need direct access to agent sessions,
|
||||
memory, hooks, runtime state, or structured run results.
|
||||
Use the Python SDK for notebooks, evals, product backends, local scripts, workflow runners, and integrations that need direct access to agent sessions, memory, hooks, runtime state, or structured run results.
|
||||
|
||||
Use the OpenAI-compatible API instead when another language or process should
|
||||
call nanobot over HTTP.
|
||||
Use the OpenAI-compatible API instead when another language or process should call nanobot over HTTP.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -49,8 +43,7 @@ asyncio.run(main())
|
||||
|
||||
- Reuse one `Nanobot` instance for related work.
|
||||
- Pass `session_key` when a user, job, or eval case needs persistent history.
|
||||
- Use `bot.stream(...)` when the caller needs live text, tool, or failure
|
||||
events.
|
||||
- Use `bot.stream(...)` when the caller needs live text, tool, or failure events.
|
||||
- Use hooks for audit logs or custom observability.
|
||||
|
||||
## Security notes
|
||||
@@ -61,10 +54,8 @@ asyncio.run(main())
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If SDK code fails, first run `nanobot agent -m "Hello!"` in the same
|
||||
environment.
|
||||
- Print `bot.runtime.workspace` and `bot.runtime.model` to confirm the expected
|
||||
config loaded.
|
||||
- If SDK code fails, first run `nanobot agent -m "Hello!"` in the same environment.
|
||||
- Print `bot.runtime.workspace` and `bot.runtime.model` to confirm the expected config loaded.
|
||||
- Use explicit `config_path` and `workspace` when scripts run from services.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
# Build a QQ AI Agent with nanobot
|
||||
|
||||
This guide connects nanobot to QQ through the official `qq` channel. The
|
||||
official channel uses the botpy SDK and currently focuses on private messages.
|
||||
For QQ group chat and OneBot v11 workflows, use the Napcat section in the full
|
||||
chat-apps reference.
|
||||
This guide connects nanobot to QQ through the official `qq` channel. The official channel uses the botpy SDK and currently focuses on private messages. For QQ group chat and OneBot v11 workflows, use the Napcat section in the full chat-apps reference.
|
||||
|
||||
## What this guide builds
|
||||
|
||||
@@ -38,9 +35,7 @@ Install the optional channel dependency:
|
||||
nanobot plugins enable qq
|
||||
```
|
||||
|
||||
In the QQ Open Platform, create a bot application and copy the AppID and
|
||||
AppSecret. Add your QQ account to the sandbox test members, then merge this
|
||||
snippet into `~/.nanobot/config.json`:
|
||||
In the QQ Open Platform, create a bot application and copy the AppID and AppSecret. Add your QQ account to the sandbox test members, then merge this snippet into `~/.nanobot/config.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -55,8 +50,7 @@ snippet into `~/.nanobot/config.json`:
|
||||
}
|
||||
```
|
||||
|
||||
Omitting `allowFrom` enables pairing-only mode. A new private sender should get
|
||||
a pairing code before normal agent access.
|
||||
Omitting `allowFrom` enables pairing-only mode. A new private sender should get a pairing code before normal agent access.
|
||||
|
||||
## Run nanobot gateway
|
||||
|
||||
@@ -67,8 +61,7 @@ nanobot gateway
|
||||
|
||||
## Test a message
|
||||
|
||||
Send the QQ bot a private message from a sandbox account. It should return a
|
||||
pairing code. Approve it from a trusted local surface:
|
||||
Send the QQ bot a private message from a sandbox account. It should return a pairing code. Approve it from a trusted local surface:
|
||||
|
||||
```bash
|
||||
nanobot agent -m "/pairing approve ABCD-EFGH"
|
||||
@@ -78,20 +71,16 @@ Send the message again after approval.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Prefer pairing-only mode for first setup. Add `allowFrom` only when you want a
|
||||
static allowlist.
|
||||
- Prefer pairing-only mode for first setup. Add `allowFrom` only when you want a static allowlist.
|
||||
- Keep sandbox testing separate from production publishing.
|
||||
- Store QQ AppSecret through environment variables for deployed services.
|
||||
- Use Napcat only when you intentionally need a QQ account bridge and group chat
|
||||
features.
|
||||
- Use Napcat only when you intentionally need a QQ account bridge and group chat features.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If private messages do not arrive, confirm the sender is in the QQ bot sandbox
|
||||
and the gateway is running.
|
||||
- If private messages do not arrive, confirm the sender is in the QQ bot sandbox and the gateway is running.
|
||||
- If output formatting is unreliable, keep `msgFormat` as `"plain"`.
|
||||
- If a first private message returns a pairing code, approve it before testing
|
||||
normal replies.
|
||||
- If a first private message returns a pairing code, approve it before testing normal replies.
|
||||
- If you need QQ groups, see the Napcat section in the full chat-apps reference.
|
||||
|
||||
## Next: memory, automations, MCP tools
|
||||
|
||||
+61
-374
@@ -1,248 +1,78 @@
|
||||
# Connect to an existing remote nanobot
|
||||
|
||||
Open your local **nanobot WebUI**, click the current host (initially **Local**)
|
||||
at the bottom of the sidebar, and choose **Manage connections…**. This is the
|
||||
single entry point for switching and managing hosts. The page lists this computer
|
||||
and your saved servers. Choose
|
||||
**Connect to remote nanobot** to copy a prepared pairing command, or choose **Other ways → Use existing SSH settings**
|
||||
to enter an SSH address such as
|
||||
`ubuntu@your-server` or pick a suggested host from your SSH config. Choose
|
||||
**Connect**. Next time, select the saved server directly. No port-forwarding
|
||||
command or `.command` launcher is needed.
|
||||
Open your local **nanobot WebUI**, click the current host (initially **Local**) at the bottom of the sidebar, and choose **Manage connections…**. This is the single entry point for switching and managing hosts. The page lists this computer and your saved servers. Choose **Connect to remote nanobot** to copy a prepared pairing command, or choose **Other ways → Use existing SSH settings** to enter an SSH address such as `ubuntu@your-server` or pick a suggested host from your SSH config. Choose **Connect**. Next time, select the saved server directly. No port-forwarding command or `.command` launcher is needed.
|
||||
|
||||
With more than five saved servers, the host menu includes search by name or SSH
|
||||
address. The current server and recently used servers appear first; the local
|
||||
computer stays at the top. Only the host list scrolls, so **Manage connections…**
|
||||
stays visible. Use the arrow keys to choose a result, Enter to connect, and Escape
|
||||
to close. Recent choices are remembered in this browser, not synced to servers.
|
||||
With more than five saved servers, the host menu includes search by name or SSH address. The current server and recently used servers appear first; the local computer stays at the top. Only the host list scrolls, so **Manage connections…** stays visible. Use the arrow keys to choose a result, Enter to connect, and Escape to close. Recent choices are remembered in this browser, not synced to servers.
|
||||
|
||||
To add another server, choose **Connect to remote nanobot** below your saved connections. Use a
|
||||
server's menu to edit or forget it. Editing opens the same dialog; **Save changes**
|
||||
saves without connecting or switching hosts. Disconnect an open server before
|
||||
editing its connection settings. The page supports browser back/forward and the
|
||||
`#/remote` route. Cancelling setup while saving or connecting prevents a later
|
||||
automatic switch. A profile or SSH tunnel already created is not rolled back;
|
||||
you can manage it from the directory. Adding the same connection settings again
|
||||
reuses that entry, without renaming it or disconnecting an open view.
|
||||
To add another server, choose **Connect to remote nanobot** below your saved connections. Use a server's menu to edit or forget it. Editing opens the same dialog; **Save changes** saves without connecting or switching hosts. Disconnect an open server before editing its connection settings. The page supports browser back/forward and the `#/remote` route. Cancelling setup while saving or connecting prevents a later automatic switch. A profile or SSH tunnel already created is not rolled back; you can manage it from the directory. Adding the same connection settings again reuses that entry, without renaming it or disconnecting an open view.
|
||||
|
||||
This connects to the nanobot **already running on the server**. It does not
|
||||
install a worker, clone a workspace, move conversations, or start a second bot.
|
||||
It is separate from remote execution/worker deployment.
|
||||
This connects to the nanobot **already running on the server**. It does not install a worker, clone a workspace, move conversations, or start a second bot. It is separate from remote execution/worker deployment.
|
||||
|
||||
## Quick pairing: copy a command, follow a link back
|
||||
|
||||
Repeated pairing to the same verified destination appears as one server in the
|
||||
directory and host switcher. The confirmation says **This nanobot is already
|
||||
saved**; **Save and open** keeps the new authorization as well as the old ones,
|
||||
preserves the saved name, and reuses a healthy open connection. When reconnecting,
|
||||
the directory prefers a non-expired authorization unless another is already selected.
|
||||
Use **Connection details** in that server's menu to choose or forget one specific
|
||||
connection. Forgetting one does not delete the others or revoke its server-side key.
|
||||
Disconnect an open connection before choosing a different authorization. The
|
||||
20-connection limit counts retained authorizations, not just visible server rows.
|
||||
Repeated pairing to the same verified destination appears as one server in the directory and host switcher. The confirmation says **This nanobot is already saved**; **Save and open** keeps the new authorization as well as the old ones, preserves the saved name, and reuses a healthy open connection. When reconnecting, the directory prefers a non-expired authorization unless another is already selected. Use **Connection details** in that server's menu to choose or forget one specific connection. Forgetting one does not delete the others or revoke its server-side key. Disconnect an open connection before choosing a different authorization. The 20-connection limit counts retained authorizations, not just visible server rows.
|
||||
|
||||
Grouping is read-only: it requires matching encrypted-receipt evidence for the
|
||||
SSH endpoint, pinned host key, account, resolved nanobot configuration, WebUI port
|
||||
and credential. Names/IPs alone and restart-scoped gateway IDs are insufficient.
|
||||
Different instances remain separate, as do unverified manual SSH entries or
|
||||
changed addresses/credentials. No old authorization files are silently deleted.
|
||||
Grouping is read-only: it requires matching encrypted-receipt evidence for the SSH endpoint, pinned host key, account, resolved nanobot configuration, WebUI port and credential. Names/IPs alone and restart-scoped gateway IDs are insufficient. Different instances remain separate, as do unverified manual SSH entries or changed addresses/credentials. No old authorization files are silently deleted.
|
||||
|
||||
For a Linux server with this version of nanobot installed, you do not need to
|
||||
prepare a local SSH key or know the service account/config path:
|
||||
For a Linux server with this version of nanobot installed, you do not need to prepare a local SSH key or know the service account/config path:
|
||||
|
||||
1. In your **local** WebUI choose **Connect to remote nanobot → Copy command**. The command is
|
||||
prepared when setup opens; **View command** lets you inspect it before running.
|
||||
After a successful copy, the dialog shows what to do in your server terminal.
|
||||
This is a clipboard confirmation, not a claim that the server is connected.
|
||||
**Other ways → Requirements & help** contains prerequisites and expiry details.
|
||||
2. Open your cloud provider's server terminal. Run the command in the environment
|
||||
where nanobot is installed (activate its virtual environment for source installs).
|
||||
The command discovers the default config and named nanobot systemd services;
|
||||
choose a configuration if there is more than one. The connection account is
|
||||
detected from your current login, the original login under sudo, or the only
|
||||
regular account. In a root cloud console with several accounts, pairing checks
|
||||
[cloud-init's configured default user](https://docs.cloud-init.io/en/latest/explanation/instancedata.html)
|
||||
and uses it only if it matches an existing regular login account. It queries
|
||||
only the username, not passwords or other instance data. No account name or
|
||||
password needs to be entered when detection succeeds. If the account is still
|
||||
ambiguous, choose from a numbered list; this is an account **on this server**,
|
||||
not your cloud website account. Invalid numbers can be corrected without
|
||||
restarting pairing. No account is created and no device is authorized by making
|
||||
that choice. The account is shown in the authorization summary. A global
|
||||
server address reported by the SSH session can also be selected automatically.
|
||||
On recognized Tencent Cloud Linux instances, pairing can instead read this
|
||||
server's public IPv4 from the fixed, instance-local metadata endpoint, without
|
||||
cloud API keys. Only that public-address field is read; no role credentials or
|
||||
user data are requested. If neither source is available, enter **this server's**
|
||||
public IP from the cloud console, not your computer's IP. Private addresses and
|
||||
public-IP lookup services (which may report a shared NAT/proxy) are not used.
|
||||
The detected address is shown in the authorization summary, not proof that SSH
|
||||
is reachable. Use `--ssh-user` or `--host` to override.
|
||||
3. Review the **full nanobot access** authorization on the server and confirm it.
|
||||
If its config belongs to another service account, the command first asks
|
||||
**Continue as server administrator?**. Confirm to continue via your existing
|
||||
sudo access (your server login password may be required). The same installation,
|
||||
config and SSH login account are retained; you do not need to rewrite the command.
|
||||
Declining leaves everything unchanged. Without sudo access, ask the server
|
||||
administrator to run the command. Pairing does not install sudo rules or weaken
|
||||
config permissions, and device authorization still requires a separate confirmation.
|
||||
4. Open the terminal's **Return to nanobot** link on the same computer and in the
|
||||
same browser profile that started pairing. The local WebUI opens the server
|
||||
confirmation directly; review its identity and access, then choose **Connect**.
|
||||
The link does not authorize or connect automatically. If the terminal cannot
|
||||
open links, choose **Other ways → Use a connection code instead** and paste the returned
|
||||
`nbpc1.…` code, then **Review connection**. Both paths use the same verification.
|
||||
1. In your **local** WebUI choose **Connect to remote nanobot → Copy command**. The command is prepared when setup opens; **View command** lets you inspect it before running. After a successful copy, the dialog shows what to do in your server terminal. This is a clipboard confirmation, not a claim that the server is connected. **Other ways → Requirements & help** contains prerequisites and expiry details.
|
||||
2. Open your cloud provider's server terminal. Run the command in the environment where nanobot is installed (activate its virtual environment for source installs). The command discovers the default config and named nanobot systemd services; choose a configuration if there is more than one. The connection account is detected from your current login, the original login under sudo, or the only regular account. In a root cloud console with several accounts, pairing checks [cloud-init's configured default user](https://docs.cloud-init.io/en/latest/explanation/instancedata.html) and uses it only if it matches an existing regular login account. It queries only the username, not passwords or other instance data. No account name or password needs to be entered when detection succeeds. If the account is still ambiguous, choose from a numbered list; this is an account **on this server**, not your cloud website account. Invalid numbers can be corrected without restarting pairing. No account is created and no device is authorized by making that choice. The account is shown in the authorization summary. A global server address reported by the SSH session can also be selected automatically. On recognized Tencent Cloud Linux instances, pairing can instead read this server's public IPv4 from the fixed, instance-local metadata endpoint, without cloud API keys. Only that public-address field is read; no role credentials or user data are requested. If neither source is available, enter **this server's** public IP from the cloud console, not your computer's IP. Private addresses and public-IP lookup services (which may report a shared NAT/proxy) are not used. The detected address is shown in the authorization summary, not proof that SSH is reachable. Use `--ssh-user` or `--host` to override.
|
||||
3. Review the **full nanobot access** authorization on the server and confirm it. If its config belongs to another service account, the command first asks **Continue as server administrator?**. Confirm to continue via your existing sudo access (your server login password may be required). The same installation, config and SSH login account are retained; you do not need to rewrite the command. Declining leaves everything unchanged. Without sudo access, ask the server administrator to run the command. Pairing does not install sudo rules or weaken config permissions, and device authorization still requires a separate confirmation.
|
||||
4. Open the terminal's **Return to nanobot** link on the same computer and in the same browser profile that started pairing. The local WebUI opens the server confirmation directly; review its identity and access, then choose **Connect**. The link does not authorize or connect automatically. If the terminal cannot open links, choose **Other ways → Use a connection code instead** and paste the returned `nbpc1.…` code, then **Review connection**. Both paths use the same verification.
|
||||
|
||||
The return link targets only an HTTP loopback origin (`127.0.0.1`, `localhost`,
|
||||
or `[::1]`). Its fragment contains an encrypted receipt, not a plaintext admin
|
||||
secret, and is scrubbed before the WebUI signs in. A new tab can continue the
|
||||
request even if the original setup tab was closed. Pending keys remain on the
|
||||
local backend for the ten-minute invitation lifetime; abandoned requests are
|
||||
cleaned when a new request is prepared. A link opened on another machine, an
|
||||
expired request, or a modified code fails closed. Native/non-loopback origins
|
||||
continue to use the code fallback. Existing local authentication is still required.
|
||||
The return link targets only an HTTP loopback origin (`127.0.0.1`, `localhost`, or `[::1]`). Its fragment contains an encrypted receipt, not a plaintext admin secret, and is scrubbed before the WebUI signs in. A new tab can continue the request even if the original setup tab was closed. Pending keys remain on the local backend for the ten-minute invitation lifetime; abandoned requests are cleaned when a new request is prepared. A link opened on another machine, an expired request, or a modified code fails closed. Native/non-loopback origins continue to use the code fallback. Existing local authentication is still required.
|
||||
|
||||
No relay, public WebUI, uploaded private key, QR scan or new firewall rule is
|
||||
involved. The public invitation expires after ten minutes. The returned code is
|
||||
encrypted for that local instance; another computer/request cannot import it.
|
||||
The server host key is pinned from the code copied through your trusted terminal.
|
||||
Do not accept a connection code supplied by someone you do not trust.
|
||||
No relay, public WebUI, uploaded private key, QR scan or new firewall rule is involved. The public invitation expires after ten minutes. The returned code is encrypted for that local instance; another computer/request cannot import it. The server host key is pinned from the code copied through your trusted terminal. Do not accept a connection code supplied by someone you do not trust.
|
||||
|
||||
The dedicated device SSH key expires after 90 days. OpenSSH `restrict` disables
|
||||
shell-adjacent features and all SSH forwarding; a forced, fixed Python stdio
|
||||
bridge connects only to the selected loopback nanobot port. It cannot execute
|
||||
the client's SSH command. No extra daemon is installed or started. The server
|
||||
requires OpenSSH with `restrict` and `expiry-time` support, `/usr/bin/python3`,
|
||||
an Ed25519 host key, and the conventional `~/.ssh/authorized_keys` layout.
|
||||
Custom SSH policies/layouts may reject the grant; use existing SSH settings in
|
||||
that case. Windows servers and containers are not supported by quick pairing.
|
||||
The dedicated device SSH key expires after 90 days. OpenSSH `restrict` disables shell-adjacent features and all SSH forwarding; a forced, fixed Python stdio bridge connects only to the selected loopback nanobot port. It cannot execute the client's SSH command. No extra daemon is installed or started. The server requires OpenSSH with `restrict` and `expiry-time` support, `/usr/bin/python3`, an Ed25519 host key, and the conventional `~/.ssh/authorized_keys` layout. Custom SSH policies/layouts may reject the grant; use existing SSH settings in that case. Windows servers and containers are not supported by quick pairing.
|
||||
|
||||
This is still **full access to nanobot**, not read-only access. Its configured
|
||||
tools may themselves run commands or modify files. The WebUI credential stays
|
||||
in the local backend, encrypted at rest alongside a private local decryption key
|
||||
and dedicated SSH identity (directories `0700`, files `0600`). This protects
|
||||
against other OS users, not compromise of your logged-in account. Provider keys
|
||||
are not exported by the pairing protocol. Changes to the remote WebUI secret or
|
||||
port require pairing again; they are not silently refreshed through sudo.
|
||||
This is still **full access to nanobot**, not read-only access. Its configured tools may themselves run commands or modify files. The WebUI credential stays in the local backend, encrypted at rest alongside a private local decryption key and dedicated SSH identity (directories `0700`, files `0600`). This protects against other OS users, not compromise of your logged-in account. Provider keys are not exported by the pairing protocol. Changes to the remote WebUI secret or port require pairing again; they are not silently refreshed through sudo.
|
||||
|
||||
SSH network reachability is still required. Pairing cannot fix a blocked port or
|
||||
VPN route. A failed connection keeps the paired profile for retry. **Network
|
||||
route…** can explicitly reuse a saved connection's proxy/bound-interface route
|
||||
to the same host, without copying its identity settings. Jump-host routes should
|
||||
continue to use the ordinary SSH connection flow.
|
||||
SSH network reachability is still required. Pairing cannot fix a blocked port or VPN route. A failed connection keeps the paired profile for retry. **Network route…** can explicitly reuse a saved connection's proxy/bound-interface route to the same host, without copying its identity settings. Jump-host routes should continue to use the ordinary SSH connection flow.
|
||||
|
||||
If the server rejects a paired device key, the UI asks you to pair again rather
|
||||
than unlock an unrelated SSH agent. This can happen after revocation or expiry.
|
||||
If the server rejects a paired device key, the UI asks you to pair again rather than unlock an unrelated SSH agent. This can happen after revocation or expiry.
|
||||
|
||||
**Disconnect** closes local streams. **Forget** removes the local directory entry,
|
||||
including that device's local pairing keys, but does not revoke server authorization.
|
||||
To revoke, run the command displayed
|
||||
in the connection details on the server:
|
||||
**Disconnect** closes local streams. **Forget** removes the local directory entry, including that device's local pairing keys, but does not revoke server authorization. To revoke, run the command displayed in the connection details on the server:
|
||||
|
||||
```bash
|
||||
nanobot remote revoke DEVICE_ID --ssh-user LOGIN_ACCOUNT
|
||||
```
|
||||
|
||||
Only that device's exact managed key entry is removed; existing login keys stay
|
||||
unchanged. Current pairing bridges also check the grant and its expiry before
|
||||
each new stream, including streams on a reused SSH transport. Close any
|
||||
already-open remote sessions too: revocation does not terminate existing streams.
|
||||
Older bridges enforce the grant only at SSH authentication. If setup is cancelled
|
||||
after server authorization, use the revoke command printed in that terminal.
|
||||
Re-pairing after expiry uses a new independent key, not an extension of an old grant.
|
||||
Only that device's exact managed key entry is removed; existing login keys stay unchanged. Current pairing bridges also check the grant and its expiry before each new stream, including streams on a reused SSH transport. Close any already-open remote sessions too: revocation does not terminate existing streams. Older bridges enforce the grant only at SSH authentication. If setup is cancelled after server authorization, use the revoke command printed in that terminal. Re-pairing after expiry uses a new independent key, not an extension of an old grant.
|
||||
|
||||
## Existing SSH setup: server, then nanobot
|
||||
|
||||
The setup dialog separates **Server** (SSH login) from **nanobot** (which
|
||||
installation to open). Start with an address or an existing SSH host. You do
|
||||
not need to know nanobot's config path in advance.
|
||||
The setup dialog separates **Server** (SSH login) from **nanobot** (which installation to open). Start with an address or an existing SSH host. You do not need to know nanobot's config path in advance.
|
||||
|
||||
After SSH signs in, a read-only check looks for the selected account's config
|
||||
and up to eight named `nanobot*.service` systemd units. It reads service metadata
|
||||
and checks config-file locations; it does not read their contents, scan other
|
||||
users' home directories, run sudo, install software or change permissions.
|
||||
One configuration belonging to the login account opens automatically. Multiple
|
||||
configurations are shown as choices. A service owned by another account always
|
||||
requires an explicit **Open nanobot** choice, showing that account and path;
|
||||
opening still requires existing passwordless sudo permission.
|
||||
After SSH signs in, a read-only check looks for the selected account's config and up to eight named `nanobot*.service` systemd units. It reads service metadata and checks config-file locations; it does not read their contents, scan other users' home directories, run sudo, install software or change permissions. One configuration belonging to the login account opens automatically. Multiple configurations are shown as choices. A service owned by another account always requires an explicit **Open nanobot** choice, showing that account and path; opening still requires existing passwordless sudo permission.
|
||||
|
||||
If nothing is found, the dialog confirms **SSH connected** and asks for the
|
||||
server's config path and optional service account. Docker, custom service names,
|
||||
user services and non-systemd deployments may need this manual step. Failure to
|
||||
find a config is not proof that nanobot is absent. Finding a config is also not
|
||||
proof that its WebUI is running: the normal authenticated gateway check still
|
||||
happens before opening.
|
||||
If nothing is found, the dialog confirms **SSH connected** and asks for the server's config path and optional service account. Docker, custom service names, user services and non-systemd deployments may need this manual step. Failure to find a config is not proof that nanobot is absent. Finding a config is also not proof that its WebUI is running: the normal authenticated gateway check still happens before opening.
|
||||
|
||||
SSH failures keep the entered address and offer **SSH login settings** for the
|
||||
local key path, SSH config and port. Connection refusal, name resolution,
|
||||
connection closure and authentication rejection have distinct messages. The
|
||||
application does not infer a missing key from a closed connection, nor change
|
||||
VPN, proxy or network-interface settings automatically. A custom SSH config
|
||||
outside standard locations must still be explicitly supplied by its owner.
|
||||
SSH failures keep the entered address and offer **SSH login settings** for the local key path, SSH config and port. Connection refusal, name resolution, connection closure and authentication rejection have distinct messages. The application does not infer a missing key from a closed connection, nor change VPN, proxy or network-interface settings automatically. A custom SSH config outside standard locations must still be explicitly supplied by its owner.
|
||||
|
||||
## Find a server you already use
|
||||
|
||||
The add/edit dialog suggests named hosts from `~/.ssh/config` and the system SSH
|
||||
config, including ordinary `Include` files. Typing in **SSH address** filters
|
||||
these suggestions without a separate search field. Selecting a host fills the
|
||||
address; it does not connect until you choose **Connect**. Arrow keys navigate
|
||||
the suggestions. If your configuration lives elsewhere, expand **Connection
|
||||
options** and select the file beside **SSH config file**, or enter its local path.
|
||||
Suggestions update automatically; no separate file-reading step is needed.
|
||||
The private key field also has a native file chooser. Selecting a file returns
|
||||
only its path: it does not upload, copy or read the private key. Cancelling leaves
|
||||
the existing path unchanged. Headless hosts can use the manual path fields.
|
||||
The add/edit dialog suggests named hosts from `~/.ssh/config` and the system SSH config, including ordinary `Include` files. Typing in **SSH address** filters these suggestions without a separate search field. Selecting a host fills the address; it does not connect until you choose **Connect**. Arrow keys navigate the suggestions. If your configuration lives elsewhere, expand **Connection options** and select the file beside **SSH config file**, or enter its local path. Suggestions update automatically; no separate file-reading step is needed. The private key field also has a native file chooser. Selecting a file returns only its path: it does not upload, copy or read the private key. Cancelling leaves the existing path unchanged. Headless hosts can use the manual path fields.
|
||||
|
||||
Discovery is passive: it reads host names and source paths, not private keys,
|
||||
and does not contact servers or execute SSH hooks. Wildcard and negated patterns
|
||||
aren't destinations. Conditional includes may suggest hosts; only connecting
|
||||
checks reachability. Large or dynamic configurations show a partial-list notice;
|
||||
you can still enter an alias manually. Discovery is capped at 200 hosts, 64 files,
|
||||
256 KiB per file, and approximately 1 MiB in total.
|
||||
Discovery is passive: it reads host names and source paths, not private keys, and does not contact servers or execute SSH hooks. Wildcard and negated patterns aren't destinations. Conditional includes may suggest hosts; only connecting checks reachability. Large or dynamic configurations show a partial-list notice; you can still enter an alias manually. Discovery is capped at 200 hosts, 64 files, 256 KiB per file, and approximately 1 MiB in total.
|
||||
|
||||
At connection time, the system SSH client resolves your existing `User`, `Port`,
|
||||
`IdentityFile`, jump hosts and other connection settings. An empty port field
|
||||
inherits SSH configuration instead of overriding it with 22. Listing a host
|
||||
does not mean nanobot is installed there.
|
||||
At connection time, the system SSH client resolves your existing `User`, `Port`, `IdentityFile`, jump hosts and other connection settings. An empty port field inherits SSH configuration instead of overriding it with 22. Listing a host does not mean nanobot is installed there.
|
||||
|
||||
You can also paste a simple command, for example
|
||||
`ssh -p 2222 -i "~/.ssh/team key" ubuntu@your-server`. The address field imports
|
||||
`-p` (port), `-i` (key path), `-F` (config path) and `-l` (login user) into the
|
||||
existing Connection options. Review these before connecting. Quoted paths can
|
||||
contain spaces, including Windows paths. This is an importer, not a terminal:
|
||||
remote commands, shell expansions, repeated options and other flags are rejected,
|
||||
not executed or silently discarded. Keep advanced options such as `ProxyJump`
|
||||
in your SSH config and enter the alias. An interactive alias's `RemoteCommand`
|
||||
and forced TTY are disabled for the fixed nanobot probe.
|
||||
You can also paste a simple command, for example `ssh -p 2222 -i "~/.ssh/team key" ubuntu@your-server`. The address field imports `-p` (port), `-i` (key path), `-F` (config path) and `-l` (login user) into the existing Connection options. Review these before connecting. Quoted paths can contain spaces, including Windows paths. This is an importer, not a terminal: remote commands, shell expansions, repeated options and other flags are rejected, not executed or silently discarded. Keep advanced options such as `ProxyJump` in your SSH config and enter the alias. An interactive alias's `RemoteCommand` and forced TTY are disabled for the fixed nanobot probe.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Run the local WebUI on a loopback address, using the system OpenSSH client.
|
||||
- For **existing SSH settings**, your key must already have access to the server. Encrypted keys should
|
||||
be unlocked in the system SSH agent. Interactive SSH passwords are not
|
||||
collected by this UI.
|
||||
- The remote server needs `python3` and an already running nanobot WebUI with
|
||||
a configured `tokenIssueSecret` (or `token`) in its configuration file.
|
||||
- The remote gateway must support the authenticated `/webui/terminal`
|
||||
identity probe and the supported WebUI client contract. The local installation
|
||||
must have its WebUI bundle; the remote host only needs the backend endpoints.
|
||||
The initial transport supports HTTP on the server's loopback address; SSH
|
||||
encrypts the connection. A configured public WebSocket URL or trusted-proxy
|
||||
authentication is not supported by this SSH connection mode.
|
||||
- For **existing SSH settings**, your key must already have access to the server. Encrypted keys should be unlocked in the system SSH agent. Interactive SSH passwords are not collected by this UI.
|
||||
- The remote server needs `python3` and an already running nanobot WebUI with a configured `tokenIssueSecret` (or `token`) in its configuration file.
|
||||
- The remote gateway must support the authenticated `/webui/terminal` identity probe and the supported WebUI client contract. The local installation must have its WebUI bundle; the remote host only needs the backend endpoints. The initial transport supports HTTP on the server's loopback address; SSH encrypts the connection. A configured public WebSocket URL or trusted-proxy authentication is not supported by this SSH connection mode.
|
||||
|
||||
If this machine has never connected to the server, nanobot displays its SSH
|
||||
fingerprint. Compare it with the server console or your administrator before
|
||||
confirming in the same dialog. **Back** returns to the filled-in form when adding
|
||||
a server. The public key is pinned for this connection, without changing
|
||||
your system `known_hosts`. A **changed** host key is blocked, not automatically
|
||||
accepted. Jump-host-only or non-Ed25519 hosts can use a previously verified
|
||||
system SSH configuration instead of the in-app first-contact verifier.
|
||||
If this machine has never connected to the server, nanobot displays its SSH fingerprint. Compare it with the server console or your administrator before confirming in the same dialog. **Back** returns to the filled-in form when adding a server. The public key is pinned for this connection, without changing your system `known_hosts`. A **changed** host key is blocked, not automatically accepted. Jump-host-only or non-Ed25519 hosts can use a previously verified system SSH configuration instead of the in-app first-contact verifier.
|
||||
|
||||
## Connection options
|
||||
|
||||
Most setups only need the SSH address. Expand **Connection options** when necessary.
|
||||
You can also give the server a recognizable name here; otherwise its address is
|
||||
used as the name.
|
||||
Most setups only need the SSH address. Expand **Connection options** when necessary. You can also give the server a recognizable name here; otherwise its address is used as the name.
|
||||
|
||||
| Option | Meaning |
|
||||
| --- | --- |
|
||||
@@ -252,204 +82,61 @@ used as the name.
|
||||
| nanobot config path | Server-side config, default `~/.nanobot/config.json` |
|
||||
| nanobot service account | Optional account owning the remote config; requires existing passwordless `sudo -u` permission |
|
||||
|
||||
For a service installation, the SSH login and nanobot owner may differ. For
|
||||
example, you might sign in as `ubuntu`, with nanobot running as `nanobot` and
|
||||
its config in `/var/lib/nanobot/.nanobot/config.json`. The discovery step offers
|
||||
these values when it finds the service; otherwise use **Specify a different
|
||||
location** in the nanobot step. Editing a saved connection also exposes these
|
||||
fields. The connection does not grant new sudo privileges.
|
||||
For a service installation, the SSH login and nanobot owner may differ. For example, you might sign in as `ubuntu`, with nanobot running as `nanobot` and its config in `/var/lib/nanobot/.nanobot/config.json`. The discovery step offers these values when it finds the service; otherwise use **Specify a different location** in the nanobot step. Editing a saved connection also exposes these fields. The connection does not grant new sudo privileges.
|
||||
|
||||
## Connection performance
|
||||
|
||||
On macOS and Linux, connections with an app-pinned host key reuse a private
|
||||
OpenSSH transport instead of authenticating for every HTTP request. Each
|
||||
connection owns its control socket; nanobot never borrows your shell's shared
|
||||
SSH session. Disconnecting closes the transport. Windows and unpinned
|
||||
connections retain the independent-stream path.
|
||||
On macOS and Linux, connections with an app-pinned host key reuse a private OpenSSH transport instead of authenticating for every HTTP request. Each connection owns its control socket; nanobot never borrows your shell's shared SSH session. Disconnecting closes the transport. Windows and unpinned connections retain the independent-stream path.
|
||||
|
||||
Paired connections enable reuse only after the server bridge confirms that it
|
||||
checks expiry and revocation on every new stream. Older bridges still work with
|
||||
fresh authentication per stream. Pair again after upgrading the server to install
|
||||
the guarded bridge; upgrading nanobot alone does not rewrite existing grants.
|
||||
Paired connections enable reuse only after the server bridge confirms that it checks expiry and revocation on every new stream. Older bridges still work with fresh authentication per stream. Pair again after upgrading the server to install the guarded bridge; upgrading nanobot alone does not rewrite existing grants.
|
||||
|
||||
The interface's HTML, JS, CSS and bundled images come from your **local nanobot
|
||||
installation**, not the server. Versioned local assets can be cached in the
|
||||
browser; HTML is revalidated. API responses, credentials and media capabilities
|
||||
remain uncached by the proxy. Initial authentication and network latency still
|
||||
affect the first connection; reuse
|
||||
does not bypass a blocked SSH route or VPN policy.
|
||||
The interface's HTML, JS, CSS and bundled images come from your **local nanobot installation**, not the server. Versioned local assets can be cached in the browser; HTML is revalidated. API responses, credentials and media capabilities remain uncached by the proxy. Initial authentication and network latency still affect the first connection; reuse does not bypass a blocked SSH route or VPN policy.
|
||||
|
||||
## Using the remote instance
|
||||
|
||||
The **local WebUI** displays the selected server's data. Interface updates follow
|
||||
your local installation; model settings, channels, tools and conversations still
|
||||
belong to the server. Every host uses an isolated browser origin and runtime, but
|
||||
all of them load the same locally installed frontend. The server's static WebUI
|
||||
bundle is not required for this mode. The isolated view cannot navigate the local application's
|
||||
top-level window. The first version has been exercised in macOS Chrome; native
|
||||
desktop-host packaging and other platforms still need their own acceptance.
|
||||
The **local WebUI** displays the selected server's data. Interface updates follow your local installation; model settings, channels, tools and conversations still belong to the server. Every host uses an isolated browser origin and runtime, but all of them load the same locally installed frontend. The server's static WebUI bundle is not required for this mode. The isolated view cannot navigate the local application's top-level window. The first version has been exercised in macOS Chrome; native desktop-host packaging and other platforms still need their own acceptance.
|
||||
|
||||
When upgrading from the earlier remote-page mode, the first reconnect reserves
|
||||
a fresh local browser origin. This prevents previously loaded remote service
|
||||
workers or cached code from controlling the local client. Saved SSH profiles,
|
||||
pairing authorizations, and server conversations remain intact; origin-local
|
||||
browser preferences may return to their defaults. Finish or copy unsent drafts
|
||||
before restarting the local application for this upgrade.
|
||||
When upgrading from the earlier remote-page mode, the first reconnect reserves a fresh local browser origin. This prevents previously loaded remote service workers or cached code from controlling the local client. Saved SSH profiles, pairing authorizations, and server conversations remain intact; origin-local browser preferences may return to their defaults. Finish or copy unsent drafts before restarting the local application for this upgrade.
|
||||
|
||||
### Versions and updating the right machine
|
||||
|
||||
Open a server's **… → Version & compatibility** in **Manage connections…** to see
|
||||
the local and server versions and the compatibility result. Matching package
|
||||
versions are not required: both sides must support a common WebUI protocol.
|
||||
Compatible version differences do not show an update warning.
|
||||
Open a server's **… → Version & compatibility** in **Manage connections…** to see the local and server versions and the compatibility result. Matching package versions are not required: both sides must support a common WebUI protocol. Compatible version differences do not show an update warning.
|
||||
|
||||
- **Compatibility not confirmed:** the host has not advertised a supported
|
||||
WebUI contract. This is not evidence of a broken key, VPN issue, or simply an
|
||||
old version. Local-client mode cannot safely proceed until support is confirmed.
|
||||
For older installations, update nanobot on that server and reconnect.
|
||||
- **Update this server:** its advertised contract lacks the client's required
|
||||
core features. Update the server, not merely this computer.
|
||||
- **Update this computer:** the host requires a newer client protocol. Update
|
||||
the local installation; do not downgrade the server.
|
||||
- **Compatibility not confirmed:** the host has not advertised a supported WebUI contract. This is not evidence of a broken key, VPN issue, or simply an old version. Local-client mode cannot safely proceed until support is confirmed. For older installations, update nanobot on that server and reconnect.
|
||||
- **Update this server:** its advertised contract lacks the client's required core features. Update the server, not merely this computer.
|
||||
- **Update this computer:** the host requires a newer client protocol. Update the local installation; do not downgrade the server.
|
||||
|
||||
The initial explicit contract is WebUI protocol 1 with `webui.core.v1`. Older
|
||||
hosts without this metadata need a compatible update to use local-client mode;
|
||||
their own server WebUI is unaffected. The terminal transport protocol is separate.
|
||||
The initial explicit contract is WebUI protocol 1 with `webui.core.v1`. Older hosts without this metadata need a compatible update to use local-client mode; their own server WebUI is unaffected. The terminal transport protocol is separate.
|
||||
|
||||
Use the [update instructions](../quick-start.md#updating) for the same installation
|
||||
method and environment that run nanobot on the target machine. For a container,
|
||||
update the deployed image; for a service, update its actual environment rather
|
||||
than an unrelated shell installation. Back up configuration and data and finish
|
||||
active tasks before a required restart. Verify the version of the restarted
|
||||
process, then reconnect. Version checks do not install packages, restart a host,
|
||||
or change its model, channel, or SSH configuration automatically.
|
||||
Use the [update instructions](../quick-start.md#updating) for the same installation method and environment that run nanobot on the target machine. For a container, update the deployed image; for a service, update its actual environment rather than an unrelated shell installation. Back up configuration and data and finish active tasks before a required restart. Verify the version of the restarted process, then reconnect. Version checks do not install packages, restart a host, or change its model, channel, or SSH configuration automatically.
|
||||
|
||||
The host switcher lives beside **Settings at the bottom of the sidebar**, showing
|
||||
**Local** or your saved server name. It is also available in Settings. Its menu
|
||||
opens upward and shows the computer name, recent hosts, and **Manage connections…**.
|
||||
With the sidebar collapsed, the icon still opens the same menu. A check marks
|
||||
the host you are viewing; a separate green dot marks an established connection.
|
||||
Saved but disconnected hosts stay gray, and connecting or failed hosts have
|
||||
distinct progress/error indicators. **Manage connections…** opens a full page in
|
||||
the main content area beside the existing sidebar,
|
||||
without switching to Local, changing the route, or disconnecting the server.
|
||||
**Back** returns to the same view and draft. The page uses the same connection
|
||||
states with text labels, so color is never the only way to distinguish them.
|
||||
Selecting a host on the page switches only after its view is ready; a failed
|
||||
attempt leaves the original host selected. Remote
|
||||
connection setup is hidden inside the embedded remote view, and connecting back
|
||||
to the same gateway is rejected rather than creating a nested local session.
|
||||
The host switcher lives beside **Settings at the bottom of the sidebar**, showing **Local** or your saved server name. It is also available in Settings. Its menu opens upward and shows the computer name, recent hosts, and **Manage connections…**. With the sidebar collapsed, the icon still opens the same menu. A check marks the host you are viewing; a separate green dot marks an established connection. Saved but disconnected hosts stay gray, and connecting or failed hosts have distinct progress/error indicators. **Manage connections…** opens a full page in the main content area beside the existing sidebar, without switching to Local, changing the route, or disconnecting the server. **Back** returns to the same view and draft. The page uses the same connection states with text labels, so color is never the only way to distinguish them. Selecting a host on the page switches only after its view is ready; a failed attempt leaves the original host selected. Remote connection setup is hidden inside the embedded remote view, and connecting back to the same gateway is rejected rather than creating a nested local session.
|
||||
|
||||
Each isolated host view loads the same local WebUI and puts the switcher in the
|
||||
same sidebar location. A narrowly scoped, origin-, frame- and nonce-checked
|
||||
bridge sends the current host's display identity and coordinates menu placement,
|
||||
management layout and focus. The embedded view does not receive your host
|
||||
directory, SSH configuration or connection commands; the local shell owns those
|
||||
actions. This does not depend on the server's static WebUI bundle.
|
||||
Each isolated host view loads the same local WebUI and puts the switcher in the same sidebar location. A narrowly scoped, origin-, frame- and nonce-checked bridge sends the current host's display identity and coordinates menu placement, management layout and focus. The embedded view does not receive your host directory, SSH configuration or connection commands; the local shell owns those actions. This does not depend on the server's static WebUI bundle.
|
||||
|
||||
Refreshing restores the selected remote instance. A failed connection stays
|
||||
on a remote error screen; it never silently redirects work to your local agent.
|
||||
The selected server ID is stored per browser tab, without credentials.
|
||||
When the page becomes visible again or the browser reports network recovery,
|
||||
nanobot immediately rechecks existing connections. It does not reload the remote
|
||||
view, switch hosts, or resend messages. If the connection remains unavailable,
|
||||
use **Reconnect**. Different aliases resolving to the same already-connected
|
||||
gateway are rejected; choose its existing entry in the host switcher. Separate
|
||||
nanobot instances on one server can still use separate profiles and config paths.
|
||||
Refreshing restores the selected remote instance. A failed connection stays on a remote error screen; it never silently redirects work to your local agent. The selected server ID is stored per browser tab, without credentials. When the page becomes visible again or the browser reports network recovery, nanobot immediately rechecks existing connections. It does not reload the remote view, switch hosts, or resend messages. If the connection remains unavailable, use **Reconnect**. Different aliases resolving to the same already-connected gateway are rejected; choose its existing entry in the host switcher. Separate nanobot instances on one server can still use separate profiles and config paths.
|
||||
|
||||
- **Switching hosts**, including returning local, keeps both pages mounted and
|
||||
keeps SSH connected. Each host retains its own chat, unsent draft, scroll
|
||||
position and UI state; nothing is copied between hosts. Up to three remote
|
||||
views are kept per tab. At the limit, explicitly disconnect one rather than
|
||||
silently discarding its work. Reloading the browser still follows each
|
||||
instance's normal draft persistence; unfinished uploads aren't guaranteed.
|
||||
- A first connection prepares a hidden server page while the current page stays
|
||||
usable. It switches after the page loads; **Cancel switch** keeps you where
|
||||
you are. The most recent choice wins even if an earlier SSH request finishes
|
||||
later. Cancelling navigation does not stop an in-flight server connection.
|
||||
The host view may still show a sign-in/startup indicator while its data connection
|
||||
initializes; returning to an already loaded view avoids that startup.
|
||||
- **Disconnect** in a server's menu confirms before closing its view and shared
|
||||
SSH tunnel. Unsaved view-only work can be lost; the remote bot keeps running.
|
||||
Idle views do not automatically close a tunnel another tab might be using.
|
||||
- **Forget server** removes its local connection metadata and pinned public key.
|
||||
It does not delete remote conversations, keys, files, or the installation.
|
||||
- Closing the local gateway cleans up its SSH processes. The independently
|
||||
running remote gateway, Linear integration, and scheduled tasks keep running.
|
||||
- Connections to the same saved server share one tunnel; explicitly disconnecting
|
||||
it also disconnects other local tabs using that tunnel. Reloading a tab reuses
|
||||
a healthy connection. Up to four servers can be connected concurrently.
|
||||
- **Switching hosts**, including returning local, keeps both pages mounted and keeps SSH connected. Each host retains its own chat, unsent draft, scroll position and UI state; nothing is copied between hosts. Up to three remote views are kept per tab. At the limit, explicitly disconnect one rather than silently discarding its work. Reloading the browser still follows each instance's normal draft persistence; unfinished uploads aren't guaranteed.
|
||||
- A first connection prepares a hidden server page while the current page stays usable. It switches after the page loads; **Cancel switch** keeps you where you are. The most recent choice wins even if an earlier SSH request finishes later. Cancelling navigation does not stop an in-flight server connection. The host view may still show a sign-in/startup indicator while its data connection initializes; returning to an already loaded view avoids that startup.
|
||||
- **Disconnect** in a server's menu confirms before closing its view and shared SSH tunnel. Unsaved view-only work can be lost; the remote bot keeps running. Idle views do not automatically close a tunnel another tab might be using.
|
||||
- **Forget server** removes its local connection metadata and pinned public key. It does not delete remote conversations, keys, files, or the installation.
|
||||
- Closing the local gateway cleans up its SSH processes. The independently running remote gateway, Linear integration, and scheduled tasks keep running.
|
||||
- Connections to the same saved server share one tunnel; explicitly disconnecting it also disconnects other local tabs using that tunnel. Reloading a tab reuses a healthy connection. Up to four servers can be connected concurrently.
|
||||
|
||||
## Security and troubleshooting
|
||||
|
||||
The local connection directory is stored beside the local config under
|
||||
`webui/remote-instances.json`. It contains connection metadata, not private-key
|
||||
contents or model/channel credentials. A stable loopback port per saved server
|
||||
keeps browser preferences scoped to that server. Changing the SSH target, config
|
||||
path, service account or identity file assigns a fresh browser origin, rather
|
||||
than loading the previous instance's drafts. The adjacent
|
||||
`remote-origin-ports.json` records previously used ports, without credentials;
|
||||
these ports are not assigned to new targets, even after forgetting a profile.
|
||||
Keep that file alongside the connection directory when moving local settings.
|
||||
Port conflicts fail explicitly; nanobot does not attach to an unrelated listener.
|
||||
The local connection directory is stored beside the local config under `webui/remote-instances.json`. It contains connection metadata, not private-key contents or model/channel credentials. A stable loopback port per saved server keeps browser preferences scoped to that server. Changing the SSH target, config path, service account or identity file assigns a fresh browser origin, rather than loading the previous instance's drafts. The adjacent `remote-origin-ports.json` records previously used ports, without credentials; these ports are not assigned to new targets, even after forgetting a profile. Keep that file alongside the connection directory when moving local settings. Port conflicts fail explicitly; nanobot does not attach to an unrelated listener.
|
||||
|
||||
For a backup or move, stop the local gateway and preserve the entire adjacent
|
||||
`webui` directory, including `remote-hosts` and `remote-pairing`, with its private
|
||||
file permissions. Paired device keys and imported routes follow the restored
|
||||
directory automatically. Ordinary SSH profiles still reference your external
|
||||
SSH config/key paths; update those separately if they moved. Restoring only
|
||||
`remote-instances.json` cannot restore pairing credentials. Do not copy this
|
||||
directory to another user or untrusted computer: it grants full remote nanobot
|
||||
access. A downgrade to a version without remote connections leaves these files
|
||||
unused; keep the backup for upgrading again.
|
||||
For a backup or move, stop the local gateway and preserve the entire adjacent `webui` directory, including `remote-hosts` and `remote-pairing`, with its private file permissions. Paired device keys and imported routes follow the restored directory automatically. Ordinary SSH profiles still reference your external SSH config/key paths; update those separately if they moved. Restoring only `remote-instances.json` cannot restore pairing credentials. Do not copy this directory to another user or untrusted computer: it grants full remote nanobot access. A downgrade to a version without remote connections leaves these files unused; keep the backup for upgrading again.
|
||||
|
||||
The local gateway owns a browser-facing proxy and a separate, private SSH
|
||||
transport. Browser login, API, WebSocket and media credentials are local
|
||||
capabilities: they cannot authenticate to the remote gateway. The remote
|
||||
credentials stay in backend memory. System SSH's private stdin/stdout pipes,
|
||||
SSH configuration and host-key verification still secure the upstream transport.
|
||||
Disconnecting or forgetting closes active requests but retains disabled
|
||||
listeners until local gateway shutdown. Reconnecting the same saved instance
|
||||
reuses its browser origin. An offline profile can be edited without first
|
||||
disconnecting it in another tab.
|
||||
The local gateway owns a browser-facing proxy and a separate, private SSH transport. Browser login, API, WebSocket and media credentials are local capabilities: they cannot authenticate to the remote gateway. The remote credentials stay in backend memory. System SSH's private stdin/stdout pipes, SSH configuration and host-key verification still secure the upstream transport. Disconnecting or forgetting closes active requests but retains disabled listeners until local gateway shutdown. Reconnecting the same saved instance reuses its browser origin. An offline profile can be edited without first disconnecting it in another tab.
|
||||
|
||||
Closing the local gateway drains proxy requests before releasing its private
|
||||
transport. If an old tab retries the browser address after shutdown, it sends
|
||||
only local capabilities from the stopped proxy, not a remote login credential.
|
||||
Close old tabs anyway: after shutdown another local process can serve content
|
||||
at that address. This does not isolate nanobot from malware running as you.
|
||||
On Windows, exclusive socket ownership may delay reusing a port after shutdown;
|
||||
retry later if it remains occupied. Nanobot does not weaken socket ownership
|
||||
to force a reconnect.
|
||||
Closing the local gateway drains proxy requests before releasing its private transport. If an old tab retries the browser address after shutdown, it sends only local capabilities from the stopped proxy, not a remote login credential. Close old tabs anyway: after shutdown another local process can serve content at that address. This does not isolate nanobot from malware running as you. On Windows, exclusive socket ownership may delay reusing a port after shutdown; retry later if it remains occupied. Nanobot does not weaken socket ownership to force a reconnect.
|
||||
|
||||
SSH authenticates the server. A read-only, fixed Python probe retrieves only
|
||||
WebUI login information from its config. The gateway's protocol and runtime ID
|
||||
are verified before navigation. Only a local proxy credential is passed in the
|
||||
remote view's URL fragment and stored by its existing login UI. Local gateway
|
||||
restart replaces that credential and invalidates local token/media mappings;
|
||||
reopening the saved connection handles this without an extra login step.
|
||||
Nothing opens a public administration port or forwards your SSH agent.
|
||||
SSH authenticates the server. A read-only, fixed Python probe retrieves only WebUI login information from its config. The gateway's protocol and runtime ID are verified before navigation. Only a local proxy credential is passed in the remote view's URL fragment and stored by its existing login UI. Local gateway restart replaces that credential and invalidates local token/media mappings; reopening the saved connection handles this without an extra login step. Nothing opens a public administration port or forwards your SSH agent.
|
||||
|
||||
**Upgrading the earlier remote-connection prototype:** it passed the remote
|
||||
WebUI login secret to browser storage. This version retires those old browser
|
||||
origins, but cannot revoke a secret already saved in an old tab. Close those
|
||||
tabs, clear their browser site data, and rotate the remote WebUI login secret
|
||||
to invalidate the old credential. This migration does not rotate credentials
|
||||
or restart your server automatically.
|
||||
**Upgrading the earlier remote-connection prototype:** it passed the remote WebUI login secret to browser storage. This version retires those old browser origins, but cannot revoke a secret already saved in an old tab. Close those tabs, clear their browser site data, and rotate the remote WebUI login secret to invalidate the old credential. This migration does not rotate credentials or restart your server automatically.
|
||||
|
||||
Remote-connection actions require an authenticated local WebUI connection, a
|
||||
loopback-bound gateway, and local request origin. They are unavailable from a
|
||||
public/reverse-proxied administration page. Connecting requires server admin
|
||||
access; permission to mention nanobot in Linear is **not** that permission.
|
||||
Remote-connection actions require an authenticated local WebUI connection, a loopback-bound gateway, and local request origin. They are unavailable from a public/reverse-proxied administration page. Connecting requires server admin access; permission to mention nanobot in Linear is **not** that permission.
|
||||
|
||||
Common errors explain whether SSH authentication, a missing config, a service
|
||||
account, WebUI authentication, protocol compatibility or networking failed.
|
||||
Key-agent refusal, unsafe key-file permissions, invalid SSH configuration and
|
||||
server-side port-forwarding denial have separate recovery hints. Login banners
|
||||
are ignored when reading the framed probe result. A failed probe is distinct
|
||||
from an invalid nanobot configuration; raw SSH output and credentials aren't
|
||||
displayed in error messages. If SSH works in a terminal but not in nanobot,
|
||||
check that nanobot was started with access to the same system SSH agent.
|
||||
Configurations whose WebUI secret is supplied only by a service environment,
|
||||
interactive SSH passwords, and remote WebUIs with a public WebSocket URL need
|
||||
additional setup; this flow does not silently weaken their authentication.
|
||||
Common errors explain whether SSH authentication, a missing config, a service account, WebUI authentication, protocol compatibility or networking failed. Key-agent refusal, unsafe key-file permissions, invalid SSH configuration and server-side port-forwarding denial have separate recovery hints. Login banners are ignored when reading the framed probe result. A failed probe is distinct from an invalid nanobot configuration; raw SSH output and credentials aren't displayed in error messages. If SSH works in a terminal but not in nanobot, check that nanobot was started with access to the same system SSH agent. Configurations whose WebUI secret is supplied only by a service environment, interactive SSH passwords, and remote WebUIs with a public WebSocket URL need additional setup; this flow does not silently weaken their authentication.
|
||||
@@ -1,7 +1,6 @@
|
||||
# How to Secure a Local AI Agent with nanobot
|
||||
|
||||
This guide covers the practical controls to review before letting a nanobot
|
||||
agent access files, shell commands, web fetch, chat apps, or remote users.
|
||||
This guide covers the practical controls to review before letting a nanobot agent access files, shell commands, web fetch, chat apps, or remote users.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -12,8 +11,7 @@ agent access files, shell commands, web fetch, chat apps, or remote users.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use this before exposing nanobot to teammates, chat apps, public networks, broad
|
||||
web access, or unattended automations.
|
||||
Use this before exposing nanobot to teammates, chat apps, public networks, broad web access, or unattended automations.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -39,19 +37,14 @@ Start with workspace restriction:
|
||||
}
|
||||
```
|
||||
|
||||
`bwrap` is Linux-only and requires bubblewrap. On macOS or Windows, keep
|
||||
`restrictToWorkspace` enabled and review shell access carefully.
|
||||
`bwrap` is Linux-only and requires bubblewrap. On macOS or Windows, keep `restrictToWorkspace` enabled and review shell access carefully.
|
||||
|
||||
## Production notes
|
||||
|
||||
- Use environment variables for provider keys, bot tokens, and mailbox
|
||||
passwords.
|
||||
- Use environment variables for provider keys, bot tokens, and mailbox passwords.
|
||||
- Keep one workspace per trust boundary.
|
||||
- Prefer pairing for DM-capable chat apps, use narrow `allowFrom` lists only
|
||||
when static allowlists are intentional, and keep group policy mention-only at
|
||||
first.
|
||||
- Bind WebUI, WebSocket, and API services to localhost unless remote access is
|
||||
intentional.
|
||||
- Prefer pairing for DM-capable chat apps, use narrow `allowFrom` lists only when static allowlists are intentional, and keep group policy mention-only at first.
|
||||
- Bind WebUI, WebSocket, and API services to localhost unless remote access is intentional.
|
||||
|
||||
## Security notes
|
||||
|
||||
@@ -59,16 +52,13 @@ Start with workspace restriction:
|
||||
- `tools.exec.enable: false` removes shell execution entirely.
|
||||
- HTTP web fetch and HTTP MCP use SSRF protections by default.
|
||||
- Adding broad `tools.ssrfWhitelist` ranges increases exposure.
|
||||
- `allowFrom: ["*"]` bypasses pairing and means anyone who can reach that
|
||||
channel can talk to the bot.
|
||||
- `allowFrom: ["*"]` bypasses pairing and means anyone who can reach that channel can talk to the bot.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If a needed file cannot be read, confirm the active workspace path.
|
||||
- If a shell command fails under `bwrap`, check whether the command needs files
|
||||
outside the sandbox.
|
||||
- If local HTTP tools are blocked, review the SSRF whitelist and use a narrow
|
||||
CIDR.
|
||||
- If a shell command fails under `bwrap`, check whether the command needs files outside the sandbox.
|
||||
- If local HTTP tools are blocked, review the SSRF whitelist and use a narrow CIDR.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# How to Run a Self-Hosted AI Agent with nanobot
|
||||
|
||||
This guide sets up nanobot as a self-hosted AI agent runtime on your own
|
||||
machine or server. The result is a gateway process that can serve the WebUI,
|
||||
chat apps, automations, and API integrations.
|
||||
This guide sets up nanobot as a self-hosted AI agent runtime on your own machine or server. The result is a gateway process that can serve the WebUI, chat apps, automations, and API integrations.
|
||||
|
||||
## What you will build
|
||||
|
||||
@@ -13,9 +11,7 @@ chat apps, automations, and API integrations.
|
||||
|
||||
## When to use this
|
||||
|
||||
Use this path when you want local or server-side ownership of the agent process,
|
||||
workspace files, memory files, and provider keys. It is also the right path when
|
||||
the agent must keep running after one terminal command finishes.
|
||||
Use this path when you want local or server-side ownership of the agent process, workspace files, memory files, and provider keys. It is also the right path when the agent must keep running after one terminal command finishes.
|
||||
|
||||
## Install
|
||||
|
||||
@@ -25,8 +21,7 @@ nanobot onboard --wizard
|
||||
nanobot agent -m "Hello!"
|
||||
```
|
||||
|
||||
Complete the CLI check before deploying the gateway. A deployment problem is
|
||||
much easier to debug after the provider and model are known to work.
|
||||
Complete the CLI check before deploying the gateway. A deployment problem is much easier to debug after the provider and model are known to work.
|
||||
|
||||
## Minimal working example
|
||||
|
||||
@@ -36,43 +31,33 @@ For chat apps, automations, and WebSocket delivery, start the gateway:
|
||||
nanobot gateway
|
||||
```
|
||||
|
||||
For the browser surface, use the WebUI launcher instead. It can start and manage
|
||||
the local gateway for you:
|
||||
For the browser surface, use the WebUI launcher instead. It can start and manage the local gateway for you:
|
||||
|
||||
```bash
|
||||
nanobot webui
|
||||
```
|
||||
|
||||
Or connect a channel in `~/.nanobot/config.json`, then keep the same gateway
|
||||
process running for messages.
|
||||
Or connect a channel in `~/.nanobot/config.json`, then keep the same gateway process running for messages.
|
||||
|
||||
## Production notes
|
||||
|
||||
- Use Docker, systemd, or a macOS LaunchAgent when the process should survive
|
||||
terminal exits.
|
||||
- Give every deployed instance a distinct config path, workspace path, and port
|
||||
set.
|
||||
- Keep secrets in environment variables and start the service from the same
|
||||
environment.
|
||||
- Use health checks against the gateway or API process, not chat app delivery as
|
||||
the only signal.
|
||||
- Use Docker, systemd, or a macOS LaunchAgent when the process should survive terminal exits.
|
||||
- Give every deployed instance a distinct config path, workspace path, and port set.
|
||||
- Keep secrets in environment variables and start the service from the same environment.
|
||||
- Use health checks against the gateway or API process, not chat app delivery as the only signal.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Bind local-only services to `127.0.0.1` unless you intentionally expose them.
|
||||
- Set an API key before binding the OpenAI-compatible API to a public interface.
|
||||
- Prefer pairing for DM-capable chat apps, and keep any static `allowFrom`
|
||||
allowlists strict.
|
||||
- Enable `tools.restrictToWorkspace`; on Linux, use the bubblewrap sandbox for
|
||||
shell execution.
|
||||
- Prefer pairing for DM-capable chat apps, and keep any static `allowFrom` allowlists strict.
|
||||
- Enable `tools.restrictToWorkspace`; on Linux, use the bubblewrap sandbox for shell execution.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- Run `nanobot status` with the same `--config` and `--workspace` flags used by
|
||||
the service.
|
||||
- Run `nanobot status` with the same `--config` and `--workspace` flags used by the service.
|
||||
- Run `nanobot gateway --verbose` while debugging channel startup.
|
||||
- Check port conflicts if the WebUI, WebSocket channel, or API endpoint fails to
|
||||
bind.
|
||||
- Check port conflicts if the WebUI, WebSocket channel, or API endpoint fails to bind.
|
||||
|
||||
## Related nanobot docs
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Build a Slack AI Agent with nanobot
|
||||
|
||||
This guide connects nanobot to Slack through Socket Mode. No public webhook URL
|
||||
is required for the first working setup.
|
||||
This guide connects nanobot to Slack through Socket Mode. No public webhook URL is required for the first working setup.
|
||||
|
||||
## What this guide builds
|
||||
|
||||
@@ -35,9 +34,7 @@ Install the optional channel dependency:
|
||||
nanobot plugins enable slack
|
||||
```
|
||||
|
||||
In Slack, create an app, enable Socket Mode, create an app-level token with
|
||||
`connections:write`, add bot scopes, subscribe to bot events, and install the
|
||||
app to your workspace.
|
||||
In Slack, create an app, enable Socket Mode, create an app-level token with `connections:write`, add bot scopes, subscribe to bot events, and install the app to your workspace.
|
||||
|
||||
Merge this snippet into `~/.nanobot/config.json`:
|
||||
|
||||
@@ -57,9 +54,7 @@ Merge this snippet into `~/.nanobot/config.json`:
|
||||
}
|
||||
```
|
||||
|
||||
Slack DMs are open by default. Setting `dm.policy` to `"allowlist"` with no
|
||||
`dm.allowFrom` entries makes new DM senders receive a pairing code. Approve the
|
||||
code before using the bot normally.
|
||||
Slack DMs are open by default. Setting `dm.policy` to `"allowlist"` with no `dm.allowFrom` entries makes new DM senders receive a pairing code. Approve the code before using the bot normally.
|
||||
|
||||
## Run nanobot gateway
|
||||
|
||||
@@ -70,8 +65,7 @@ nanobot gateway
|
||||
|
||||
## Test a message
|
||||
|
||||
DM the Slack bot directly. It should return a pairing code. Approve it from a
|
||||
trusted local surface:
|
||||
DM the Slack bot directly. It should return a pairing code. Approve it from a trusted local surface:
|
||||
|
||||
```bash
|
||||
nanobot agent -m "/pairing approve ABCD-EFGH"
|
||||
@@ -85,8 +79,7 @@ Then DM the bot again, or mention it in a channel:
|
||||
|
||||
## Security notes
|
||||
|
||||
- Keep `groupPolicy` as `mention` unless the bot is intentionally listening to
|
||||
every channel message.
|
||||
- Keep `groupPolicy` as `mention` unless the bot is intentionally listening to every channel message.
|
||||
- Keep `dm.policy` as `"allowlist"` when you want pairing-based approval.
|
||||
- Use `groupAllowFrom` with allowlist mode for approved channels.
|
||||
- Reinstall the Slack app after changing scopes.
|
||||
@@ -95,10 +88,8 @@ Then DM the bot again, or mention it in a channel:
|
||||
## Troubleshooting
|
||||
|
||||
- If Socket Mode fails, confirm the app-level token starts with `xapp-`.
|
||||
- If the bot cannot send files, add `files:write`, reinstall the app, and
|
||||
restart nanobot.
|
||||
- If a DM responds normally without pairing, check that `dm.policy` is
|
||||
`"allowlist"`.
|
||||
- If the bot cannot send files, add `files:write`, reinstall the app, and restart nanobot.
|
||||
- If a DM responds normally without pairing, check that `dm.policy` is `"allowlist"`.
|
||||
- If channel messages are ignored, check event subscriptions and group policy.
|
||||
|
||||
## Next: memory, automations, MCP tools
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Connect Telegram to nanobot
|
||||
|
||||
This guide connects one Telegram bot to nanobot. Messages sent to that bot use
|
||||
your normal nanobot model, tools, memory, and workspace.
|
||||
This guide connects one Telegram bot to nanobot. Messages sent to that bot use your normal nanobot model, tools, memory, and workspace.
|
||||
|
||||
## What this guide builds
|
||||
|
||||
@@ -38,20 +37,14 @@ nanobot webui
|
||||
|
||||
Open **Settings → Channels → Telegram**:
|
||||
|
||||
1. If Telegram support is not installed, turn on its switch and confirm the
|
||||
installation.
|
||||
1. If Telegram support is not installed, turn on its switch and confirm the installation.
|
||||
2. Paste the token from BotFather.
|
||||
3. If the gateway cannot reach Telegram directly, expand **Advanced** and enter
|
||||
an HTTP or SOCKS proxy such as `http://127.0.0.1:7890`.
|
||||
3. If the gateway cannot reach Telegram directly, expand **Advanced** and enter an HTTP or SOCKS proxy such as `http://127.0.0.1:7890`.
|
||||
4. Save and enable Telegram.
|
||||
|
||||
The configuration badge appears as soon as a bot token is saved. A connection
|
||||
check is separate: if Telegram is temporarily unreachable, the saved
|
||||
configuration remains valid and the bot can continue working in environments
|
||||
where the gateway has network access.
|
||||
The configuration badge appears as soon as a bot token is saved. A connection check is separate: if Telegram is temporarily unreachable, the saved configuration remains valid and the bot can continue working in environments where the gateway has network access.
|
||||
|
||||
Saved tokens and proxy URLs are masked. A proxy entered here is used both for
|
||||
the connection check and for normal Telegram traffic.
|
||||
Saved tokens and proxy URLs are masked. A proxy entered here is used both for the connection check and for normal Telegram traffic.
|
||||
|
||||
## Manual setup
|
||||
|
||||
@@ -77,11 +70,9 @@ Then merge this snippet into `~/.nanobot/config.json`:
|
||||
|
||||
Omit `proxy` when the gateway can reach Telegram directly.
|
||||
|
||||
Omitting `allowFrom` enables pairing-only mode. The first DM from a new user
|
||||
gets a pairing code instead of agent access.
|
||||
Omitting `allowFrom` enables pairing-only mode. The first DM from a new user gets a pairing code instead of agent access.
|
||||
|
||||
Telegram uses long polling by default. Webhook mode is available for public
|
||||
HTTPS deployments; start with long polling for the first test.
|
||||
Telegram uses long polling by default. Webhook mode is available for public HTTPS deployments; start with long polling for the first test.
|
||||
|
||||
## Run nanobot gateway
|
||||
|
||||
@@ -100,37 +91,28 @@ Open Telegram, DM the bot, and send:
|
||||
Hello from Telegram
|
||||
```
|
||||
|
||||
The bot should reply with a pairing code. Approve it from an already trusted
|
||||
surface, such as the local CLI:
|
||||
The bot should reply with a pairing code. Approve it from an already trusted surface, such as the local CLI:
|
||||
|
||||
```bash
|
||||
nanobot agent -m "/pairing approve ABCD-EFGH"
|
||||
```
|
||||
|
||||
Send the message again after approval. The reply should use the same model and
|
||||
workspace as your local CLI check.
|
||||
Send the message again after approval. The reply should use the same model and workspace as your local CLI check.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Prefer pairing-only mode for first setup. Add `allowFrom` only when you want a
|
||||
static allowlist instead of code approval.
|
||||
- Prefer pairing-only mode for first setup. Add `allowFrom` only when you want a static allowlist instead of code approval.
|
||||
- Do not use `allowFrom: ["*"]` unless the bot is isolated or intentionally public.
|
||||
- Rotate the BotFather token if it is pasted into logs or shared files.
|
||||
- Review tool access before adding group chats or more users.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If the channel is not listed, run `nanobot plugins enable telegram` again in
|
||||
the same Python environment.
|
||||
- If the WebUI shows a saved configuration but the live check cannot reach Telegram,
|
||||
the token is still saved. Confirm the gateway can reach `api.telegram.org`,
|
||||
or open **Advanced → Network proxy** and enter a proxy.
|
||||
- If Telegram rejects the token, copy the current token from BotFather or
|
||||
regenerate it.
|
||||
- If messages do not arrive, run `nanobot gateway --verbose` and confirm the
|
||||
Telegram channel is enabled.
|
||||
- If a first DM returns a pairing code, that is expected. Approve the code before
|
||||
testing normal agent replies.
|
||||
- If the channel is not listed, run `nanobot plugins enable telegram` again in the same Python environment.
|
||||
- If the WebUI shows a saved configuration but the live check cannot reach Telegram, the token is still saved. Confirm the gateway can reach `api.telegram.org`, or open **Advanced → Network proxy** and enter a proxy.
|
||||
- If Telegram rejects the token, copy the current token from BotFather or regenerate it.
|
||||
- If messages do not arrive, run `nanobot gateway --verbose` and confirm the Telegram channel is enabled.
|
||||
- If a first DM returns a pairing code, that is expected. Approve the code before testing normal agent replies.
|
||||
- If Telegram Web shows unsupported rich messages, keep `richMessages` disabled.
|
||||
|
||||
## Next: memory, automations, MCP tools
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Build a WeChat AI Agent with nanobot
|
||||
|
||||
This guide connects nanobot to WeChat through the `weixin` channel. The channel
|
||||
uses HTTP long polling with QR-code login through the supported upstream API.
|
||||
This guide connects nanobot to WeChat through the `weixin` channel. The channel uses HTTP long polling with QR-code login through the supported upstream API.
|
||||
|
||||
## What this guide builds
|
||||
|
||||
@@ -47,8 +46,7 @@ Merge this snippet into `~/.nanobot/config.json`:
|
||||
}
|
||||
```
|
||||
|
||||
Omitting `allowFrom` enables pairing-only mode. The first private WeChat message
|
||||
from a new sender gets a pairing code instead of agent access.
|
||||
Omitting `allowFrom` enables pairing-only mode. The first private WeChat message from a new sender gets a pairing code instead of agent access.
|
||||
|
||||
Log in:
|
||||
|
||||
@@ -67,33 +65,26 @@ nanobot gateway
|
||||
|
||||
## Test a message
|
||||
|
||||
Send a private WeChat message to the bot. It should reply with a pairing code.
|
||||
Approve it from a trusted local surface:
|
||||
Send a private WeChat message to the bot. It should reply with a pairing code. Approve it from a trusted local surface:
|
||||
|
||||
```bash
|
||||
nanobot agent -m "/pairing approve ABCD-EFGH"
|
||||
```
|
||||
|
||||
Send the message again after approval and watch gateway logs for the sender ID
|
||||
and reply.
|
||||
Send the message again after approval and watch gateway logs for the sender ID and reply.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Prefer pairing-only mode for first setup. Add `allowFrom` only when you want a
|
||||
static allowlist.
|
||||
- Prefer pairing-only mode for first setup. Add `allowFrom` only when you want a static allowlist.
|
||||
- Treat saved login state as sensitive account access.
|
||||
- Avoid connecting personal accounts to untrusted workspaces or broad tool
|
||||
permissions.
|
||||
- Avoid connecting personal accounts to untrusted workspaces or broad tool permissions.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If login fails, rerun `nanobot channels login weixin --force`.
|
||||
- If a first private message returns a pairing code, that is expected. Approve
|
||||
the code before testing normal agent replies.
|
||||
- If messages are denied without a pairing code, check gateway logs for whether
|
||||
WeChat provided the context token required for nanobot to reply.
|
||||
- If polling disconnects, restart the gateway and check network reachability to
|
||||
the upstream service.
|
||||
- If a first private message returns a pairing code, that is expected. Approve the code before testing normal agent replies.
|
||||
- If messages are denied without a pairing code, check gateway logs for whether WeChat provided the context token required for nanobot to reply.
|
||||
- If polling disconnects, restart the gateway and check network reachability to the upstream service.
|
||||
|
||||
## Next: memory, automations, MCP tools
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# Build a WhatsApp AI Agent with nanobot
|
||||
|
||||
This guide connects nanobot to WhatsApp through the `whatsapp` channel. The
|
||||
channel links as a WhatsApp device and uses the same nanobot agent runtime,
|
||||
tools, memory, and workspace as the CLI and WebUI.
|
||||
This guide connects nanobot to WhatsApp through the `whatsapp` channel. The channel links as a WhatsApp device and uses the same nanobot agent runtime, tools, memory, and workspace as the CLI and WebUI.
|
||||
|
||||
## What this guide builds
|
||||
|
||||
@@ -58,9 +56,7 @@ Merge this snippet into `~/.nanobot/config.json`:
|
||||
}
|
||||
```
|
||||
|
||||
Omitting `allowFrom` enables pairing-only mode for private chats. `groupPolicy`
|
||||
defaults to `"open"` in the channel, but `"mention"` is safer for a first
|
||||
deployment.
|
||||
Omitting `allowFrom` enables pairing-only mode for private chats. `groupPolicy` defaults to `"open"` in the channel, but `"mention"` is safer for a first deployment.
|
||||
|
||||
## Run nanobot gateway
|
||||
|
||||
@@ -71,33 +67,27 @@ nanobot gateway
|
||||
|
||||
## Test a message
|
||||
|
||||
Send the bot a private WhatsApp message. It should return a pairing code.
|
||||
Approve it from a trusted local surface:
|
||||
Send the bot a private WhatsApp message. It should return a pairing code. Approve it from a trusted local surface:
|
||||
|
||||
```bash
|
||||
nanobot agent -m "/pairing approve ABCD-EFGH"
|
||||
```
|
||||
|
||||
Send the message again after approval. The reply should use the same model and
|
||||
workspace as your local CLI check.
|
||||
Send the message again after approval. The reply should use the same model and workspace as your local CLI check.
|
||||
|
||||
## Security notes
|
||||
|
||||
- Treat the WhatsApp session database as account access.
|
||||
- Prefer pairing-only mode for first setup. Add `allowFrom` only when you want a
|
||||
static allowlist.
|
||||
- Prefer pairing-only mode for first setup. Add `allowFrom` only when you want a static allowlist.
|
||||
- Keep `groupPolicy` as `"mention"` before adding the bot to groups.
|
||||
- Avoid `allowFrom: ["*"]` unless the bot is intentionally public or isolated.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
- If QR linking fails, rerun `nanobot channels login whatsapp`.
|
||||
- If you are migrating from the old bridge, remove `bridgeUrl` and
|
||||
`bridgeToken`, then re-login.
|
||||
- If a sender appears as a LID instead of a phone number, let nanobot learn the
|
||||
mapping at runtime or use `lidMappings` in the full reference.
|
||||
- If a first private message returns a pairing code, approve it before testing
|
||||
normal replies.
|
||||
- If you are migrating from the old bridge, remove `bridgeUrl` and `bridgeToken`, then re-login.
|
||||
- If a sender appears as a LID instead of a phone number, let nanobot learn the mapping at runtime or use `lidMappings` in the full reference.
|
||||
- If a first private message returns a pairing code, approve it before testing normal replies.
|
||||
|
||||
## Next: memory, automations, MCP tools
|
||||
|
||||
|
||||
Reference in new issue
Block a user