Skip to content

Your lightweight open-source personal agent.

docs: remove manual paragraph line wraps (#6131)

chengyongru50256940beba
diff --git a/.agent/review-guide.md b/.agent/review-guide.md
index 4a3df25ff..8112ffc1c 100644
--- a/.agent/review-guide.md
+++ b/.agent/review-guide.md
@@ -1,73 +1,35 @@
# Review guide: independently updated WebUI clients and hosts
-Apply this checklist to changes to WebUI HTTP, WebSocket events/mutations,
-bootstrap, capabilities, host switching, and persisted browser state. Read this
-alongside the design and security constraints, not instead of them.
+Apply this checklist to changes to WebUI HTTP, WebSocket events/mutations, bootstrap, capabilities, host switching, and persisted browser state. Read this alongside the design and security constraints, not instead of them.
## Compatibility is a contract, not a package-version comparison
-- The local installation owns executable WebUI assets. A remote host supplies
- authenticated data, events, and media, never replacement JavaScript or CSS.
-- Negotiate the WebUI protocol in `webui/client_contract.py`. The pre-existing
- terminal `protocolVersion` is a separate contract; do not overload it.
-- Different package versions may use the same protocol. New hosts should keep
- the previously supported protocol when possible. Extra fields and unknown
- optional capabilities must not break older clients.
-- Add optional features as named capabilities. Gate their controls and requests
- at their owning interface; do not require a server upgrade for unrelated
- features. Raise the core protocol floor only for an intentional breaking
- change with a documented support window and migration path.
-- Missing/malformed metadata means **compatibility unconfirmed**, not “old
- server,” “bad SSH key,” or “network error.” Do not infer support from matching
- package versions. An unconfirmed core contract cannot authorize mutations.
-- A package update being available is not proof of incompatibility. Optional
- update notices must use verified release data, be dismissible, and never
- interrupt an otherwise compatible session.
+- The local installation owns executable WebUI assets. A remote host supplies authenticated data, events, and media, never replacement JavaScript or CSS.
+- Negotiate the WebUI protocol in `webui/client_contract.py`. The pre-existing terminal `protocolVersion` is a separate contract; do not overload it.
+- Different package versions may use the same protocol. New hosts should keep the previously supported protocol when possible. Extra fields and unknown optional capabilities must not break older clients.
+- Add optional features as named capabilities. Gate their controls and requests at their owning interface; do not require a server upgrade for unrelated features. Raise the core protocol floor only for an intentional breaking change with a documented support window and migration path.
+- Missing/malformed metadata means **compatibility unconfirmed**, not “old server,” “bad SSH key,” or “network error.” Do not infer support from matching package versions. An unconfirmed core contract cannot authorize mutations.
+- A package update being available is not proof of incompatibility. Optional update notices must use verified release data, be dismissible, and never interrupt an otherwise compatible session.
## Required proof for a changed contract
-- Current client/current host, current client/oldest supported host, and oldest
- supported client/current host. State the supported protocol range explicitly;
- never claim every historical nanobot release is supported.
-- Unknown, missing, malformed and future metadata; overlapping and disjoint
- protocol ranges; unknown optional capabilities; missing required capability.
-- Assert the actual public bootstrap/read/mutation/event behavior, not only a
- version-comparison helper. Keep an older client/host fixture independent of
- the implementation under test. Test the affected optional feature's fallback.
-- Reconnect after a host restart or upgrade. Previously issued credentials and
- stale cached compatibility must not bypass a changed host contract.
-- Prove local HTML/JS/CSS are used even when remote static files are missing or
- different. Missing local assets fail locally, never fall back to remote code.
-- HTTP reads, streamed messages, upload/download, cancellation, multiple tabs,
- and a response arriving after switching hosts remain scoped to their host.
-- Preserve drafts/preferences without mixing authentication, model choices,
- conversation history, file paths, or command execution across host origins.
+- Current client/current host, current client/oldest supported host, and oldest supported client/current host. State the supported protocol range explicitly; never claim every historical nanobot release is supported.
+- Unknown, missing, malformed and future metadata; overlapping and disjoint protocol ranges; unknown optional capabilities; missing required capability.
+- Assert the actual public bootstrap/read/mutation/event behavior, not only a version-comparison helper. Keep an older client/host fixture independent of the implementation under test. Test the affected optional feature's fallback.
+- Reconnect after a host restart or upgrade. Previously issued credentials and stale cached compatibility must not bypass a changed host contract.
+- Prove local HTML/JS/CSS are used even when remote static files are missing or different. Missing local assets fail locally, never fall back to remote code.
+- HTTP reads, streamed messages, upload/download, cancellation, multiple tabs, and a response arriving after switching hosts remain scoped to their host.
+- Preserve drafts/preferences without mixing authentication, model choices, conversation history, file paths, or command execution across host origins.
## Update UX and operator safety
-- Report the local version, host version (or “not reported”), compatibility,
- and which machine needs updating. A newer host must not be told to downgrade
- when the client needs updating.
-- Keep compatible version differences quiet. Show missing optional capabilities
- at the affected control. Block only unsupported core sessions or operations.
-- Reuse the application's settings rows, menus and dialogs. Do not introduce a
- second settings drawer or a persistent global warning for an optional update.
-- Explain that updating this computer does not update its hosts. Use the installation
- environment that owns the running process: installer/uv/pipx/pip, checkout,
- container, and service-managed deployments are not interchangeable.
-- Never silently install, restart, downgrade, revoke credentials, or reset
- configuration. Back up configuration/data and consider active tasks before
- an explicitly requested update. Verify the running process after restart,
- not merely whichever `nanobot` executable happens to be on PATH.
-- Update user documentation with the change. Do not present planned support or
- fixture-only tests as a completed real-server acceptance test.
+- Report the local version, host version (or “not reported”), compatibility, and which machine needs updating. A newer host must not be told to downgrade when the client needs updating.
+- Keep compatible version differences quiet. Show missing optional capabilities at the affected control. Block only unsupported core sessions or operations.
+- Reuse the application's settings rows, menus and dialogs. Do not introduce a second settings drawer or a persistent global warning for an optional update.
+- Explain that updating this computer does not update its hosts. Use the installation environment that owns the running process: installer/uv/pipx/pip, checkout, container, and service-managed deployments are not interchangeable.
+- Never silently install, restart, downgrade, revoke credentials, or reset configuration. Back up configuration/data and consider active tasks before an explicitly requested update. Verify the running process after restart, not merely whichever `nanobot` executable happens to be on PATH.
+- Update user documentation with the change. Do not present planned support or fixture-only tests as a completed real-server acceptance test.
## Current baseline
-WebUI protocol **1** with capability **`webui.core.v1`** is the initial explicit
-client/host contract. It covers the existing authenticated WebUI read, mutation,
-event, and media interfaces. Hosts predating this declaration are unconfirmed;
-the local-client mode requires updating them to a build that declares support.
-Their independent server WebUI remains a separate way to use that installation.
-This is an intentional prerequisite for local-client mode, not a blanket claim
-that legacy nanobot installations no longer function.
+WebUI protocol **1** with capability **`webui.core.v1`** is the initial explicit client/host contract. It covers the existing authenticated WebUI read, mutation, event, and media interfaces. Hosts predating this declaration are unconfirmed; the local-client mode requires updating them to a build that declares support. Their independent server WebUI remains a separate way to use that installation. This is an intentional prerequisite for local-client mode, not a blanket claim that legacy nanobot installations no longer function.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6a1e1d2e9..6d7860e66 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,13 +2,9 @@
Thank you for being here.
-nanobot is built with a simple belief: good tools should feel calm, clear, and humane.
-We care deeply about useful features, but we also believe in achieving more with less:
-solutions should be powerful without becoming heavy, and ambitious without becoming
-needlessly complicated.
+nanobot is built with a simple belief: good tools should feel calm, clear, and humane. We care deeply about useful features, but we also believe in achieving more with less: solutions should be powerful without becoming heavy, and ambitious without becoming needlessly complicated.
-This guide is not only about how to open a PR. It is also about how we hope to build
-software together: with care, clarity, and respect for the next person reading the code.
+This guide is not only about how to open a PR. It is also about how we hope to build software together: with care, clarity, and respect for the next person reading the code.
## Maintainers
@@ -32,12 +28,9 @@ PRs are welcome for:
- Refactoring that is clearly scoped and easy to review
- Changes to APIs or configuration, when the impact is documented
-For riskier or larger changes, please open an issue or draft PR early so the
-shape of the work can be discussed before the implementation grows too large.
+For riskier or larger changes, please open an issue or draft PR early so the shape of the work can be discussed before the implementation grows too large.
-WebUI and remote-host interface changes must follow the
-[client/host compatibility review checklist](.agent/review-guide.md), including
-independent client/server upgrades, host isolation, and actionable update guidance.
+WebUI and remote-host interface changes must follow the [client/host compatibility review checklist](.agent/review-guide.md), including independent client/server upgrades, host isolation, and actionable update guidance.
### Starting Work
@@ -50,12 +43,9 @@ git pull --ff-only upstream main
git switch -c your-topic-branch
```
-Use your primary HKUDS/nanobot remote in place of `upstream` if your checkout
-uses a different remote name.
+Use your primary HKUDS/nanobot remote in place of `upstream` if your checkout uses a different remote name.
-Keep unrelated local changes out of the topic branch. If your checkout already has
-work in progress, use a separate worktree or finish that work before starting a
-new branch.
+Keep unrelated local changes out of the topic branch. If your checkout already has work in progress, use a separate worktree or finish that work before starting a new branch.
## Development Setup
@@ -84,8 +74,7 @@ ruff format <files-you-changed>
### Strict Type Checking
-Strict type checking covers optional providers and channels. Reproduce the CI environment
-with the same dependency sources and commands:
+Strict type checking covers optional providers and channels. Reproduce the CI environment with the same dependency sources and commands:
```bash
uv sync --all-extras --dev
@@ -93,13 +82,11 @@ uv run --no-sync python -m scripts.install_channel_dependencies --all-channels
uv run --no-sync basedpyright
```
-Keep `--no-sync` on the final commands: channel dependencies come from their package
-manifests and are installed explicitly by the setup step.
+Keep `--no-sync` on the final commands: channel dependencies come from their package manifests and are installed explicitly by the setup step.
## Contribution License
-By submitting a contribution, you confirm that you have the right to submit it
-and agree that it will be licensed under the project's MIT License.
+By submitting a contribution, you confirm that you have the right to submit it and agree that it will be licensed under the project's MIT License.
## Code Style
@@ -121,62 +108,34 @@ In practice:
- Async: uses `asyncio` throughout; pytest with `asyncio_mode = "auto"`
- Prefer readable code over magical code
- Prefer focused patches over broad rewrites
-- Do not mix mechanical formatting, line wrapping, import sorting, or quote churn
- into a feature or bugfix PR. If formatting cleanup is needed, make it a
- separate formatting-only PR.
+- Do not mix mechanical formatting, line wrapping, import sorting, or quote churn into a feature or bugfix PR. If formatting cleanup is needed, make it a separate formatting-only PR.
- If a new abstraction is introduced, it should clearly reduce complexity rather than move it around
## Modifying CI Workflows
-If your PR touches `.github/workflows/`, please keep the CI within
-GitHub Actions' free tier:
+If your PR touches `.github/workflows/`, please keep the CI within GitHub Actions' free tier:
- Use only standard GitHub-hosted runners (`ubuntu-latest`, `windows-latest`)
-- Avoid macOS runners, larger runners (`*-cores`, `*-xlarge`, `*-gpu`),
- and self-hosted runners
+- Avoid macOS runners, larger runners (`*-cores`, `*-xlarge`, `*-gpu`), and self-hosted runners
- Avoid uploading large artifacts or using long retention
- Avoid paid Marketplace actions
-If your change genuinely needs to step outside this, please call it out
-explicitly in the PR description so it can be discussed before merge.
+If your change genuinely needs to step outside this, please call it out explicitly in the PR description so it can be discussed before merge.
## Release Packaging Contract
-Use the [release checklist](./docs/releasing.md) for candidate preparation, package checks,
-documentation coordination, and the final publication handoff.
-
-A stable install must never combine Python from one version with a TUI from another. Publish in
-this order:
-
-1. Before pushing a tag, set the package version, verify the exact candidate, build the source
- distribution, all five platform wheels and TUI archives, and review licenses, source offer, and relinking
- materials. Obtain the maintainer's source-offer commitment before publication.
-2. Merge the release preparation, verify that its packaged sources match the checked candidate,
- then publish the matching GitHub release tag (`vX.Y.Z`). Recheck any changed sources first.
-3. Attach the preverified TUI archives and checksums to the matching GitHub Release. Alternatively,
- manually run **Publish Terminal UI** for the exact tag with the compliance review confirmed;
- reverify its outputs, since a rebuild does not preserve the preflight artifact hashes.
-4. Verify every platform archive and checksum is publicly downloadable for fallback/source-built
- installations, then publish the same `X.Y.Z` source distribution and five platform wheels to PyPI.
-
-Each platform wheel contains the built WebUI and the matching native TUI. Pip chooses the wheel
-for the user's machine; launching the installed TUI must work without a GitHub download or Bun.
-The universal wheel produced by `uv build` is only an intermediate: use
-`scripts/build_tui_wheels.py` as described in the checklist, and do not upload that intermediate.
-The source distribution remains platform-neutral and does not bundle native binaries.
-Keep the platform-specific release archives for fallback/source-built installations. Both the
-wheel's `nanobot/tui/bin/` bundle and its matching archive must contain the executable,
-target-specific third-party notices, project and runtime licenses, corresponding application
-source, a written source offer, relinking instructions, and a checksum manifest. Never upload a
-naked TUI executable. Review the minimum OS, libc, architecture and runtime CPU requirements
-when changing Bun/OpenTUI; never apply portable platform tags without checking their binaries.
-Source checkouts use an editable Python install, run `tui/` with Bun, and
-rebuild stale `webui/` assets locally.
-
-The confirmation is an operational commitment, not a cosmetic checkbox. Before accepting it,
-verify that the exact Bun/WebKit revisions remain retrievable and that the project can honor the
-archive's corresponding-source offer for its full stated period. Preserve published archives and
-their source materials.
+Use the [release checklist](./docs/releasing.md) for candidate preparation, package checks, documentation coordination, and the final publication handoff.
+
+A stable install must never combine Python from one version with a TUI from another. Publish in this order:
+
+1. Before pushing a tag, set the package version, verify the exact candidate, build the source distribution, all five platform wheels and TUI archives, and review licenses, source offer, and relinking materials. Obtain the maintainer's source-offer commitment before publication.
+2. Merge the release preparation, verify that its packaged sources match the checked candidate, then publish the matching GitHub release tag (`vX.Y.Z`). Recheck any changed sources first.
+3. Attach the preverified TUI archives and checksums to the matching GitHub Release. Alternatively, manually run **Publish Terminal UI** for the exact tag with the compliance review confirmed; reverify its outputs, since a rebuild does not preserve the preflight artifact hashes.
+4. Verify every platform archive and checksum is publicly downloadable for fallback/source-built installations, then publish the same `X.Y.Z` source distribution and five platform wheels to PyPI.
+
+Each platform wheel contains the built WebUI and the matching native TUI. Pip chooses the wheel for the user's machine; launching the installed TUI must work without a GitHub download or Bun. The universal wheel produced by `uv build` is only an intermediate: use `scripts/build_tui_wheels.py` as described in the checklist, and do not upload that intermediate. The source distribution remains platform-neutral and does not bundle native binaries. Keep the platform-specific release archives for fallback/source-built installations. Both the wheel's `nanobot/tui/bin/` bundle and its matching archive must contain the executable, target-specific third-party notices, project and runtime licenses, corresponding application source, a written source offer, relinking instructions, and a checksum manifest. Never upload a naked TUI executable. Review the minimum OS, libc, architecture and runtime CPU requirements when changing Bun/OpenTUI; never apply portable platform tags without checking their binaries. Source checkouts use an editable Python install, run `tui/` with Bun, and rebuild stale `webui/` assets locally.
+
+The confirmation is an operational commitment, not a cosmetic checkbox. Before accepting it, verify that the exact Bun/WebKit revisions remain retrievable and that the project can honor the archive's corresponding-source offer for its full stated period. Preserve published archives and their source materials.
## Questions?
diff --git a/README.md b/README.md
index e789b42af..d8d0d53ef 100644
--- a/README.md
+++ b/README.md
@@ -128,16 +128,11 @@ python -m pip install nanobot-ai
If pip reports `externally-managed-environment` on macOS or Linux, use the one-command installer, `uv tool install nanobot-ai`, `pipx install nanobot-ai`, or install inside a virtual environment.
-Platform wheels include both the WebUI and the native terminal UI: macOS 13+ (Apple Silicon
-and Intel), glibc 2.17+ Linux (ARM64 and x64), and Windows x64. The x64 runtime requires SSE4.2.
-Pip selects the matching wheel; opening the TUI does not need a separate GitHub download or Bun
-installation. A source-distribution install on a supported target can use the matching checksummed
-GitHub release archive. On other platforms, use `nanobot --classic` or the WebUI.
+Platform wheels include both the WebUI and the native terminal UI: macOS 13+ (Apple Silicon and Intel), glibc 2.17+ Linux (ARM64 and x64), and Windows x64. The x64 runtime requires SSE4.2. Pip selects the matching wheel; opening the TUI does not need a separate GitHub download or Bun installation. A source-distribution install on a supported target can use the matching checksummed GitHub release archive. On other platforms, use `nanobot --classic` or the WebUI.
**Install from source**
-Clone the repository and install it in editable mode. Bun is required because the source
-checkout runs the matching TUI directly instead of downloading an older release binary.
+Clone the repository and install it in editable mode. Bun is required because the source checkout runs the matching TUI directly instead of downloading an older release binary.
```bash
git clone https://github.com/HKUDS/nanobot.git
@@ -145,18 +140,13 @@ cd nanobot
python -m venv .venv
```
-Activate it with `source .venv/bin/activate` on macOS/Linux or
-`.venv\Scripts\Activate.ps1` in Windows PowerShell, then run:
+Activate it with `source .venv/bin/activate` on macOS/Linux or `.venv\Scripts\Activate.ps1` in Windows PowerShell, then run:
```bash
python -m pip install -e .
```
-After that, the normal commands are identical to a stable install. `nanobot` runs the TUI
-from this checkout, and `nanobot webui` rebuilds stale frontend assets automatically. A later
-`git pull --ff-only` updates the Python, TUI, and WebUI source together; rerun
-`python -m pip install -e .` when Python dependencies change. Contributors should also read
-[`CONTRIBUTING.md`](./CONTRIBUTING.md).
+After that, the normal commands are identical to a stable install. `nanobot` runs the TUI from this checkout, and `nanobot webui` rebuilds stale frontend assets automatically. A later `git pull --ff-only` updates the Python, TUI, and WebUI source together; rerun `python -m pip install -e .` when Python dependencies change. Contributors should also read [`CONTRIBUTING.md`](./CONTRIBUTING.md).
Verify the install:
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md
index c9913b14e..355c72534 100644
--- a/THIRD_PARTY_NOTICES.md
+++ b/THIRD_PARTY_NOTICES.md
@@ -1,11 +1,6 @@
# Third-Party Notices
-The following third-party components are redistributed as part of the packaged
-nanobot Python distribution (`pip install nanobot-ai`). Native TUI executables are distributed
-separately in per-platform release archives. Each TUI archive carries its generated
-`THIRD_PARTY_NOTICES.txt`, project and runtime licenses, corresponding application source,
-written source offer, and relinking instructions; those target-specific notices are generated by
-`tui/scripts/release-notices.ts` and are not duplicated below.
+The following third-party components are redistributed as part of the packaged nanobot Python distribution (`pip install nanobot-ai`). Native TUI executables are distributed separately in per-platform release archives. Each TUI archive carries its generated `THIRD_PARTY_NOTICES.txt`, project and runtime licenses, corresponding application source, written source offer, and relinking instructions; those target-specific notices are generated by `tui/scripts/release-notices.ts` and are not duplicated below.
---
diff --git a/docs/agent-social-network.md b/docs/agent-social-network.md
index 2c6e49cc7..171806300 100644
--- a/docs/agent-social-network.md
+++ b/docs/agent-social-network.md
@@ -1,35 +1,21 @@
# Agent Social Network
-An agent social network lets a nanobot instance join an external agent community
-or chat network as a bot identity. After joining, nanobot can receive messages
-through that network, answer with its normal agent runtime, and use the same
-workspace, tools, memory, and channel access controls that apply elsewhere.
+An agent social network lets a nanobot instance join an external agent community or chat network as a bot identity. After joining, nanobot can receive messages through that network, answer with its normal agent runtime, and use the same workspace, tools, memory, and channel access controls that apply elsewhere.
-This page describes the current entry points and the safety model. Treat each
-network as an external integration: only join networks you trust, keep owner
-approval narrow, and review the skill instructions before asking nanobot to
-follow them.
+This page describes the current entry points and the safety model. Treat each network as an external integration: only join networks you trust, keep owner approval narrow, and review the skill instructions before asking nanobot to follow them.
## What is an agent social network?
-In nanobot docs, an agent social network is an external community that publishes
-setup instructions for nanobot-compatible agents. The setup usually lives in a
-remote `skill.md` file. You send nanobot a message asking it to read that file
-and follow the network's registration flow.
+In nanobot docs, an agent social network is an external community that publishes setup instructions for nanobot-compatible agents. The setup usually lives in a remote `skill.md` file. You send nanobot a message asking it to read that file and follow the network's registration flow.
-The external network is not part of nanobot core. nanobot provides the runtime:
-model calls, tools, memory, sessions, and channel delivery.
+The external network is not part of nanobot core. nanobot provides the runtime: model calls, tools, memory, sessions, and channel delivery.
> [!WARNING]
-> Remote `skill.md` files are external instructions. Review them before asking
-> nanobot to follow them, especially when file, shell, network, or chat-delivery
-> tools are enabled. Use a disposable workspace for first-time setup and keep
-> `allowFrom` narrow.
+> Remote `skill.md` files are external instructions. Review them before asking nanobot to follow them, especially when file, shell, network, or chat-delivery tools are enabled. Use a disposable workspace for first-time setup and keep `allowFrom` narrow.
## What nanobot can do after joining
-After setup, the exact behavior depends on the network, but the normal pattern
-is:
+After setup, the exact behavior depends on the network, but the normal pattern is:
- receive direct messages or community messages addressed to the bot
- reply through the configured network channel
@@ -44,22 +30,15 @@ is:
| [Moltbook](https://www.moltbook.com/) | `Read https://moltbook.com/skill.md and follow the instructions to join Moltbook` |
| [ClawdChat](https://clawdchat.ai/) | `Read https://clawdchat.ai/skill.md and follow the instructions to join ClawdChat` |
-Send the message from the CLI, WebUI, or an already configured chat channel.
-nanobot will read the public setup instructions and perform the requested setup
-using its available tools.
+Send the message from the CLI, WebUI, or an already configured chat channel. nanobot will read the public setup instructions and perform the requested setup using its available tools.
## Security model
-- The remote setup instructions are external content. Read them yourself before
- running the join prompt if the bot has file, shell, or network tools enabled.
-- Keep `allowFrom` narrow on the channel you use for setup so only trusted users
- can issue registration commands.
-- Keep `tools.restrictToWorkspace` enabled unless the network setup explicitly
- needs another path.
-- Avoid `allowFrom: ["*"]` during setup unless the bot is isolated in a test
- workspace.
-- Store network tokens through environment variables when the integration
- supports secrets.
+- The remote setup instructions are external content. Read them yourself before running the join prompt if the bot has file, shell, or network tools enabled.
+- Keep `allowFrom` narrow on the channel you use for setup so only trusted users can issue registration commands.
+- Keep `tools.restrictToWorkspace` enabled unless the network setup explicitly needs another path.
+- Avoid `allowFrom: ["*"]` during setup unless the bot is isolated in a test workspace.
+- Store network tokens through environment variables when the integration supports secrets.
## Example workflow
@@ -79,17 +58,14 @@ nanobot agent -m "Hello!"
nanobot gateway
```
-5. Send a test message through the external network and confirm the session is
- routed to the expected workspace and model.
+5. Send a test message through the external network and confirm the session is routed to the expected workspace and model.
## Limitations
-- Network features, identity, and moderation rules are controlled by the
- external network.
+- Network features, identity, and moderation rules are controlled by the external network.
- Availability depends on the remote setup instructions remaining reachable.
- nanobot does not automatically audit remote skills for you.
-- Some networks may require public callbacks, tokens, or channel-specific
- account setup.
+- Some networks may require public callbacks, tokens, or channel-specific account setup.
## Related docs
diff --git a/docs/architecture.md b/docs/architecture.md
index 273d8e014..c39b5dcdb 100644
--- a/docs/architecture.md
+++ b/docs/architecture.md
@@ -51,12 +51,7 @@ Main files:
- feeds tool results back into the model;
- stops when a final answer is produced or runtime limits are hit.
-MCP connections are application-owned infrastructure. Composition roots create
-an `MCPProvider`, share its `ToolRegistry` with `AgentLoop`, await `connect()`
-before use, and guarantee `aclose()` during shutdown; the loop does not manage
-that lifecycle. `AgentLoop.from_config()` therefore requires a caller-owned
-`ToolRegistry`; callers using MCP share it with their application-owned
-`MCPProvider`.
+MCP connections are application-owned infrastructure. Composition roots create an `MCPProvider`, share its `ToolRegistry` with `AgentLoop`, await `connect()` before use, and guarantee `aclose()` during shutdown; the loop does not manage that lifecycle. `AgentLoop.from_config()` therefore requires a caller-owned `ToolRegistry`; callers using MCP share it with their application-owned `MCPProvider`.
Keep this split in mind when debugging. If a problem is about channel routing, session keys, workspace selection, or outbound delivery, start in `agent/loop.py`. If it is about provider calls, tool calls, streaming, or iteration limits, start in `agent/runner.py`.
@@ -74,18 +69,9 @@ Provider selection uses:
Provider implementations live in `nanobot/providers/`. Most hosted providers use the OpenAI-compatible implementation, while Anthropic, Azure OpenAI, AWS Bedrock, OpenAI Codex, and GitHub Copilot have specialized paths.
-Responses API paths share `nanobot/providers/openai_responses/backend.py`.
-The backend constructs protocol input, dispatches SDK or HTTP/SSE requests,
-owns WebSocket sessions, and advances replay and compaction state. SDK, SSE,
-and WebSocket events use the same parser in `openai_responses/parsing.py`.
+Responses API paths share `nanobot/providers/openai_responses/backend.py`. The backend constructs protocol input, dispatches SDK or HTTP/SSE requests, owns WebSocket sessions, and advances replay and compaction state. SDK, SSE, and WebSocket events use the same parser in `openai_responses/parsing.py`.
-Provider adapters supply authentication, endpoint and model rules, supported
-request fields, hosted tools, and error mapping. Codex enables WebSocket with
-its beta header; other adapters retain their existing HTTP transports. Protocol
-compatibility alone does not enable WebSocket or persistent continuation.
-OpenAI's `extraBody.store` override controls server storage; automatic response-ID
-continuation currently uses the active WebSocket connection. Full replay state
-remains local and scoped to the provider endpoint and model.
+Provider adapters supply authentication, endpoint and model rules, supported request fields, hosted tools, and error mapping. Codex enables WebSocket with its beta header; other adapters retain their existing HTTP transports. Protocol compatibility alone does not enable WebSocket or persistent continuation. OpenAI's `extraBody.store` override controls server storage; automatic response-ID continuation currently uses the active WebSocket connection. Full replay state remains local and scoped to the provider endpoint and model.
Useful docs:
@@ -171,9 +157,7 @@ The schema accepts both camelCase and snake_case keys, but saves config with cam
### Agent-Owned State vs Effective Project Context
-Runtime code distinguishes the configured agent workspace from the effective
-project workspace carried by a session scope. They are often the same path, but
-a WebUI chat may select a separate project:
+Runtime code distinguishes the configured agent workspace from the effective project workspace carried by a session scope. They are often the same path, but a WebUI chat may select a separate project:
| Concern | Path owner |
|---|---|
@@ -181,21 +165,13 @@ a WebUI chat may select a separate project:
| Project `AGENTS.md`, relative tool paths, and shell working directory | Effective project workspace |
| Workspace access mode and project metadata | Session workspace scope |
-`ContextBuilder` combines project instructions with agent-owned profile and
-memory. Filesystem and search tools use the project as their ordinary boundary
-and receive only capability-specific read access to built-in/agent skills and
-the exact agent history file. Keep those cross-root capabilities read-only and
-explicit; do not treat the entire agent workspace as an allowed root.
+`ContextBuilder` combines project instructions with agent-owned profile and memory. Filesystem and search tools use the project as their ordinary boundary and receive only capability-specific read access to built-in/agent skills and the exact agent history file. Keep those cross-root capabilities read-only and explicit; do not treat the entire agent workspace as an allowed root.
## Memory and Sessions
Session history is the near-term conversation replay. Memory is the longer-term workspace state.
-`nanobot/session/history.py` reads full persisted session records for
-`search_sessions` and `read_session`, including messages before summary
-checkpoints. Tool results contain public user and assistant text with indexes
-into the original session messages. WebUI transcript events and replay pagination
-are owned by the display adapter and do not supply tool history.
+`nanobot/session/history.py` reads full persisted session records for `search_sessions` and `read_session`, including messages before summary checkpoints. Tool results contain public user and assistant text with indexes into the original session messages. WebUI transcript events and replay pagination are owned by the display adapter and do not supply tool history.
| Store | File area |
|---|---|
diff --git a/docs/automations.md b/docs/automations.md
index b4f3a5734..a21734db8 100644
--- a/docs/automations.md
+++ b/docs/automations.md
@@ -2,14 +2,9 @@
<!-- Meta description: Create, run, and manage nanobot scheduled automations, local triggers, and heartbeat-backed background checks. -->
-Automations are agent turns that run later in a linked topic. Use them
-when nanobot should do work without someone actively typing: reminders,
-recurring checks, nightly summaries, CI follow-ups, local script reports, or
-webhook-driven events.
+Automations are agent turns that run later in a linked topic. Use them when nanobot should do work without someone actively typing: reminders, recurring checks, nightly summaries, CI follow-ups, local script reports, or webhook-driven events.
-Create automations from the chat channel or WebUI topic where the
-result should appear. That lets nanobot keep the right session history,
-workspace, and reply target.
+Create automations from the chat channel or WebUI topic where the result should appear. That lets nanobot keep the right session history, workspace, and reply target.
## Choose an Automation Type
@@ -19,28 +14,19 @@ workspace, and reply target.
| Local trigger | A local `nanobot trigger ...` command | CI jobs, webhooks, shell scripts, generated reports | `/trigger <name>` in the target topic |
| Heartbeat | Protected system schedule | Quiet recurring checks that should only report useful results | Edit `<workspace>/HEARTBEAT.md` |
-The two user-created automation types are scheduled automations and local
-triggers. Heartbeat uses the same background service but is system-managed and
-protected from normal automation edits.
+The two user-created automation types are scheduled automations and local triggers. Heartbeat uses the same background service but is system-managed and protected from normal automation edits.
## Before You Create One
-Keep `nanobot gateway` running. The gateway owns background delivery for chat
-apps, WebUI topics, scheduled automations, local triggers, heartbeat, and
-Dream jobs.
+Keep `nanobot gateway` running. The gateway owns background delivery for chat apps, WebUI topics, scheduled automations, local triggers, heartbeat, and Dream jobs.
-Use the same workspace and config for the gateway and any process that sends
-local trigger messages. If you run multiple nanobot instances, pass the matching
-`--config` or `--workspace` option to `nanobot trigger`.
+Use the same workspace and config for the gateway and any process that sends local trigger messages. If you run multiple nanobot instances, pass the matching `--config` or `--workspace` option to `nanobot trigger`.
-Create each automation from the target topic. An automation without a linked
-topic cannot be enabled or run from the WebUI because nanobot would not know
-where to deliver the turn.
+Create each automation from the target topic. An automation without a linked topic cannot be enabled or run from the WebUI because nanobot would not know where to deliver the turn.
## Scheduled Automations
-Scheduled automations are created by the agent's `cron` tool. In practice, ask
-nanobot from the target chat or WebUI topic:
+Scheduled automations are created by the agent's `cron` tool. In practice, ask nanobot from the target chat or WebUI topic:
```text
Every weekday at 9am, check open pull requests and summarize blockers here.
@@ -52,43 +38,25 @@ or:
Tomorrow at 4pm, remind me to send the release notes.
```
-The cron tool supports interval schedules, cron expressions, and one-time
-scheduled tasks. Cron expressions can include an IANA timezone such as
-`America/Vancouver`; otherwise nanobot uses the runtime default timezone.
+The cron tool supports interval schedules, cron expressions, and one-time scheduled tasks. Cron expressions can include an IANA timezone such as `America/Vancouver`; otherwise nanobot uses the runtime default timezone.
-Scheduled automations normally deliver the result back to the session where they
-were created. Use them for work that should run on a predictable schedule and
-report each run.
+Scheduled automations normally deliver the result back to the session where they were created. Use them for work that should run on a predictable schedule and report each run.
-Write what the task should do, such as "Remind me to drink water". nanobot sends
-the final reply to the task's saved chat. You do not need to put a channel, chat
-ID, or a `message` tool call in the instructions for that reply.
+Write what the task should do, such as "Remind me to drink water". nanobot sends the final reply to the task's saved chat. You do not need to put a channel, chat ID, or a `message` tool call in the instructions for that reply.
-For separate sends, specify the recipients in the instructions. The agent can
-still use `message` to send to other chats, send to several recipients, or attach
-files. Existing tasks that explicitly request this tool remain supported.
+For separate sends, specify the recipients in the instructions. The agent can still use `message` to send to other chats, send to several recipients, or attach files. Existing tasks that explicitly request this tool remain supported.
-For background checks that should stay quiet unless there is something useful to
-report, use heartbeat instead of a user-created scheduled automation.
+For background checks that should stay quiet unless there is something useful to report, use heartbeat instead of a user-created scheduled automation.
-Repetition alone does not select heartbeat. "Every day at 8am, remind me to
-drink water" needs a cron schedule. "Keep an eye on open issues and tell me
-when one needs attention" can use heartbeat if the check time is flexible.
-Heartbeat does not guarantee a requested time or interval.
+Repetition alone does not select heartbeat. "Every day at 8am, remind me to drink water" needs a cron schedule. "Keep an eye on open issues and tell me when one needs attention" can use heartbeat if the check time is flexible. Heartbeat does not guarantee a requested time or interval.
-An upgrade does not overwrite your workspace's `AGENTS.md` or convert existing
-heartbeat entries into cron jobs. The current scheduling rules are included in
-the system prompt. If an old workspace rule directs all recurring tasks to
-heartbeat, update that rule too. To correct an existing reminder, remove its old
-heartbeat entry and create the cron task once. Check the task list to avoid duplicates.
+An upgrade does not overwrite your workspace's `AGENTS.md` or convert existing heartbeat entries into cron jobs. The current scheduling rules are included in the system prompt. If an old workspace rule directs all recurring tasks to heartbeat, update that rule too. To correct an existing reminder, remove its old heartbeat entry and create the cron task once. Check the task list to avoid duplicates.
## Local Triggers
-Local triggers let a local script or external service send a message into a
-specific nanobot session later.
+Local triggers let a local script or external service send a message into a specific nanobot session later.
-Create the trigger from the chat or WebUI topic where future messages should
-arrive:
+Create the trigger from the chat or WebUI topic where future messages should arrive:
```text
/trigger PR review
@@ -100,140 +68,82 @@ nanobot replies with a trigger ID and a command shaped like:
nanobot trigger trg_8K4P2Q9X "Review PR #4502"
```
-Replace the quoted text with the message nanobot should receive. For generated
-or longer content, pipe stdin:
+Replace the quoted text with the message nanobot should receive. For generated or longer content, pipe stdin:
```bash
generate-report | nanobot trigger trg_8K4P2Q9X
```
-For multiple instances, use the same config or workspace selector as the
-gateway:
+For multiple instances, use the same config or workspace selector as the gateway:
```bash
nanobot trigger --config ./bot-a/config.json trg_8K4P2Q9X "Nightly report"
nanobot trigger --workspace ./bot-a/workspace trg_8K4P2Q9X "Nightly report"
```
-nanobot does not provide a built-in public webhook receiver for local triggers.
-If GitHub, CI, or another external system should wake nanobot, run your own
-small webhook service and have it call `nanobot trigger` after it builds the
-final message.
+nanobot does not provide a built-in public webhook receiver for local triggers. If GitHub, CI, or another external system should wake nanobot, run your own small webhook service and have it call `nanobot trigger` after it builds the final message.
## Heartbeat
-Heartbeat is for recurring workspace checks that should usually stay quiet. It
-reads `<workspace>/HEARTBEAT.md`, executes active tasks, and sends only useful or
-actionable results to the most recently active chat target.
+Heartbeat is for recurring workspace checks that should usually stay quiet. It reads `<workspace>/HEARTBEAT.md`, executes active tasks, and sends only useful or actionable results to the most recently active chat target.
-Use heartbeat for checks such as "watch this repo for important failures" or
-"periodically inspect this workspace and only tell me when action is needed." Use
-a scheduled automation instead when every run should produce a visible reminder
-or report.
+Use heartbeat for checks such as "watch this repo for important failures" or "periodically inspect this workspace and only tell me when action is needed." Use a scheduled automation instead when every run should produce a visible reminder or report.
-Heartbeat is enabled by default when `nanobot gateway` starts. Configure it in
-[`configuration.md#gateway-heartbeat`](./configuration.md#gateway-heartbeat).
+Heartbeat is enabled by default when `nanobot gateway` starts. Configure it in [`configuration.md#gateway-heartbeat`](./configuration.md#gateway-heartbeat).
## Manage Automations
Use the WebUI Automations view to:
- filter by all, active, paused, needs-attention, or system jobs;
-- search by task name, message, trigger command, linked topic, schedule, or
- status;
+- search by task name, message, trigger command, linked topic, schedule, or status;
- sort by next run, last run, updated time, or name;
- run scheduled automations now;
- pause or resume, rename, or delete user-created automations;
- copy the CLI command for local triggers;
- inspect protected system automations without changing them.
-Local triggers do not have a WebUI "Run now" action because each run needs a
-message. Copy the `nanobot trigger ...` command from the WebUI and replace
-`"message"` with the content that should be delivered.
+Local triggers do not have a WebUI "Run now" action because each run needs a message. Copy the `nanobot trigger ...` command from the WebUI and replace `"message"` with the content that should be delivered.
### Change the Chat for a Scheduled Task
-Open a scheduled task in **Automations**. **Run and reply in** shows its saved chat,
-with the channel logo and name. WebUI chats use the same display names as the
-sidebar. A renamed chat keeps its identity and task binding. Chats with the same
-name show an `@handle` to help you tell them apart.
+Open a scheduled task in **Automations**. **Run and reply in** shows its saved chat, with the channel logo and name. WebUI chats use the same display names as the sidebar. A renamed chat keeps its identity and task binding. Chats with the same name show an `@handle` to help you tell them apart.
To change the chat:
1. Select another chat from **Run and reply in**.
-2. Review the task instructions, which are read-only by default. If they need
- changes, select **Edit instructions**. Remove recipients you no longer want,
- but keep intended separate sends. Members of the new chat can see future task messages and results.
+2. Review the task instructions, which are read-only by default. If they need changes, select **Edit instructions**. Remove recipients you no longer want, but keep intended separate sends. Members of the new chat can see future task messages and results.
3. Select **Confirm change**. Wait for the saved confirmation.
-If you edit the instructions, the button becomes **Save and change**. Both
-changes are saved together; nothing is saved when you select **Edit instructions**.
-To change the task name or schedule, use **Edit** in the task details instead.
-
-Select **Cancel** before saving to return to the task without changes. After a
-successful save, select **Change back to** to review a return to the previous
-chat. You must confirm this change too. You can also select a previous chat from
-the list later. This changes future runs; it does not recall messages already sent.
-
-Future runs use the new chat's history and reply there by default. Previous
-messages stay in their original chat. Previous run results remain available.
-Changing the chat does not run the task, enable it, or change its schedule.
-
-You can discuss each new result in that same chat. Background task results also
-return there. If you delete that chat, nanobot asks you to confirm deletion of
-its scheduled tasks as well. Cancelling the deletion keeps the chat and tasks.
-
-The list contains existing chats on the same gateway with the same effective
-workspace and access mode. Chat-app targets need a running channel and a saved
-reply route from an earlier incoming message. If a chat is missing, send nanobot
-a message there and check that its channel is running. Raw recipient IDs,
-cross-host moves, unified sessions, system jobs, and local triggers are not
-supported by this selector. An older gateway keeps the existing read-only view.
-
-If a scheduled turn is running or queued, wait for it to finish before changing
-the chat. The current scheduler also rejects a change while another scheduled
-turn is active. If another editor changes the task, reopen the task and review
-the latest instructions. A rejected save leaves the draft visible.
-
-This changes the whole task chat, not a separate forwarding address. Explicit
-`message` tool instructions can still send elsewhere. Shared workspace files
-and memory remain shared; changing the chat does not create a new security boundary.
-The confirmation screen lets you edit instructions such as "send to the original
-chat" before you save. nanobot does not silently rewrite those instructions.
+If you edit the instructions, the button becomes **Save and change**. Both changes are saved together; nothing is saved when you select **Edit instructions**. To change the task name or schedule, use **Edit** in the task details instead.
+
+Select **Cancel** before saving to return to the task without changes. After a successful save, select **Change back to** to review a return to the previous chat. You must confirm this change too. You can also select a previous chat from the list later. This changes future runs; it does not recall messages already sent.
+
+Future runs use the new chat's history and reply there by default. Previous messages stay in their original chat. Previous run results remain available. Changing the chat does not run the task, enable it, or change its schedule.
+
+You can discuss each new result in that same chat. Background task results also return there. If you delete that chat, nanobot asks you to confirm deletion of its scheduled tasks as well. Cancelling the deletion keeps the chat and tasks.
+
+The list contains existing chats on the same gateway with the same effective workspace and access mode. Chat-app targets need a running channel and a saved reply route from an earlier incoming message. If a chat is missing, send nanobot a message there and check that its channel is running. Raw recipient IDs, cross-host moves, unified sessions, system jobs, and local triggers are not supported by this selector. An older gateway keeps the existing read-only view.
+
+If a scheduled turn is running or queued, wait for it to finish before changing the chat. The current scheduler also rejects a change while another scheduled turn is active. If another editor changes the task, reopen the task and review the latest instructions. A rejected save leaves the draft visible.
+
+This changes the whole task chat, not a separate forwarding address. Explicit `message` tool instructions can still send elsewhere. Shared workspace files and memory remain shared; changing the chat does not create a new security boundary. The confirmation screen lets you edit instructions such as "send to the original chat" before you save. nanobot does not silently rewrite those instructions.
### Back Up Before Downgrading
-Chat changes store a binding version and the session used by each previous run.
-Existing jobs do not need a manual migration when upgrading. Older nanobot
-versions can discard these new fields when they write the cron store. After a
-chat change, that can make old run results unavailable in the WebUI and remove
-protection against stale CLI updates.
+Chat changes store a binding version and the session used by each previous run. Existing jobs do not need a manual migration when upgrading. Older nanobot versions can discard these new fields when they write the cron store. After a chat change, that can make old run results unavailable in the WebUI and remove protection against stale CLI updates.
-Before trying this feature, stop the gateway and other cron writers, then back
-up the complete cron directory in the active instance's data directory. For a
-downgrade after changing a chat, stop those processes again and restore that
-coherent pre-change cron backup. This also restores the old schedules and task
-settings; later changes are not included. Chat messages are not moved or deleted.
+Before trying this feature, stop the gateway and other cron writers, then back up the complete cron directory in the active instance's data directory. For a downgrade after changing a chat, stop those processes again and restore that coherent pre-change cron backup. This also restores the old schedules and task settings; later changes are not included. Chat messages are not moved or deleted.
## Delivery and Reliability
-Automation delivery is workspace-local. Scheduled jobs and local trigger
-deliveries use the same workspace as the gateway.
+Automation delivery is workspace-local. Scheduled jobs and local trigger deliveries use the same workspace as the gateway.
-Local trigger messages are written to a durable queue. If the gateway is not
-running yet, the message waits in that workspace. If the linked topic is
-already running a turn, the trigger waits until the session becomes idle instead
-of being injected into the active turn.
+Local trigger messages are written to a durable queue. If the gateway is not running yet, the message waits in that workspace. If the linked topic is already running a turn, the trigger waits until the session becomes idle instead of being injected into the active turn.
-The local trigger queue is at-least-once, not exactly-once. If the gateway exits
-after claiming a delivery but before the linked turn completes, the next gateway
-start requeues that delivery. External scripts should make repeated trigger
-messages safe. If the delivery reaches the agent and the turn fails, the
-delivery is marked failed instead of retrying forever.
+The local trigger queue is at-least-once, not exactly-once. If the gateway exits after claiming a delivery but before the linked turn completes, the next gateway start requeues that delivery. External scripts should make repeated trigger messages safe. If the delivery reaches the agent and the turn fails, the delivery is marked failed instead of retrying forever.
-Each local trigger delivery writes an audit record under
-`<workspace>/triggers/runs`. Run one gateway consumer per workspace; the local
-queue is not a distributed multi-consumer queue.
+Each local trigger delivery writes an audit record under `<workspace>/triggers/runs`. Run one gateway consumer per workspace; the local queue is not a distributed multi-consumer queue.
## Common Patterns
@@ -263,17 +173,13 @@ generate-report | nanobot trigger <trigger-id>
## Troubleshooting
-If an automation does not run, check that `nanobot gateway` is running, the
-automation is enabled, and it was created from a linked topic.
+If an automation does not run, check that `nanobot gateway` is running, the automation is enabled, and it was created from a linked topic.
-If a local trigger waits forever, confirm the command uses the same workspace or
-config as the gateway.
+If a local trigger waits forever, confirm the command uses the same workspace or config as the gateway.
-If a trigger message appears twice after a restart, treat it as expected
-at-least-once delivery and make the external message idempotent.
+If a trigger message appears twice after a restart, treat it as expected at-least-once delivery and make the external message idempotent.
-If you need to edit, pause, resume, rename, delete, or inspect automations, use
-the WebUI Automations view.
+If you need to edit, pause, resume, rename, delete, or inspect automations, use the WebUI Automations view.
## Related Docs
diff --git a/docs/chat-apps.md b/docs/chat-apps.md
index 9de693f02..6b9eb61cc 100644
--- a/docs/chat-apps.md
+++ b/docs/chat-apps.md
@@ -1,8 +1,6 @@
# Chat Apps for Self-Hosted AI Agents
-Connect nanobot to Telegram, Discord, Slack, WeChat, Email, Mattermost, Linear, and
-other chat platforms. This page is the full chat-channel reference. If you want
-a focused setup path for one platform, start with a guide:
+Connect nanobot to Telegram, Discord, Slack, WeChat, Email, Mattermost, Linear, and other chat platforms. This page is the full chat-channel reference. If you want a focused setup path for one platform, start with a guide:
| Platform | Guide |
|---|---|
@@ -46,19 +44,13 @@ Optional package installation is available to a same-machine WebUI by default. R
The sections below explain what each chat platform requires and provide manual config for deployments that manage `config.json` directly.
> [!NOTE]
-> If you are upgrading from a version where chat app SDKs were installed by default,
-> enable the channel in the same Python environment so nanobot installs its
-> manifest-declared dependencies:
+> If you are upgrading from a version where chat app SDKs were installed by default, enable the channel in the same Python environment so nanobot installs its manifest-declared dependencies:
>
> ```bash
> nanobot plugins enable <channel>
> ```
>
-> Replace `<channel>` with names such as `telegram`, `slack`, `feishu`,
-> `dingtalk`, `matrix`, `qq`, `napcat`, `weixin`, `wecom`, or `msteams`.
-> To turn a channel off later, run `nanobot plugins disable <channel>`.
-> nanobot keeps the saved settings, but stops loading that channel after the
-> next restart.
+> Replace `<channel>` with names such as `telegram`, `slack`, `feishu`, `dingtalk`, `matrix`, `qq`, `napcat`, `weixin`, `wecom`, or `msteams`. To turn a channel off later, run `nanobot plugins disable <channel>`. nanobot keeps the saved settings, but stops loading that channel after the next restart.
## Manual Setup Pattern
@@ -111,27 +103,13 @@ If `nanobot channels status` does not show the channel as enabled, the config sn
<details id="linear">
<summary><b>Linear</b></summary>
-Linear is a native Agent channel rather than a comment bot. A user starts a task
-by explicitly mentioning the installed nanobot app in an issue. Follow-up prompts
-inside that Agent Session continue the same nanobot session without another
-mention. Ordinary issue comments do not invoke nanobot.
+Linear is a native Agent channel rather than a comment bot. A user starts a task by explicitly mentioning the installed nanobot app in an issue. Follow-up prompts inside that Agent Session continue the same nanobot session without another mention. Ordinary issue comments do not invoke nanobot.
-The native Agent API is webhook-based. Linear must reach a public HTTPS URL.
-An HTTPS tunnel can forward requests to nanobot's local listener without a public
-IP; a publicly reachable server can use a reverse proxy. Use a fixed hostname for
-ongoing use. Temporary tunnels also work for testing, but a hostname change
-requires updating nanobot's public URL and the app's callback and webhook URLs.
+The native Agent API is webhook-based. Linear must reach a public HTTPS URL. An HTTPS tunnel can forward requests to nanobot's local listener without a public IP; a publicly reachable server can use a reverse proxy. Use a fixed hostname for ongoing use. Temporary tunnels also work for testing, but a hostname change requires updating nanobot's public URL and the app's callback and webhook URLs.
-The recommended setup is **Settings → Channels → Linear**. Enter the public URL
-and wait for automatic saving, select **Create prefilled Linear app**, create the
-app, then copy its Client ID, Client Secret, and Webhook Signing Secret back into
-nanobot. Leave each secret field to save it. Once the settings are saved, choose
-**Connect Linear**. OAuth requests only `read`, `write`, and
-`app:mentionable`; it deliberately does not request `app:assignable` so a new task
-must begin with an @mention.
+The recommended setup is **Settings → Channels → Linear**. Enter the public URL and wait for automatic saving, select **Create prefilled Linear app**, create the app, then copy its Client ID, Client Secret, and Webhook Signing Secret back into nanobot. Leave each secret field to save it. Once the settings are saved, choose **Connect Linear**. OAuth requests only `read`, `write`, and `app:mentionable`; it deliberately does not request `app:assignable` so a new task must begin with an @mention.
-See the [native Linear agent guide](./guides/linear-agent.md) for the complete
-setup, tunnel examples, security model, and troubleshooting.
+See the [native Linear agent guide](./guides/linear-agent.md) for the complete setup, tunnel examples, security model, and troubleshooting.
</details>
@@ -142,16 +120,12 @@ setup, tunnel examples, security model, and troubleshooting.
1. Create a bot with `@BotFather` and copy its token.
2. Run `nanobot webui`, then open **Settings → Channels → Telegram**.
-3. Paste the token. If the gateway cannot reach Telegram directly, expand
- **Advanced** and add an HTTP or SOCKS proxy.
+3. Paste the token. If the gateway cannot reach Telegram directly, expand **Advanced** and add an HTTP or SOCKS proxy.
4. Save and enable Telegram, then send the bot a direct message.
-The configuration badge means nanobot found a saved token. The live connection
-check is separate, so a temporary Telegram or proxy outage does not make an
-existing configuration disappear. Saved tokens and proxy URLs remain masked.
+The configuration badge means nanobot found a saved token. The live connection check is separate, so a temporary Telegram or proxy outage does not make an existing configuration disappear. Saved tokens and proxy URLs remain masked.
-See the [step-by-step Telegram guide](./guides/telegram-ai-agent.md) for pairing
-and troubleshooting.
+See the [step-by-step Telegram guide](./guides/telegram-ai-agent.md) for pairing and troubleshooting.
**Manual setup**
@@ -192,8 +166,7 @@ If the gateway cannot reach Telegram directly, add a proxy to the same section:
}
```
-HTTP, HTTPS, SOCKS5, and SOCKS5H proxy URLs are accepted. Treat a proxy URL
-containing a username or password as a secret.
+HTTP, HTTPS, SOCKS5, and SOCKS5H proxy URLs are accepted. Treat a proxy URL containing a username or password as a secret.
> You can find your **User ID** in Telegram settings. It is shown as `@yourUserId`. Copy this value **without the `@` symbol** and paste it into the config file.
>
@@ -336,12 +309,8 @@ If you prefer to configure manually, add the following to `~/.nanobot/config.jso
> `groupPolicy` controls how the bot responds in group channels:
> - `"mention"` (default) — Only respond when @mentioned
-> - `"open"` — Respond to all messages
-> DMs always respond when the sender is in `allowFrom`.
-> - If you set group policy to open create new threads as private threads and then @ the bot into it. Otherwise the thread itself and the channel in which you spawned it will spawn a bot session.
-> `allowChannels` restricts the bot to specific Discord channel IDs. Empty (default) means respond in every channel the bot can see. Example: `["1234567890", "0987654321"]`. The filter applies after `allowFrom`, so both must pass. Discord threads under an allowed parent channel are also allowed; for Forum channels, allowing the parent Forum channel allows all threads/posts in that forum.
-> `streaming` defaults to `true`. Disable it only if you explicitly want non-streaming replies.
-> `replyToMessage` defaults to `false`. Enable it to use Discord's native reply UI for responses.
+> - `"open"` — Respond to all messages DMs always respond when the sender is in `allowFrom`.
+> - If you set group policy to open create new threads as private threads and then @ the bot into it. Otherwise the thread itself and the channel in which you spawned it will spawn a bot session. `allowChannels` restricts the bot to specific Discord channel IDs. Empty (default) means respond in every channel the bot can see. Example: `["1234567890", "0987654321"]`. The filter applies after `allowFrom`, so both must pass. Discord threads under an allowed parent channel are also allowed; for Forum channels, allowing the parent Forum channel allows all threads/posts in that forum. `streaming` defaults to `true`. Disable it only if you explicitly want non-streaming replies. `replyToMessage` defaults to `false`. Enable it to use Discord's native reply UI for responses.
**5. Invite the bot**
- OAuth2 → URL Generator
@@ -456,9 +425,7 @@ nanobot channels login whatsapp
}
```
-For groups, `allowFrom` can contain either a participant sender ID/LID or a
-group JID/bare group ID. A participant entry allows that sender wherever the bot
-can see them; a group entry allows replies in that group.
+For groups, `allowFrom` can contain either a participant sender ID/LID or a group JID/bare group ID. A participant entry allows that sender wherever the bot can see them; a group entry allows replies in that group.
Optional session database path:
@@ -486,10 +453,7 @@ nanobot gateway
**Optional: static LID mappings**
-Modern WhatsApp can deliver a sender's LID instead of their phone number. nanobot
-learns LID to phone mappings at runtime when both identifiers are present, but you
-can also seed mappings up front so the phone number resolves from the
-very first message:
+Modern WhatsApp can deliver a sender's LID instead of their phone number. nanobot learns LID to phone mappings at runtime when both identifiers are present, but you can also seed mappings up front so the phone number resolves from the very first message:
```json
{
@@ -559,14 +523,7 @@ If QR login is unavailable for your account, use manual setup below.
}
```
-> `streaming` defaults to `true`. Use `false` if your app does not have **`cardkit:card:write`** (see permissions above).
-> `encryptKey` and `verificationToken` are optional for Long Connection mode.
-> `allowFrom`: Add your open_id (find it in nanobot logs when you message the bot). Use `["*"]` to allow all users.
-> `groupPolicy`: `"mention"` (default — respond only when @mentioned), `"open"` (respond to all group messages). Private chats always respond.
-> `reactEmoji`: Emoji for "processing" status (default: `OnIt`). See [available emojis](https://open.larkoffice.com/document/server-docs/im-v1/message-reaction/emojis-introduce).
-> `doneEmoji`: Optional emoji for "completed" status (e.g., `DONE`, `OK`, `HEART`). When set, bot adds this reaction after removing `reactEmoji`.
-> `toolHintPrefix`: Prefix for inline tool hints in streaming cards (default: `🔧`).
-> `domain`: `"feishu"` (default) for China (open.feishu.cn), `"lark"` for international Lark (open.larksuite.com).
+> `streaming` defaults to `true`. Use `false` if your app does not have **`cardkit:card:write`** (see permissions above). `encryptKey` and `verificationToken` are optional for Long Connection mode. `allowFrom`: Add your open_id (find it in nanobot logs when you message the bot). Use `["*"]` to allow all users. `groupPolicy`: `"mention"` (default — respond only when @mentioned), `"open"` (respond to all group messages). Private chats always respond. `reactEmoji`: Emoji for "processing" status (default: `OnIt`). See [available emojis](https://open.larkoffice.com/document/server-docs/im-v1/message-reaction/emojis-introduce). `doneEmoji`: Optional emoji for "completed" status (e.g., `DONE`, `OK`, `HEART`). When set, bot adds this reaction after removing `reactEmoji`. `toolHintPrefix`: Prefix for inline tool hints in streaming cards (default: `🔧`). `domain`: `"feishu"` (default) for China (open.feishu.cn), `"lark"` for international Lark (open.larksuite.com).
**3. Run**
@@ -798,17 +755,10 @@ Give nanobot its own email account. It polls **IMAP** for incoming mail and repl
> - `consentGranted` must be `true` to allow mailbox access. This is a safety gate — set `false` to fully disable.
> - `allowFrom`: Add your email address. Use `["*"]` to accept emails from anyone.
-> - `trustedAuthservIds`: Exact `authserv-id` values added by the receiving mail
-> service. Required while `verifyDkim` or `verifySpf` is enabled. Gmail normally
-> uses `mx.google.com`; inspect a received message's raw headers for other services.
-> The service must prepend one consolidated result and remove inbound headers that
-> claim the same identity; duplicate trusted results are rejected.
-> Existing installations must follow the [v0.3.5 upgrade instructions](guides/email-ai-agent.md#upgrading-to-v035)
-> before re-enabling verified email polling.
+> - `trustedAuthservIds`: Exact `authserv-id` values added by the receiving mail service. Required while `verifyDkim` or `verifySpf` is enabled. Gmail normally uses `mx.google.com`; inspect a received message's raw headers for other services. The service must prepend one consolidated result and remove inbound headers that claim the same identity; duplicate trusted results are rejected. Existing installations must follow the [v0.3.5 upgrade instructions](guides/email-ai-agent.md#upgrading-to-v035) before re-enabling verified email polling.
> - `smtpUseTls` and `smtpUseSsl` default to `true` / `false` respectively, which is correct for Gmail (port 587 + STARTTLS). No need to set them explicitly.
> - Set `"autoReplyEnabled": false` if you only want to read/analyze emails without sending automatic replies.
-> - `postAction`: Optional post-processing for processed emails: `"delete"` or `"move"` (default `null`).
-> This runs only after an accepted email is successfully delivered to the AI pipeline.
+> - `postAction`: Optional post-processing for processed emails: `"delete"` or `"move"` (default `null`). This runs only after an accepted email is successfully delivered to the AI pipeline.
> - `postActionMoveMailbox`: Destination mailbox used when `postAction` is `"move"` (for example `"Processed"` or `"[Gmail]/Trash"`).
> - `postActionIgnoreSkipped`: If `true` (default), skipped emails are ignored for post-action and not moved/deleted.
> - `postActionExpunge`: When `true`, the channel allows a full-mailbox `EXPUNGE` fallback if UID-scoped expunge is unavailable or fails (default `false`). Enable only on very old IMAP servers that lack modern UIDPLUS support. Note that this fallback will expunge **all** messages marked as deleted in the mailbox, including ones not handled by the agent. Leaving this off is safe for all modern IMAP servers.
@@ -945,8 +895,7 @@ nanobot gateway
<details>
<summary><b>Microsoft Teams</b> (MVP — DM only)</summary>
-> Direct-message text in/out, tenant-aware OAuth, conversation reference persistence.
-> Uses a public HTTPS webhook — no WebSocket; you need a tunnel or reverse proxy.
+> Direct-message text in/out, tenant-aware OAuth, conversation reference persistence. Uses a public HTTPS webhook — no WebSocket; you need a tunnel or reverse proxy.
**1. Enable Microsoft Teams support**
@@ -1061,7 +1010,6 @@ nanobot gateway
```
> [!TIP]
-> The channel automatically reconnects to the signal-cli daemon with exponential backoff if the connection drops.
-> Markdown in bot replies is automatically converted to Signal text styles (bold, italic, code, etc.).
+> The channel automatically reconnects to the signal-cli daemon with exponential backoff if the connection drops. Markdown in bot replies is automatically converted to Signal text styles (bold, italic, code, etc.).
</details>
diff --git a/docs/chat-commands.md b/docs/chat-commands.md
index 64c07a9dd..427f8dbc5 100644
--- a/docs/chat-commands.md
+++ b/docs/chat-commands.md
@@ -30,23 +30,13 @@ These commands work inside chat channels and interactive agent sessions:
## Commands and file paths
-The gateway treats a message as a command only when its first word matches a
-registered command name. Names are case-insensitive. Arguments must follow the
-command's supported form.
+The gateway treats a message as a command only when its first word matches a registered command name. Names are case-insensitive. Arguments must follow the command's supported form.
-Other text goes to the agent unchanged. This includes `/tmp`,
-`/home/user/project`, and `/Users/alice/report.md`. Unknown names such as `/neaw`
-also go to the agent; the gateway no longer returns a spelling suggestion.
-Use `/help` or the command menu to find a command.
+Other text goes to the agent unchanged. This includes `/tmp`, `/home/user/project`, and `/Users/alice/report.md`. Unknown names such as `/neaw` also go to the agent; the gateway no longer returns a spelling suggestion. Use `/help` or the command menu to find a command.
-In the WebUI, Enter queues ordinary text while a response is running. Paths
-follow the same rule. Registered commands still go to the gateway immediately.
-If the command list is unavailable, slash-prefixed input goes to the gateway
-immediately, so commands such as `/stop` do not wait in the queue.
+In the WebUI, Enter queues ordinary text while a response is running. Paths follow the same rule. Registered commands still go to the gateway immediately. If the command list is unavailable, slash-prefixed input goes to the gateway immediately, so commands such as `/stop` do not wait in the queue.
-A path can have the same name as a command. For example, `/new` starts a new
-conversation. To discuss that directory, write `/new/` or `Look at /new`.
-Chat platforms can apply their own command rules before a message reaches the gateway.
+A path can have the same name as a command. For example, `/new` starts a new conversation. To discuss that directory, write `/new/` or `Look at /new`. Chat platforms can apply their own command rules before a message reaches the gateway.
## Pairing
@@ -82,9 +72,7 @@ Preset names come from the top-level `modelPresets` config. Switching affects on
## Local triggers
-Use `/trigger <name>` when a local script or another service should be able to
-send a message into the current chat/session later. A name is required; plain
-`/trigger` only shows the usage hint.
+Use `/trigger <name>` when a local script or another service should be able to send a message into the current chat/session later. A name is required; plain `/trigger` only shows the usage hint.
Create the trigger from the chat where future messages should arrive:
@@ -98,21 +86,9 @@ nanobot replies with a trigger ID and a command shaped like:
nanobot trigger trg_8K4P2Q9X "Review PR #4502"
```
-Replace `"Review PR #4502"` with the message you want nanobot to receive. The
-trigger is bound to the session where it was created, so the message goes back
-to that same chat. Keep `nanobot gateway` running so trigger messages can be
-delivered. The trigger message starts an automation turn recorded in that
-session with the message you passed to the CLI; it is not treated as a normal
-user message. If that session is already running a turn, the trigger waits
-until the session is idle instead of being injected into the active turn.
-
-Trigger deliveries are stored in the workspace until their linked agent turn
-finishes successfully. If the gateway exits after claiming a delivery but before
-the turn completes, the next gateway start requeues that delivery. This is an
-at-least-once local queue: a delivery may run more than once if the process
-exits at the wrong time, so external scripts should make repeated trigger
-messages safe. If the delivery reaches the agent and the agent turn fails, the
-delivery is marked failed in Automations instead of retrying forever.
+Replace `"Review PR #4502"` with the message you want nanobot to receive. The trigger is bound to the session where it was created, so the message goes back to that same chat. Keep `nanobot gateway` running so trigger messages can be delivered. The trigger message starts an automation turn recorded in that session with the message you passed to the CLI; it is not treated as a normal user message. If that session is already running a turn, the trigger waits until the session is idle instead of being injected into the active turn.
+
+Trigger deliveries are stored in the workspace until their linked agent turn finishes successfully. If the gateway exits after claiming a delivery but before the turn completes, the next gateway start requeues that delivery. This is an at-least-once local queue: a delivery may run more than once if the process exits at the wrong time, so external scripts should make repeated trigger messages safe. If the delivery reaches the agent and the agent turn fails, the delivery is marked failed in Automations instead of retrying forever.
For longer or generated content, omit the message argument and pipe stdin:
@@ -120,27 +96,22 @@ For longer or generated content, omit the message argument and pipe stdin:
printf '%s\n' "Review the latest failed CI job" | nanobot trigger trg_8K4P2Q9X
```
-If an external webhook should wake nanobot up, run your own small webhook
-service and have it call the trigger command after it builds the final message:
+If an external webhook should wake nanobot up, run your own small webhook service and have it call the trigger command after it builds the final message:
```bash
nanobot trigger <trigger-id> "<message>"
```
-If you run multiple nanobot instances, pass the same config or workspace
-selector used by the gateway:
+If you run multiple nanobot instances, pass the same config or workspace selector used by the gateway:
```bash
nanobot trigger --config ./bot-a/config.json trg_8K4P2Q9X "Nightly report"
nanobot trigger --workspace ./bot-a/workspace trg_8K4P2Q9X "Nightly report"
```
-Manage triggers from the WebUI Automations view. You can search, pause/resume,
-rename, delete, and copy the trigger command there. A session may have multiple
-triggers, just like it may have multiple scheduled automations.
+Manage triggers from the WebUI Automations view. You can search, pause/resume, rename, delete, and copy the trigger command there. A session may have multiple triggers, just like it may have multiple scheduled automations.
-See [Automations](./automations.md) for how local triggers fit with scheduled
-automations, heartbeat, and gateway delivery.
+See [Automations](./automations.md) for how local triggers fit with scheduled automations, heartbeat, and gateway delivery.
## Periodic Tasks
diff --git a/docs/cli-reference.md b/docs/cli-reference.md
index 55c529bbb..36fd20139 100644
--- a/docs/cli-reference.md
+++ b/docs/cli-reference.md
@@ -38,64 +38,17 @@ python -m nanobot --version
### Coexisting with Nanobot Desktop
-The Python package and Nanobot Desktop keep separate runtimes, configuration,
-workspaces, and state. When a running Desktop release publishes its private
-terminal-access descriptor, an interactive bare `nanobot` or `nanobot webui`
-asks which installation to use after authenticating a ready Desktop target.
-Use `Up`/`Down` to highlight an installation and `Enter` to confirm.
-`Ctrl+C` cancels with exit code 130 without attaching to Desktop or starting a Python backend.
-If Desktop is absent, busy, unavailable, or cannot be authenticated, the command
-reports the current Python executable and continues normally. A virtual
-environment's executable is shown without resolving it to its base interpreter.
-
-Choosing Desktop for `nanobot webui` opens its already-running browser workbench
-and exits; closing the browser never stops the Desktop gateway. Choosing Desktop
-for bare `nanobot` opens the terminal UI against that same running backend when
-the Desktop host, gateway and terminal client support terminal protocol 1. Older
-versions fail explicitly with update guidance. Use explicit `nanobot agent` for
-the original Python terminal UI.
-After Desktop is selected, a disconnect or incompatible reply ends that invocation
-with an error; it never silently switches to Python or launches a replacement.
-On macOS, browser URLs are delivered through native Launch Services rather than
-command-line arguments. A failed native handoff does not fall back to `open` or
-a `BROWSER` command, keeping bootstrap credentials out of launcher arguments.
-
-On Windows, the shared browser launcher uses a private HTML redirect rather than
-passing a credential-bearing URL to a browser command. A short-lived, windowless
-Python helper receives the URL over an anonymous pipe, opens the redirect through
-the system's HTTP association, and attempts file cleanup after two minutes. The calling
-CLI can exit immediately after the launch acknowledgement; this helper does not
-start, stop, or keep a gateway alive. It does not honor `BROWSER` overrides.
-Redirects are stored in the current user's Windows Local AppData known folder,
-under `NanobotBrowserHandoff-v1`, with an explicit current-user-only protected ACL.
-An ACL-enforcing local filesystem and a non-reparse storage path are required;
-unsafe existing storage or failed browser handoff fails without raw-URL fallback.
-Abnormal termination can leave a private redirect behind. Later invocations retry
-cleanup of verified redirect files older than ten minutes, excluding active files;
-cleanup is not a guarantee of physical erasure or secrecy from same-user programs
-or administrators. No Python/Desktop settings, credentials, or history are imported
-between installations.
-
-Any explicit subcommand or option—including `nanobot agent`,
-`nanobot webui --no-open`, config/workspace selectors, help, version, completion,
-and gateway lifecycle commands—keeps its existing Python meaning and never opens
-the Desktop picker. Target choices are not remembered, and Desktop settings are
-not copied into the Python installation.
-
-Desktop terminal credentials are short-lived WebSocket/API tokens obtained through
-the authenticated current-user rendezvous. The TUI receives them through a bounded
-anonymous pipe, not command arguments, environment variables or temporary files.
-Its environment contains only a trusted resolver command and public instance IDs.
-The resolver verifies the selected Desktop and gateway again for every credential
-refresh. The gateway identity is also checked before any WebSocket mutation. This
-mode does not acquire a gateway lifecycle lease: client exit leaves Desktop running,
-and disconnect never automatically reconnects or replays an uncertain task.
-
-Desktop-only distributions use the narrow `nanobot-desktop-tui` entrypoint inside
-their existing private runtime; it is not a replacement for the full Python CLI.
-They must ship this engine entrypoint and a matching terminal client together.
-The client cache can be kept inside Desktop's data root without reading or writing
-the separate Python installation's config. No additional system Python is needed.
+The Python package and Nanobot Desktop keep separate runtimes, configuration, workspaces, and state. When a running Desktop release publishes its private terminal-access descriptor, an interactive bare `nanobot` or `nanobot webui` asks which installation to use after authenticating a ready Desktop target. Use `Up`/`Down` to highlight an installation and `Enter` to confirm. `Ctrl+C` cancels with exit code 130 without attaching to Desktop or starting a Python backend. If Desktop is absent, busy, unavailable, or cannot be authenticated, the command reports the current Python executable and continues normally. A virtual environment's executable is shown without resolving it to its base interpreter.
+
+Choosing Desktop for `nanobot webui` opens its already-running browser workbench and exits; closing the browser never stops the Desktop gateway. Choosing Desktop for bare `nanobot` opens the terminal UI against that same running backend when the Desktop host, gateway and terminal client support terminal protocol 1. Older versions fail explicitly with update guidance. Use explicit `nanobot agent` for the original Python terminal UI. After Desktop is selected, a disconnect or incompatible reply ends that invocation with an error; it never silently switches to Python or launches a replacement. On macOS, browser URLs are delivered through native Launch Services rather than command-line arguments. A failed native handoff does not fall back to `open` or a `BROWSER` command, keeping bootstrap credentials out of launcher arguments.
+
+On Windows, the shared browser launcher uses a private HTML redirect rather than passing a credential-bearing URL to a browser command. A short-lived, windowless Python helper receives the URL over an anonymous pipe, opens the redirect through the system's HTTP association, and attempts file cleanup after two minutes. The calling CLI can exit immediately after the launch acknowledgement; this helper does not start, stop, or keep a gateway alive. It does not honor `BROWSER` overrides. Redirects are stored in the current user's Windows Local AppData known folder, under `NanobotBrowserHandoff-v1`, with an explicit current-user-only protected ACL. An ACL-enforcing local filesystem and a non-reparse storage path are required; unsafe existing storage or failed browser handoff fails without raw-URL fallback. Abnormal termination can leave a private redirect behind. Later invocations retry cleanup of verified redirect files older than ten minutes, excluding active files; cleanup is not a guarantee of physical erasure or secrecy from same-user programs or administrators. No Python/Desktop settings, credentials, or history are imported between installations.
+
+Any explicit subcommand or option—including `nanobot agent`, `nanobot webui --no-open`, config/workspace selectors, help, version, completion, and gateway lifecycle commands—keeps its existing Python meaning and never opens the Desktop picker. Target choices are not remembered, and Desktop settings are not copied into the Python installation.
+
+Desktop terminal credentials are short-lived WebSocket/API tokens obtained through the authenticated current-user rendezvous. The TUI receives them through a bounded anonymous pipe, not command arguments, environment variables or temporary files. Its environment contains only a trusted resolver command and public instance IDs. The resolver verifies the selected Desktop and gateway again for every credential refresh. The gateway identity is also checked before any WebSocket mutation. This mode does not acquire a gateway lifecycle lease: client exit leaves Desktop running, and disconnect never automatically reconnects or replays an uncertain task.
+
+Desktop-only distributions use the narrow `nanobot-desktop-tui` entrypoint inside their existing private runtime; it is not a replacement for the full Python CLI. They must ship this engine entrypoint and a matching terminal client together. The client cache can be kept inside Desktop's data root without reading or writing the separate Python installation's config. No additional system Python is needed.
## Common Patterns
@@ -114,9 +67,7 @@ nanobot gateway --verbose
nanobot serve --verbose
```
-Long-running commands keep working until you stop them. Press `Ctrl+C` in that terminal
-to stop foreground `nanobot gateway` or `nanobot serve`. If you started the gateway
-with `--background`, use `nanobot gateway stop`.
+Long-running commands keep working until you stop them. Press `Ctrl+C` in that terminal to stop foreground `nanobot gateway` or `nanobot serve`. If you started the gateway with `--background`, use `nanobot gateway stop`.
## Setup
@@ -142,9 +93,7 @@ Default paths:
| `nanobot status --config <path>` | Check a specific config file |
| `nanobot status --workspace <path>` | Show status with a workspace override |
-Status does not send a model request. On success, run the printed
-`nanobot agent -m "Hello!"` command to verify network access and credentials. On failure,
-follow the printed WebUI **Settings → Models** or `nanobot onboard --wizard` route.
+Status does not send a model request. On success, run the printed `nanobot agent -m "Hello!"` command to verify network access and credentials. On failure, follow the printed WebUI **Settings → Models** or `nanobot onboard --wizard` route.
## Agent CLI
@@ -160,32 +109,19 @@ follow the printed WebUI **Settings → Models** or `nanobot onboard --wizard` r
| `nanobot --no-markdown` | Use the classic prompt and print plain text instead of Markdown |
| `nanobot --logs` | Use the classic prompt and show runtime logs while chatting |
-Inside the native TUI, `/sessions` switches saved conversations, `/new-chat` starts another saved
-conversation, and `/context` explains the compacted summary and raw session suffix available to
-the next agent turn. `/branch` forks a saved conversation from a completed reply, and `/diff`
-opens the latest turn's file changes as a full-screen unified diff.
-`PageUp` loads older transcript pages when you reach the top. By default, each launch starts a
-new session using the launch directory as its workspace. `--session` selects a specific existing
-session, and `--workspace` overrides the launch directory. When the TUI exits, it prints a
-ready-to-run `nanobot agent --session ...` command for the current session.
+Inside the native TUI, `/sessions` switches saved conversations, `/new-chat` starts another saved conversation, and `/context` explains the compacted summary and raw session suffix available to the next agent turn. `/branch` forks a saved conversation from a completed reply, and `/diff` opens the latest turn's file changes as a full-screen unified diff. `PageUp` loads older transcript pages when you reach the top. By default, each launch starts a new session using the launch directory as its workspace. `--session` selects a specific existing session, and `--workspace` overrides the launch directory. When the TUI exits, it prints a ready-to-run `nanobot agent --session ...` command for the current session.
## Session Storage and Rollback
-Session JSONL files live under `<config-dir>/sessions/<workspace-id>/`, outside the
-agent-readable workspace. On the first upgraded start, nanobot safely migrates existing
-`<workspace>/sessions/*.jsonl` files after verifying an atomic copy. Stop every old nanobot
-process that uses the workspace before upgrading; old and new binaries must not write the
-same session concurrently.
+Session JSONL files live under `<config-dir>/sessions/<workspace-id>/`, outside the agent-readable workspace. On the first upgraded start, nanobot safely migrates existing `<workspace>/sessions/*.jsonl` files after verifying an atomic copy. Stop every old nanobot process that uses the workspace before upgrading; old and new binaries must not write the same session concurrently.
-To prepare a downgrade, stop nanobot and copy the current sessions back to the path understood
-by older releases:
+To prepare a downgrade, stop nanobot and copy the current sessions back to the path understood by older releases:
```bash
nanobot sessions restore-workspace --config ./bot-a/config.json --workspace ./bot-a/workspace
```
-The command never deletes the external store and refuses to overwrite a different existing
-workspace file. Back up both the config directory and workspace before changing versions.
+The command never deletes the external store and refuses to overwrite a different existing workspace file. Back up both the config directory and workspace before changing versions.
Interactive mode uses nanobot's native TypeScript terminal UI. It talks to the same local gateway as the WebUI, so streaming, tool progress, and WebSocket sessions share one protocol instead of maintaining a second agent loop. If no gateway is running, either client starts it on demand. The TUI paints immediately while the local gateway starts, then obtains fresh bootstrap credentials and connects in the background. Exiting one TUI or WebUI launcher releases only that client; the last interactive launcher stops the on-demand gateway. A small gateway watchdog also reclaims an on-demand process if its last client crashes. `/detach` promotes the shared gateway to persistent background mode before closing the TUI, so active agent work continues without a connected client. An explicit `nanobot gateway --background` starts or promotes the gateway the same way before opening a client. `nanobot gateway restart` restarts a detached gateway without changing that lifetime; restart an attached foreground gateway in its owning terminal. `nanobot gateway stop` ends either mode.
@@ -215,12 +151,7 @@ Interactive mode exits with `exit`, `quit`, `/exit`, `/quit`, `:q`, or `Ctrl+D`.
First-run WebUI setup binds to `127.0.0.1` by default. Use manual configuration and a WebUI password before exposing the WebSocket channel beyond localhost.
-`--dev` is a foreground source-checkout workflow. Persistent gateway lifecycle is deliberately
-owned only by `nanobot gateway --background`; `nanobot webui --background` prints migration
-guidance instead of silently changing process ownership.
-It installs frontend dependencies when `webui/node_modules` is missing, proxies to the configured
-WebSocket channel port, and stops Vite when the launcher exits. The shared on-demand gateway stops
-only when no other interactive client still holds it.
+`--dev` is a foreground source-checkout workflow. Persistent gateway lifecycle is deliberately owned only by `nanobot gateway --background`; `nanobot webui --background` prints migration guidance instead of silently changing process ownership. It installs frontend dependencies when `webui/node_modules` is missing, proxies to the configured WebSocket channel port, and stops Vite when the launcher exits. The shared on-demand gateway stops only when no other interactive client still holds it.
## Gateway
@@ -252,10 +183,7 @@ nanobot gateway stop --config ./bot-a/config.json --workspace ./bot-a/workspace
nanobot gateway install-service --config ./bot-a/config.json --workspace ./bot-a/workspace --name bot-a
```
-`--background` is a lightweight detached process. `install-service` is for
-login/startup integration: Linux uses a systemd user service; macOS uses a
-LaunchAgent plist. System services run the foreground gateway under the OS
-supervisor rather than nesting another background process.
+`--background` is a lightweight detached process. `install-service` is for login/startup integration: Linux uses a systemd user service; macOS uses a LaunchAgent plist. System services run the foreground gateway under the OS supervisor rather than nesting another background process.
Default health endpoint:
@@ -267,27 +195,15 @@ The bundled WebUI is served by the WebSocket channel, usually on port `8765`, no
## Local Triggers
-`nanobot trigger` delivers one local message to a trigger that was created from
-a chat/session with `/trigger <name>`.
+`nanobot trigger` delivers one local message to a trigger that was created from a chat/session with `/trigger <name>`.
```bash
nanobot trigger trg_8K4P2Q9X "Review PR #4502"
```
-Keep `nanobot gateway` running so the message can be delivered to the linked
-chat/session. The message is recorded as an automation turn in that session,
-not as a normal chat message typed by the user.
-
-The command writes to a workspace-local durable queue. If `nanobot gateway` is
-not running yet, the message waits in that workspace. If the target session is
-already running a turn, the trigger waits for that session to become idle. If the
-gateway exits after claiming a delivery but before the linked turn completes,
-the next gateway start requeues that delivery. The queue is at-least-once, not
-exactly-once, so the same message can be delivered again after an interrupted
-process. If the agent receives the delivery and the turn fails, the delivery is
-marked failed instead of retried indefinitely. Each delivery also writes an
-audit record under `<workspace>/triggers/runs`. Run one gateway consumer per
-workspace; this local queue is not a distributed multi-consumer queue.
+Keep `nanobot gateway` running so the message can be delivered to the linked chat/session. The message is recorded as an automation turn in that session, not as a normal chat message typed by the user.
+
+The command writes to a workspace-local durable queue. If `nanobot gateway` is not running yet, the message waits in that workspace. If the target session is already running a turn, the trigger waits for that session to become idle. If the gateway exits after claiming a delivery but before the linked turn completes, the next gateway start requeues that delivery. The queue is at-least-once, not exactly-once, so the same message can be delivered again after an interrupted process. If the agent receives the delivery and the turn fails, the delivery is marked failed instead of retried indefinitely. Each delivery also writes an audit record under `<workspace>/triggers/runs`. Run one gateway consumer per workspace; this local queue is not a distributed multi-consumer queue.
Use stdin when another local process generates the message:
@@ -304,15 +220,11 @@ Options:
| `nanobot trigger --config <path> <id> "message"` | Use the workspace from a specific config |
| `nanobot trigger --workspace <path> <id> "message"` | Use a specific workspace |
-Triggers are managed in the WebUI Automations view instead of through separate
-`list`, `revoke`, or `delete` CLI subcommands. From there you can pause/resume,
-rename, delete, search, and copy the command for each trigger.
+Triggers are managed in the WebUI Automations view instead of through separate `list`, `revoke`, or `delete` CLI subcommands. From there you can pause/resume, rename, delete, search, and copy the command for each trigger.
-For webhooks or other external systems, run your own small service and have it
-call this CLI after it decides what message nanobot should receive.
+For webhooks or other external systems, run your own small service and have it call this CLI after it decides what message nanobot should receive.
-See [Automations](./automations.md) for the broader automation model, WebUI
-management, and delivery behavior.
+See [Automations](./automations.md) for the broader automation model, WebUI management, and delivery behavior.
## OpenAI-Compatible API
@@ -373,14 +285,9 @@ See [`chat-apps.md`](./chat-apps.md) for channel-specific setup.
## Optional Features
-Use these commands when you want nanobot to add or remove a built-in capability
-without hand-editing JSON. Enabling may install the support package first.
-Disabling is for channels such as Telegram, Matrix, or Slack; it keeps your
-saved settings and turns the channel off.
+Use these commands when you want nanobot to add or remove a built-in capability without hand-editing JSON. Enabling may install the support package first. Disabling is for channels such as Telegram, Matrix, or Slack; it keeps your saved settings and turns the channel off.
-The `plugins` command name is retained for compatibility, but these entries are
-nanobot runtime support packages, not the user-invokable tools shown in WebUI
-Apps. They cannot be attached to a chat turn with `@`.
+The `plugins` command name is retained for compatibility, but these entries are nanobot runtime support packages, not the user-invokable tools shown in WebUI Apps. They cannot be attached to a chat turn with `@`.
| Feature name | What it enables |
|---|---|
@@ -401,9 +308,7 @@ Apps. They cannot be attached to a chat turn with `@`.
| `nanobot plugins enable <name> --config <path>` | Update a specific config file |
| `nanobot plugins disable <channel> --config <path>` | Turn off a channel in a specific config file |
-Document and PDF reading are included in the standard installation. The old
-`nanobot plugins enable documents` and `nanobot plugins enable pdf` commands
-remain accepted as no-op compatibility aliases.
+Document and PDF reading are included in the standard installation. The old `nanobot plugins enable documents` and `nanobot plugins enable pdf` commands remain accepted as no-op compatibility aliases.
## Provider OAuth
diff --git a/docs/concepts.md b/docs/concepts.md
index 924a41a11..d80ed4c35 100644
--- a/docs/concepts.md
+++ b/docs/concepts.md
@@ -41,9 +41,7 @@ The config file controls what nanobot may use. The workspace is where nanobot ke
### Agent Workspace and Project Workspace
-The configured workspace is the **agent workspace**. A WebUI chat can also select
-a different **project workspace** for repository-specific work without moving the
-agent's identity or durable state.
+The configured workspace is the **agent workspace**. A WebUI chat can also select a different **project workspace** for repository-specific work without moving the agent's identity or durable state.
| Resource | Owner when a project is selected |
|---|---|
@@ -52,9 +50,7 @@ agent's identity or durable state.
| Memory and custom skills | `memory/` and `skills/` from the agent workspace |
| Relative file paths and shell working directory | The selected project workspace |
-When no separate project is selected, one directory normally serves both roles.
-Selecting a project changes the working context for that chat; it does not create
-a second agent or relocate the configured agent workspace.
+When no separate project is selected, one directory normally serves both roles. Selecting a project changes the working context for that chat; it does not create a second agent or relocate the configured agent workspace.
## Config Format
@@ -131,19 +127,13 @@ nanobot uses two related stores:
Dream is a periodic consolidation job. It reads accumulated history and updates workspace memory so useful context can survive beyond short session replay.
-The configured workspace contains a `.nanobot/workspace-id` file. It contains only an
-opaque random identifier—never conversation content or credentials. Keep it with workspace
-backups: it lets nanobot find the same external session namespace after the workspace is
-renamed, moved, or restored. A live copy opened alongside the original receives a new ID so
-the two workspaces do not share conversations accidentally.
+The configured workspace contains a `.nanobot/workspace-id` file. It contains only an opaque random identifier—never conversation content or credentials. Keep it with workspace backups: it lets nanobot find the same external session namespace after the workspace is renamed, moved, or restored. A live copy opened alongside the original receives a new ID so the two workspaces do not share conversations accidentally.
See [`memory.md`](./memory.md) for the detailed design.
## Apps and Agent Plugins
-Agent Plugins are nanobot's common package and activation boundary for
-installable capabilities. They organize existing extension types instead of
-replacing them:
+Agent Plugins are nanobot's common package and activation boundary for installable capabilities. They organize existing extension types instead of replacing them:
| Part | Role |
|---|---|
@@ -153,11 +143,7 @@ replacing them:
| CLI App | Locally managed executable whose adapter is packaged and activated like a plugin |
| Apps | WebUI surface for reviewing and managing these capabilities |
-Native providers, channels, built-in tools, standalone workspace skills, and
-directly configured MCP servers keep their existing extension paths. See
-[`webui.md#apps`](./webui.md#apps) for the user-facing flow and
-[`configuration.md#agent-plugins-v1`](./configuration.md#agent-plugins-v1) for
-the package contract.
+Native providers, channels, built-in tools, standalone workspace skills, and directly configured MCP servers keep their existing extension paths. See [`webui.md#apps`](./webui.md#apps) for the user-facing flow and [`configuration.md#agent-plugins-v1`](./configuration.md#agent-plugins-v1) for the package contract.
## Tools and Safety
@@ -175,60 +161,30 @@ Security-sensitive controls live in [`configuration.md#security`](./configuratio
## Subagents
-Nanobot can delegate parts of a request to subagents while remaining responsible
-for the final answer. In the conversation that started the work, you can ask it
-to check progress, send follow-up instructions, wait for results, or cancel a
-task. Cancelling one task leaves the others running. A delivered instruction
-means the subagent received it, not that it has acted on it yet.
+Nanobot can delegate parts of a request to subagents while remaining responsible for the final answer. In the conversation that started the work, you can ask it to check progress, send follow-up instructions, wait for results, or cancel a task. Cancelling one task leaves the others running. A delivered instruction means the subagent received it, not that it has acted on it yet.
-Background tasks return their results to the conversation that started them.
-Single-turn CLI and SDK calls wait for results when background delivery is
-unavailable. Tasks that reach their iteration limit are marked incomplete;
-cancelled, failed, and incomplete tasks retain available partial results.
+Background tasks return their results to the conversation that started them. Single-turn CLI and SDK calls wait for results when background delivery is unavailable. Tasks that reach their iteration limit are marked incomplete; cancelled, failed, and incomplete tasks retain available partial results.
-Use `/stop` to stop the current session and its subagents. Other sessions are
-unaffected. Some operations may take time to stop, and cancellation does not
-undo file changes or other actions already taken.
+Use `/stop` to stop the current session and its subagents. Other sessions are unaffected. Some operations may take time to stop, and cancellation does not undo file changes or other actions already taken.
-Subagents belong to their original conversation. They do not appear as separate
-topics or in general conversation searches. Deleting the conversation stops its
-subagents and removes their saved history; forking it does not copy them.
+Subagents belong to their original conversation. They do not appear as separate topics or in general conversation searches. Deleting the conversation stops its subagents and removes their saved history; forking it does not copy them.
-Saved task history and results remain available after a gateway restart.
-Unfinished tasks are marked interrupted, with saved partial results when
-available. Nanobot does not automatically resume them or resend completion
-notifications; ask it to start a new task to continue the work.
+Saved task history and results remain available after a gateway restart. Unfinished tasks are marked interrupted, with saved partial results when available. Nanobot does not automatically resume them or resend completion notifications; ask it to start a new task to continue the work.
-See [Delegated work in the WebUI](./webui.md#delegated-work) for progress and
-task details. WebUI temporary chats do not support subagents. SDK calls with
-`ephemeral=True` wait for delegated results without saving the temporary
-conversation or its subagent history.
+See [Delegated work in the WebUI](./webui.md#delegated-work) for progress and task details. WebUI temporary chats do not support subagents. SDK calls with `ephemeral=True` wait for delegated results without saving the temporary conversation or its subagent history.
## Background Jobs
-When `nanobot gateway` starts, it runs workspace-scoped automations and
-registers system jobs:
+When `nanobot gateway` starts, it runs workspace-scoped automations and registers system jobs:
- `dream`, when `agents.defaults.dream.enabled` is true;
- `heartbeat`, when `gateway.heartbeat.enabled` is true.
Heartbeat reads `<workspace>/HEARTBEAT.md`. If the file has tasks under `## Active Tasks`, nanobot executes them and sends only useful/actionable results to the most recently active chat target. Routine "nothing changed" results are suppressed.
-User-created reminders use the same cron service but are not the same as the
-protected heartbeat system job. They run as scheduled turns in their origin
-chat/session and normally deliver the result back to that channel.
-
-Local triggers are also session-bound, but they do not have their own
-schedule. Create one from the target chat with `/trigger <name>`, then call
-`nanobot trigger <id> "<message>"` when a local script or external service wants
-nanobot to respond in that session. Webhook servers, third-party auth, and
-event-to-message formatting stay outside nanobot. Trigger deliveries are stored
-in the workspace until the linked agent turn finishes successfully. If the
-target session is busy, the trigger waits until that session is idle instead of
-being injected into the active turn. The message is recorded as an automation
-turn in that session. Delivery is at-least-once, so external systems should
-tolerate repeated trigger messages; a delivery that reaches the agent but fails
-is marked failed rather than retried forever.
+User-created reminders use the same cron service but are not the same as the protected heartbeat system job. They run as scheduled turns in their origin chat/session and normally deliver the result back to that channel.
+
+Local triggers are also session-bound, but they do not have their own schedule. Create one from the target chat with `/trigger <name>`, then call `nanobot trigger <id> "<message>"` when a local script or external service wants nanobot to respond in that session. Webhook servers, third-party auth, and event-to-message formatting stay outside nanobot. Trigger deliveries are stored in the workspace until the linked agent turn finishes successfully. If the target session is busy, the trigger waits until that session is idle instead of being injected into the active turn. The message is recorded as an automation turn in that session. Delivery is at-least-once, so external systems should tolerate repeated trigger messages; a delivery that reaches the agent but fails is marked failed rather than retried forever.
## Where to Go Next
diff --git a/docs/configuration.md b/docs/configuration.md
index 63f21c68a..696ccafe9 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -17,8 +17,7 @@ For setup and runtime failures, follow the diagnosis order in [`troubleshooting.
## Configuration Guides
-This page is the complete configuration reference. For task-oriented setup, use
-the focused guides first and come back here for exact fields and defaults.
+This page is the complete configuration reference. For task-oriented setup, use the focused guides first and come back here for exact fields and defaults.
| Task | Guide |
|---|---|
@@ -91,9 +90,7 @@ Instead of storing secrets directly in `config.json`, you can use `${VAR_NAME}`
Any string value in `config.json` can use `${VAR_NAME}`. Resolution runs once at startup, in memory only — resolved values are never written back to disk, so editing config through `nanobot onboard` or the WebUI preserves the placeholder.
-If a referenced variable is unset, nanobot fails fast and reports the exact config field
-and variable name without echoing the field value. Run `nanobot status` with the same
-`--config` path to inspect the problem.
+If a referenced variable is unset, nanobot fails fast and reports the exact config field and variable name without echoing the field value. Run `nanobot status` with the same `--config` path to inspect the problem.
### More examples
@@ -356,14 +353,9 @@ The WebUI's OpenAI web-search switch selects Responses without Chat fallback. Pr
### Responses conversation state and compaction
-Providers that use the Responses API can keep reasoning context across a
-conversation, which helps with multi-step tasks. Supported providers can also
-compact long conversations automatically.
+Providers that use the Responses API can keep reasoning context across a conversation, which helps with multi-step tasks. Supported providers can also compact long conversations automatically.
-nanobot preserves Responses conversation state automatically for OpenAI Responses, OpenAI Codex, Azure OpenAI, DeepSeek V4, and compatible GitHub Copilot models.
-Native compaction is also automatic when the provider supports it. The
-threshold is derived from the active model's context window and reserved output
-headroom; no provider configuration is required.
+nanobot preserves Responses conversation state automatically for OpenAI Responses, OpenAI Codex, Azure OpenAI, DeepSeek V4, and compatible GitHub Copilot models. Native compaction is also automatic when the provider supports it. The threshold is derived from the active model's context window and reserved output headroom; no provider configuration is required.
<details>
<summary><b>Azure OpenAI</b></summary>
@@ -488,9 +480,7 @@ nanobot plugins enable bedrock
```
> [!NOTE]
-> If you configured Bedrock before `boto3` became an optional dependency, run
-> `nanobot plugins enable bedrock` after upgrading. Otherwise the provider will
-> fail when it first tries to create a Bedrock client.
+> If you configured Bedrock before `boto3` became an optional dependency, run `nanobot plugins enable bedrock` after upgrading. Otherwise the provider will fail when it first tries to create a Bedrock client.
**1. Configure credentials**
@@ -698,10 +688,7 @@ Then run:
nanobot agent -m "Hello!"
```
-The WebUI model selector loads the models available to the signed-in account
-from Codex's online catalog. Context-window and reasoning-effort metadata come
-from that response; if discovery is unavailable, nanobot keeps a small built-in
-fallback instead of emptying the selector.
+The WebUI model selector loads the models available to the signed-in account from Codex's online catalog. Context-window and reasoning-effort metadata come from that response; if discovery is unavailable, nanobot keeps a small built-in fallback instead of emptying the selector.
Codex Fast mode can be enabled from the WebUI provider settings, or with:
@@ -717,10 +704,7 @@ Codex Fast mode can be enabled from the WebUI provider settings, or with:
}
```
-The switch sends the Responses API `service_tier: "priority"` value. It only works for models
-and accounts that support Fast mode; turn the switch off to return to standard processing.
-Fast mode consumes Codex credits at a higher rate. See the
-[OpenAI Codex rate card](https://help.openai.com/en/articles/20001106) for current details.
+The switch sends the Responses API `service_tier: "priority"` value. It only works for models and accounts that support Fast mode; turn the switch off to return to standard processing. Fast mode consumes Codex credits at a higher rate. See the [OpenAI Codex rate card](https://help.openai.com/en/articles/20001106) for current details.
For proxy, remote/headless login, model-name, or config-key errors, see [`troubleshooting.md`](./troubleshooting.md#provider-and-model-problems).
@@ -730,32 +714,16 @@ For proxy, remote/headless login, model-name, or config-key errors, see [`troubl
<details>
<summary><b>xAI Grok (OAuth)</b></summary>
-Use an eligible X Premium / Grok subscription without putting an API key in
-`config.json`:
+Use an eligible X Premium / Grok subscription without putting an API key in `config.json`:
```bash
nanobot provider login xai-grok --set-main
nanobot agent -m "Hello from Grok."
```
-The default model is `xai-grok/grok-4.6` with a 500,000-token context window.
-The provider reads and caches xAI's online model catalog for both WebUI model
-selection and runtime capabilities. Newly available models appear automatically;
-when discovery fails, the last successful catalog or built-in fallback remains
-available. The server-hosted `x_search` tool is included only when the selected
-model advertises support. Models without that capability continue normally
-without hosted X Search. When enabled, searches run inside xAI's Responses API
-and citations arrive as inline links.
-Hosted X Search is on by default to preserve this behavior. It can be turned off in the
-WebUI provider settings or with `providers.xaiGrok.extraBody.tools: []`.
-
-This is xAI subscription OAuth, not X Developer OAuth. nanobot follows the
-public OAuth client and proxy contract used by
-[Grok Build](https://github.com/xai-org/grok-build/blob/main/crates/codegen/xai-grok-pager/docs/user-guide/02-authentication.md).
-The browser flow uses a random loopback callback and PKCE. The resulting token
-is stored in the active instance's `auth/xai.json` (normally
-`~/.nanobot/auth/xai.json`), separately from Grok Build so rotating refresh
-tokens cannot invalidate one another.
+The default model is `xai-grok/grok-4.6` with a 500,000-token context window. The provider reads and caches xAI's online model catalog for both WebUI model selection and runtime capabilities. Newly available models appear automatically; when discovery fails, the last successful catalog or built-in fallback remains available. The server-hosted `x_search` tool is included only when the selected model advertises support. Models without that capability continue normally without hosted X Search. When enabled, searches run inside xAI's Responses API and citations arrive as inline links. Hosted X Search is on by default to preserve this behavior. It can be turned off in the WebUI provider settings or with `providers.xaiGrok.extraBody.tools: []`.
+
+This is xAI subscription OAuth, not X Developer OAuth. nanobot follows the public OAuth client and proxy contract used by [Grok Build](https://github.com/xai-org/grok-build/blob/main/crates/codegen/xai-grok-pager/docs/user-guide/02-authentication.md). The browser flow uses a random loopback callback and PKCE. The resulting token is stored in the active instance's `auth/xai.json` (normally `~/.nanobot/auth/xai.json`), separately from Grok Build so rotating refresh tokens cannot invalidate one another.
To use a provider-specific proxy, merge this into `config.json` before login:
@@ -769,10 +737,7 @@ To use a provider-specific proxy, merge this into `config.json` before login:
}
```
-The proxy applies to OAuth discovery, token exchange/refresh, model-catalog
-lookups, and subscription model requests. Because this integration depends on
-xAI's public Grok Build client contract, an upstream contract change may require
-a nanobot update.
+The proxy applies to OAuth discovery, token exchange/refresh, model-catalog lookups, and subscription model requests. Because this integration depends on xAI's public Grok Build client contract, an upstream contract change may require a nanobot update.
</details>
@@ -782,9 +747,7 @@ a nanobot update.
GitHub Copilot uses OAuth instead of API keys. Requires a [GitHub account with a plan](https://github.com/features/copilot/plans) configured. No `providers.github_copilot` block is needed in `config.json`; `nanobot provider login` stores the OAuth session outside config.
-After login, the WebUI loads the account-specific Copilot model catalog online.
-Only models compatible with nanobot's current chat-completions or Responses
-transport are shown.
+After login, the WebUI loads the account-specific Copilot model catalog online. Only models compatible with nanobot's current chat-completions or Responses transport are shown.
For GitHub Enterprise / Copilot for Business, set the endpoint overrides you need before login:
```bash
@@ -836,9 +799,7 @@ nanobot agent -c ~/.nanobot-telegram/config.json -w /tmp/nanobot-telegram-test -
<details>
<summary><b>OpenCode Zen / Go</b></summary>
-OpenCode Zen and OpenCode Go are available through nanobot's built-in
-OpenAI-compatible provider flow. They share the `OPENCODE_API_KEY` environment
-variable, but use separate provider keys and default base URLs:
+OpenCode Zen and OpenCode Go are available through nanobot's built-in OpenAI-compatible provider flow. They share the `OPENCODE_API_KEY` environment variable, but use separate provider keys and default base URLs:
| Provider | Default API base | Model prefix accepted by nanobot |
|----------|------------------|-----------------------------------|
@@ -894,11 +855,7 @@ OpenCode Go:
}
```
-OpenCode's own docs list models across `responses`, `messages`,
-provider-specific model endpoints, and `chat/completions`. nanobot's OpenCode
-providers use the OpenAI-compatible `chat/completions` path, so pick model IDs
-from that endpoint family. The `opencode/...` and `opencode-go/...` prefixes are
-accepted for config readability and stripped before sending the request.
+OpenCode's own docs list models across `responses`, `messages`, provider-specific model endpoints, and `chat/completions`. nanobot's OpenCode providers use the OpenAI-compatible `chat/completions` path, so pick model IDs from that endpoint family. The `opencode/...` and `opencode-go/...` prefixes are accepted for config readability and stripped before sending the request.
</details>
@@ -1103,8 +1060,7 @@ Leave `thinkingStyle` unset unless the endpoint explicitly documents one of thos
</details>
-<a id="local-providers"></a>
-<a id="ollama-local"></a>
+<a id="local-providers"></a> <a id="ollama-local"></a>
<details>
<summary><b>Ollama (local)</b></summary>
@@ -1642,12 +1598,7 @@ Global settings that apply to all channels. Configure under the `channels` secti
| `showReasoning` | `true` | Allow channels to surface model reasoning/thinking content (DeepSeek-R1 `reasoning_content`, Anthropic `thinking_blocks`, inline `<think>` tags). Reasoning flows as a dedicated stream with `_reasoning_delta` / `_reasoning_end` markers — channels override `send_reasoning_delta` / `send_reasoning_end` to render in-place updates. Even with `true`, channels without those overrides stay no-op silently. Currently surfaced on CLI and WebSocket/WebUI (italic shimmer header, auto-collapses after the stream ends); Telegram / Slack / Discord / Feishu / WeChat / Matrix / Mattermost keep the base no-op until their bubble UI is adapted. Independent of `sendProgress`. |
| `sendMaxRetries` | `3` | Max delivery attempts per outbound message, including the initial send (0-10 configured, minimum 1 actual attempt) |
-Non-image attachments are included in the user message as local path references, without
-injecting their contents into the model prompt. When file tools are enabled, the agent
-can inspect supported text, PDF, DOCX, XLSX, and PPTX files on demand with `read_file`,
-or pass the original path to another tool when exact file bytes are required. The deprecated
-`channels.extractDocumentText` setting is accepted for compatibility but ignored.
-Normal tool workspace and media access rules still apply to attachment paths.
+Non-image attachments are included in the user message as local path references, without injecting their contents into the model prompt. When file tools are enabled, the agent can inspect supported text, PDF, DOCX, XLSX, and PPTX files on demand with `read_file`, or pass the original path to another tool when exact file bytes are required. The deprecated `channels.extractDocumentText` setting is accepted for compatibility but ignored. Normal tool workspace and media access rules still apply to attachment paths.
`channels.transcriptionProvider` and `channels.transcriptionLanguage` are deprecated compatibility fields. They remain as a read-only fallback for older configs, but new configuration should use top-level `transcription.provider` and `transcription.language`.
@@ -1866,9 +1817,7 @@ You can also set `OLOSTEP_API_KEY` in the environment instead of storing it in c
}
```
-Create your API key at [open.bochaai.com](https://open.bochaai.com).
-Bocha returns structured results optimized for AI consumption, with optional summaries.
-You can set `BOCHA_API_KEY` in the environment instead of storing it in config.
+Create your API key at [open.bochaai.com](https://open.bochaai.com). Bocha returns structured results optimized for AI consumption, with optional summaries. You can set `BOCHA_API_KEY` in the environment instead of storing it in config.
**Volcengine Search:**
```json
@@ -1979,12 +1928,7 @@ AnySearch works out of the box with no key, via its anonymous quota (lower rate
nanobot by default uses [Jina Reader](https://jina.ai/reader/), a third-party API, to convert arbitrary pages into Markdown format for easy digestion by the LLM, with a local fallback based on [readability-lxml](https://github.com/buriy/python-readability) if the former fails.
> [!NOTE]
-> Using the remote reader means the fetched URL itself is disclosed to the
-> third-party service. URLs that visibly carry credentials (userinfo, signed-URL
-> or token-style query parameters) are detected and fetched locally instead, but
-> secrets embedded in a URL's *path* (for example bot-token or webhook-style
-> URLs) cannot be reliably detected. Set `useJinaReader: false` if fetched URLs
-> must never leave the machine.
+> Using the remote reader means the fetched URL itself is disclosed to the third-party service. URLs that visibly carry credentials (userinfo, signed-URL or token-style query parameters) are detected and fetched locally instead, but secrets embedded in a URL's *path* (for example bot-token or webhook-style URLs) cannot be reliably detected. Set `useJinaReader: false` if fetched URLs must never leave the machine.
If you want to always use the local conversion, you can force it using:
@@ -2047,12 +1991,7 @@ MCP servers can run locally over stdio or connect remotely over HTTP:
| **Stdio** | `command` + `args` | Local process via `npx` / `uvx` |
| **Streamable HTTP / SSE** | `url` + `headers` (optional) | Remote endpoint (`https://mcp.example.com/mcp`) |
-Remote HTTP servers may use browser OAuth instead of static headers. In the
-WebUI, open **Apps → MCP → Add MCP server**, choose **Custom**, select HTTP or
-SSE, and choose **OAuth** under **Authentication**. Save the server, then choose
-**Connect**. For manual configuration, add `auth: "oauth"` and open
-**Apps → MCP** to connect. Known presets such as Xmind, Notion, and Linear add
-the config automatically on first click.
+Remote HTTP servers may use browser OAuth instead of static headers. In the WebUI, open **Apps → MCP → Add MCP server**, choose **Custom**, select HTTP or SSE, and choose **OAuth** under **Authentication**. Save the server, then choose **Connect**. For manual configuration, add `auth: "oauth"` and open **Apps → MCP** to connect. Known presets such as Xmind, Notion, and Linear add the config automatically on first click.
```json
{
@@ -2068,21 +2007,9 @@ the config automatically on first click.
}
```
-nanobot opens the server's authorization page and handles the callback through
-the gateway. The tools become available immediately when hot reload succeeds;
-otherwise the WebUI asks for a restart. OAuth tokens and dynamic client
-registration data are stored in the nanobot data directory under
-`auth/mcp.json`; they are not written to `config.json`. Removing the MCP server
-from Apps also removes its saved OAuth credentials. Normal gateway startup never
-opens a browser or registers a new OAuth client when credentials are
-missing—interactive authorization starts only after a user clicks **Connect**.
+nanobot opens the server's authorization page and handles the callback through the gateway. The tools become available immediately when hot reload succeeds; otherwise the WebUI asks for a restart. OAuth tokens and dynamic client registration data are stored in the nanobot data directory under `auth/mcp.json`; they are not written to `config.json`. Removing the MCP server from Apps also removes its saved OAuth credentials. Normal gateway startup never opens a browser or registers a new OAuth client when credentials are missing—interactive authorization starts only after a user clicks **Connect**.
-For a remotely accessed WebUI, HTTPS is recommended. Configure
-`channels.websocket.publicWsUrl` with the browser-facing `wss://` endpoint so
-nanobot can register the matching HTTPS callback and finish automatically. A
-loopback WebUI may use HTTP. When a remote WebUI is served over plain HTTP,
-nanobot instead registers a localhost callback and asks you to paste the complete
-callback URL from the browser address bar after authorization.
+For a remotely accessed WebUI, HTTPS is recommended. Configure `channels.websocket.publicWsUrl` with the browser-facing `wss://` endpoint so nanobot can register the matching HTTPS callback and finish automatically. A loopback WebUI may use HTTP. When a remote WebUI is served over plain HTTP, nanobot instead registers a localhost callback and asks you to paste the complete callback URL from the browser address bar after authorization.
> [!IMPORTANT]
> HTTP/SSE MCP URLs are validated before probing or connecting, and every outgoing MCP HTTP request—including OAuth metadata, client registration, token exchange, and redirects—is validated again. `localhost`, `127.0.0.1`, RFC1918/private IPs, CGNAT/Tailscale ranges, link-local addresses, and cloud metadata endpoints are blocked by default. This can break previously working local or private HTTP MCP configs until the endpoint is explicitly allowed with `tools.ssrfWhitelist`, preferably with a single-host CIDR such as `127.0.0.1/32`, `::1/128`, or `192.168.1.50/32`. Stdio MCP servers are not affected.
@@ -2137,14 +2064,7 @@ MCP tools are automatically discovered and registered on startup. The LLM can us
For API keys, tokens, and other secrets, see [Environment Variables for Secrets](#environment-variables-for-secrets) — avoid storing them directly in `config.json`.
> [!NOTE]
-> When a restricted WebUI chat selects a project outside the configured agent
-> workspace, that project becomes the normal file and shell boundary. Nanobot
-> adds capability-specific, read-only access for built-in skills, the agent
-> workspace's `skills/` directory, and the exact agent
-> `memory/history.jsonl` file. Neighboring memory/profile files and all
-> cross-workspace writes remain denied. Agent-owned `SOUL.md` and `USER.md` are
-> assembled into model context directly; this does not grant file tools broader
-> access to the agent workspace.
+> When a restricted WebUI chat selects a project outside the configured agent workspace, that project becomes the normal file and shell boundary. Nanobot adds capability-specific, read-only access for built-in skills, the agent workspace's `skills/` directory, and the exact agent `memory/history.jsonl` file. Neighboring memory/profile files and all cross-workspace writes remain denied. Agent-owned `SOUL.md` and `USER.md` are assembled into model context directly; this does not grant file tools broader access to the agent workspace.
| Option | Default | Description |
|--------|---------|-------------|
@@ -2196,9 +2116,7 @@ By default, if you don't set `allowFrom`, pairing-capable channels can issue a p
}
```
-Slack and Mattermost DMs are open by default. To use pairing there, set the
-channel's `dm.policy` to `"allowlist"` and leave `dm.allowFrom` empty until you
-approve users:
+Slack and Mattermost DMs are open by default. To use pairing there, set the channel's `dm.policy` to `"allowlist"` and leave `dm.allowFrom` empty until you approve users:
```json
{
@@ -2404,11 +2322,7 @@ Disabled skills are excluded from the main agent's skill summary, from always-on
nanobot discovers [Agent Plugins](https://agent-plugins.org/) under `<workspace>/plugins/`; a v1 package has `plugin.json` and may add `mcp.json`, `skills/<name>/SKILL.md`, or both. Agent Plugins are the common package and activation boundary for installable capabilities; they do not replace native providers, channels, tools, standalone workspace skills, or directly configured MCP servers.
-Directory presence means installed; activation is explicit in **Apps**. Skills use progressive loading and `$skill-name` invocation, with workspace > plugin > built-in precedence.
-Enabled `stdio` servers receive contained `PLUGIN_ROOT` and isolated `PLUGIN_DATA` paths; explicit
-`tools.mcpServers` entries win collisions. Invalid or escaping components are ignored.
-An enabled package is treated as immutable: changing any packaged file disables it until the user
-reviews and enables it again. Runtime state belongs under `PLUGIN_DATA`, not the package root.
+Directory presence means installed; activation is explicit in **Apps**. Skills use progressive loading and `$skill-name` invocation, with workspace > plugin > built-in precedence. Enabled `stdio` servers receive contained `PLUGIN_ROOT` and isolated `PLUGIN_DATA` paths; explicit `tools.mcpServers` entries win collisions. Invalid or escaping components are ignored. An enabled package is treated as immutable: changing any packaged file disables it until the user reviews and enables it again. Runtime state belongs under `PLUGIN_DATA`, not the package root.
Enabled plugins run as the nanobot user; permissions are descriptive, not an OS sandbox. The optional `extensions.dev.nanobot.logo` accepts a contained PNG, JPEG, or WebP up to 256 KiB.
diff --git a/docs/deployment.md b/docs/deployment.md
index 529e928a1..7e8e9eccf 100644
--- a/docs/deployment.md
+++ b/docs/deployment.md
@@ -59,9 +59,7 @@ If deployment fails, open the service **Logs** page first. A missing model key f
## Docker
> [!TIP]
-> The `-v ~/.nanobot:/home/nanobot/.nanobot` flag mounts your local config directory into the container, so your config and workspace persist across container restarts.
-> The container runs as the non-root user `nanobot` (UID 1000) and reads config from `/home/nanobot/.nanobot`. Always mount your host config directory to `/home/nanobot/.nanobot`, not `/root/.nanobot`.
-> If you get **Permission denied**, fix ownership on the host first: `sudo chown -R 1000:1000 ~/.nanobot`, or pass `--user $(id -u):$(id -g)` to match your host UID. Podman users can use `--userns=keep-id` instead.
+> The `-v ~/.nanobot:/home/nanobot/.nanobot` flag mounts your local config directory into the container, so your config and workspace persist across container restarts. The container runs as the non-root user `nanobot` (UID 1000) and reads config from `/home/nanobot/.nanobot`. Always mount your host config directory to `/home/nanobot/.nanobot`, not `/root/.nanobot`. If you get **Permission denied**, fix ownership on the host first: `sudo chown -R 1000:1000 ~/.nanobot`, or pass `--user $(id -u):$(id -g)` to match your host UID. Podman users can use `--userns=keep-id` instead.
>
> [!IMPORTANT]
> Official Docker usage currently means building from this repository with the included `Dockerfile`. Docker Hub images under third-party namespaces are not maintained or verified by HKUDS/nanobot; do not mount API keys or bot tokens into them unless you trust the publisher.
@@ -82,19 +80,11 @@ If deployment fails, open the service **Logs** page first. A missing model key f
> }
> ```
>
-> When the WebSocket `host` is `0.0.0.0`, the channel refuses to start unless `token`, `tokenIssueSecret`, or a fully configured `trustedProxyAuth` is also configured. See [`webui.md#lan-access`](./webui.md#lan-access) for details.
-> The gateway health route itself is intentionally minimal and unauthenticated. When the
-> container binds it to `0.0.0.0`, publish port `18790` to host loopback only; place any
-> remotely monitored health endpoint behind a firewall or reverse proxy. If another host
-> must probe it directly, replace `127.0.0.1` in the port mapping with a trusted host
-> interface and restrict inbound traffic to the monitoring system.
+> When the WebSocket `host` is `0.0.0.0`, the channel refuses to start unless `token`, `tokenIssueSecret`, or a fully configured `trustedProxyAuth` is also configured. See [`webui.md#lan-access`](./webui.md#lan-access) for details. The gateway health route itself is intentionally minimal and unauthenticated. When the container binds it to `0.0.0.0`, publish port `18790` to host loopback only; place any remotely monitored health endpoint behind a firewall or reverse proxy. If another host must probe it directly, replace `127.0.0.1` in the port mapping with a trusted host interface and restrict inbound traffic to the monitoring system.
### Cloudflare Tunnel + Cloudflare Access
-For a local `cloudflared` process in front of nanobot, Cloudflare Access can
-authenticate the user before forwarding the request and add
-`Cf-Access-Jwt-Assertion`. Opt in to trusted-proxy no-token mode only when the
-direct TCP peer is the tunnel process and the assertion is non-empty:
+For a local `cloudflared` process in front of nanobot, Cloudflare Access can authenticate the user before forwarding the request and add `Cf-Access-Jwt-Assertion`. Opt in to trusted-proxy no-token mode only when the direct TCP peer is the tunnel process and the assertion is non-empty:
```json
{
@@ -113,40 +103,19 @@ direct TCP peer is the tunnel process and the assertion is non-empty:
}
```
-This is two-part authorization: a trusted direct loopback peer **and** a
-non-empty Cloudflare Access assertion. A trusted CIDR alone is not a bypass.
-For this flow `/webui/bootstrap` returns connection metadata without a
-bootstrap token or REST API token; the proxy assertion authorizes the WebSocket
-handshake and REST requests directly.
-
-Set `publicWsUrl` to the browser-facing `wss://` endpoint when the tunnel sends
-the origin host header (such as `127.0.0.1:8765`); otherwise the WebUI could
-attempt to open its WebSocket directly against the loopback address.
-The assertion header must be generated
-by Cloudflare Access after authentication; routing/client metadata headers such
-as `Host`, `Forwarded`, `X-Forwarded-*`, `X-Real-IP`, and `CF-Connecting-IP`
-are rejected as `assertionHeader` values. Nanobot trusts the assertion but does
-not cryptographically validate the JWT, so configure the tunnel and Access
-policy carefully and do not expose the nanobot listener directly to untrusted
-clients. Forwarded client headers do not establish proxy trust.
+This is two-part authorization: a trusted direct loopback peer **and** a non-empty Cloudflare Access assertion. A trusted CIDR alone is not a bypass. For this flow `/webui/bootstrap` returns connection metadata without a bootstrap token or REST API token; the proxy assertion authorizes the WebSocket handshake and REST requests directly.
+
+Set `publicWsUrl` to the browser-facing `wss://` endpoint when the tunnel sends the origin host header (such as `127.0.0.1:8765`); otherwise the WebUI could attempt to open its WebSocket directly against the loopback address. The assertion header must be generated by Cloudflare Access after authentication; routing/client metadata headers such as `Host`, `Forwarded`, `X-Forwarded-*`, `X-Real-IP`, and `CF-Connecting-IP` are rejected as `assertionHeader` values. Nanobot trusts the assertion but does not cryptographically validate the JWT, so configure the tunnel and Access policy carefully and do not expose the nanobot listener directly to untrusted clients. Forwarded client headers do not establish proxy trust.
### Docker Compose
-The default image preinstalls WhatsApp dependencies. To bake other enabled
-channels into an image (recommended for deployments without PyPI access), pass
-a comma-separated `NANOBOT_CHANNELS` build argument:
+The default image preinstalls WhatsApp dependencies. To bake other enabled channels into an image (recommended for deployments without PyPI access), pass a comma-separated `NANOBOT_CHANNELS` build argument:
```bash
NANOBOT_CHANNELS=telegram,slack docker compose build
```
-The image keeps nanobot in a virtual environment owned by its built-in non-root
-runtime user (UID 1000). If an enabled channel was not preinstalled, gateway
-startup can therefore install its manifest-declared dependencies. Rebuilding
-with `NANOBOT_CHANNELS` keeps that installation reproducible instead of relying
-on the container's writable layer. If you override the container with a
-different `--user`, bake every enabled channel into the image because that UID
-is not guaranteed write access to the virtual environment.
+The image keeps nanobot in a virtual environment owned by its built-in non-root runtime user (UID 1000). If an enabled channel was not preinstalled, gateway startup can therefore install its manifest-declared dependencies. Rebuilding with `NANOBOT_CHANNELS` keeps that installation reproducible instead of relying on the container's writable layer. If you override the container with a different `--user`, bake every enabled channel into the image because that UID is not guaranteed write access to the virtual environment.
```bash
docker compose run --rm nanobot-cli onboard # first-time setup
@@ -160,24 +129,14 @@ docker compose logs -f nanobot-gateway # view logs
docker compose down # stop
```
-The default Compose file drops all Linux capabilities except `CHOWN`, `SETUID`, and
-`SETGID`, which the root entrypoint needs to fix bind-mount ownership and become UID
-1000. It also enables `no-new-privileges`, so the non-root process cannot regain those
-bootstrap capabilities through setuid binaries or file capabilities. Docker's default
-AppArmor/seccomp profiles remain enabled. If you explicitly set
-`"tools.exec.sandbox": "bwrap"` in `~/.nanobot/config.json`, add the bwrap
-override file when starting containers:
+The default Compose file drops all Linux capabilities except `CHOWN`, `SETUID`, and `SETGID`, which the root entrypoint needs to fix bind-mount ownership and become UID 1000. It also enables `no-new-privileges`, so the non-root process cannot regain those bootstrap capabilities through setuid binaries or file capabilities. Docker's default AppArmor/seccomp profiles remain enabled. If you explicitly set `"tools.exec.sandbox": "bwrap"` in `~/.nanobot/config.json`, add the bwrap override file when starting containers:
```bash
docker compose -f docker-compose.yml -f docker-compose.bwrap.yml up -d nanobot-gateway
docker compose -f docker-compose.yml -f docker-compose.bwrap.yml run --rm nanobot-cli agent -m "Hello!"
```
-The override adds `CAP_SYS_ADMIN` and disables AppArmor/seccomp confinement for the
-container so bubblewrap can create its nested namespaces. It preserves
-`no-new-privileges`. The host must also allow unprivileged user namespaces; the
-override cannot bypass a host-level namespace restriction. Use it only when the
-bwrap sandbox is enabled.
+The override adds `CAP_SYS_ADMIN` and disables AppArmor/seccomp confinement for the container so bubblewrap can create its nested namespaces. It preserves `no-new-privileges`. The host must also allow unprivileged user namespaces; the override cannot bypass a host-level namespace restriction. Use it only when the bwrap sandbox is enabled.
### Docker
@@ -261,10 +220,7 @@ journalctl --user -u nanobot-gateway -f # follow logs
nanobot gateway uninstall-service --manager systemd
```
-The installer writes `~/.config/systemd/user/nanobot-gateway.service`, runs
-`systemctl --user daemon-reload`, enables the unit, and restarts it. It uses the
-current Python executable with `python -m nanobot gateway --foreground`, so the
-service runs in the same environment you used to install nanobot.
+The installer writes `~/.config/systemd/user/nanobot-gateway.service`, runs `systemctl --user daemon-reload`, enables the unit, and restarts it. It uses the current Python executable with `python -m nanobot gateway --foreground`, so the service runs in the same environment you used to install nanobot.
> **Note:** User services only run while you are logged in. To keep the gateway running after logout, enable lingering:
>
@@ -306,8 +262,6 @@ launchctl kickstart -k gui/$(id -u)/ai.nanobot.gateway
nanobot gateway uninstall-service --manager launchd
```
-The installer writes `~/Library/LaunchAgents/ai.nanobot.gateway.plist`, uses the
-current Python executable with `python -m nanobot gateway --foreground`, and
-writes LaunchAgent logs under `~/.nanobot/logs/`.
+The installer writes `~/Library/LaunchAgents/ai.nanobot.gateway.plist`, uses the current Python executable with `python -m nanobot gateway --foreground`, and writes LaunchAgent logs under `~/.nanobot/logs/`.
> **Note:** if startup fails with "address already in use", stop the manually started `nanobot gateway` process first.
diff --git a/docs/guides/ai-agent-memory.md b/docs/guides/ai-agent-memory.md
index 481917379..c22861306 100644
--- a/docs/guides/ai-agent-memory.md
+++ b/docs/guides/ai-agent-memory.md
@@ -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
diff --git a/docs/guides/ai-agent-webui.md b/docs/guides/ai-agent-webui.md
index 2ea6a4ab6..327b7bb7c 100644
--- a/docs/guides/ai-agent-webui.md
+++ b/docs/guides/ai-agent-webui.md
@@ -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
diff --git a/docs/guides/build-a-personal-ai-agent.md b/docs/guides/build-a-personal-ai-agent.md
index 716f0df19..c32578714 100644
--- a/docs/guides/build-a-personal-ai-agent.md
+++ b/docs/guides/build-a-personal-ai-agent.md
@@ -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
diff --git a/docs/guides/chat-app-ai-agent.md b/docs/guides/chat-app-ai-agent.md
index 570853de6..518dc05a8 100644
--- a/docs/guides/chat-app-ai-agent.md
+++ b/docs/guides/chat-app-ai-agent.md
@@ -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
diff --git a/docs/guides/configure-langfuse-observability.md b/docs/guides/configure-langfuse-observability.md
index b979f4c99..8f1fa459c 100644
--- a/docs/guides/configure-langfuse-observability.md
+++ b/docs/guides/configure-langfuse-observability.md
@@ -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.
diff --git a/docs/guides/configure-mcp-tools.md b/docs/guides/configure-mcp-tools.md
index ca0fe1a98..f5df2f225 100644
--- a/docs/guides/configure-mcp-tools.md
+++ b/docs/guides/configure-mcp-tools.md
@@ -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
diff --git a/docs/guides/configure-model-fallback.md b/docs/guides/configure-model-fallback.md
index 2246eb296..0f0eebd7e 100644
--- a/docs/guides/configure-model-fallback.md
+++ b/docs/guides/configure-model-fallback.md
@@ -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
diff --git a/docs/guides/configure-ollama-prompt-cache.md b/docs/guides/configure-ollama-prompt-cache.md
index 9455176c8..826ca211f 100644
--- a/docs/guides/configure-ollama-prompt-cache.md
+++ b/docs/guides/configure-ollama-prompt-cache.md
@@ -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
diff --git a/docs/guides/configure-openai-compatible-provider.md b/docs/guides/configure-openai-compatible-provider.md
index f0a11cd2c..cda4b47e6 100644
--- a/docs/guides/configure-openai-compatible-provider.md
+++ b/docs/guides/configure-openai-compatible-provider.md
@@ -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
diff --git a/docs/guides/configure-web-search.md b/docs/guides/configure-web-search.md
index 9d370302e..87c4d129f 100644
--- a/docs/guides/configure-web-search.md
+++ b/docs/guides/configure-web-search.md
@@ -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
diff --git a/docs/guides/deploy-nanobot-gateway.md b/docs/guides/deploy-nanobot-gateway.md
index 52eb31ae7..755d2a372 100644
--- a/docs/guides/deploy-nanobot-gateway.md
+++ b/docs/guides/deploy-nanobot-gateway.md
@@ -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
diff --git a/docs/guides/discord-ai-agent.md b/docs/guides/discord-ai-agent.md
index 475f35971..24bd8b143 100644
--- a/docs/guides/discord-ai-agent.md
+++ b/docs/guides/discord-ai-agent.md
@@ -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
diff --git a/docs/guides/email-ai-agent.md b/docs/guides/email-ai-agent.md
index aa7a752bc..881a5014a 100644
--- a/docs/guides/email-ai-agent.md
+++ b/docs/guides/email-ai-agent.md
@@ -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.
-
-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:
+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:
```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.
-
-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.
+ 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.
+
+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
diff --git a/docs/guides/feishu-ai-agent.md b/docs/guides/feishu-ai-agent.md
index b7b0f3876..db155aa18 100644
--- a/docs/guides/feishu-ai-agent.md
+++ b/docs/guides/feishu-ai-agent.md
@@ -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
diff --git a/docs/guides/ios-pwa-status-bar.md b/docs/guides/ios-pwa-status-bar.md
index 4d1989203..b42febe90 100644
--- a/docs/guides/ios-pwa-status-bar.md
+++ b/docs/guides/ios-pwa-status-bar.md
@@ -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 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.
-
-This is a compatibility workaround, **not a supported Apple status-bar API**.
-First-person device experiments describing the same mechanism:
+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 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:
- [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.
diff --git a/docs/guides/linear-agent.md b/docs/guides/linear-agent.md
index 6dbce3687..b1a28ee51 100644
--- a/docs/guides/linear-agent.md
+++ b/docs/guides/linear-agent.md
@@ -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.
-
-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.
+- 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 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.
-
-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.
+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.
+
+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.
-
-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.
-
-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.
-
-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.
+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.
+
+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.
+
+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.
## 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.
-
-- **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.
-
-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.**
+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.
+
+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.**
## 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.
-
-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 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.
+
+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).
diff --git a/docs/guides/long-running-ai-agent.md b/docs/guides/long-running-ai-agent.md
index 4104cfefd..087dc354e 100644
--- a/docs/guides/long-running-ai-agent.md
+++ b/docs/guides/long-running-ai-agent.md
@@ -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
diff --git a/docs/guides/mattermost-ai-agent.md b/docs/guides/mattermost-ai-agent.md
index af049e02b..4783f7159 100644
--- a/docs/guides/mattermost-ai-agent.md
+++ b/docs/guides/mattermost-ai-agent.md
@@ -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
diff --git a/docs/guides/mcp-tools-for-ai-agents.md b/docs/guides/mcp-tools-for-ai-agents.md
index 68c7aa910..8643e1109 100644
--- a/docs/guides/mcp-tools-for-ai-agents.md
+++ b/docs/guides/mcp-tools-for-ai-agents.md
@@ -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
diff --git a/docs/guides/openai-compatible-agent-api.md b/docs/guides/openai-compatible-agent-api.md
index 4b12c441b..3fb21c137 100644
--- a/docs/guides/openai-compatible-agent-api.md
+++ b/docs/guides/openai-compatible-agent-api.md
@@ -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
diff --git a/docs/guides/python-ai-agent-sdk.md b/docs/guides/python-ai-agent-sdk.md
index 283dea951..5bc817f32 100644
--- a/docs/guides/python-ai-agent-sdk.md
+++ b/docs/guides/python-ai-agent-sdk.md
@@ -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
diff --git a/docs/guides/qq-ai-agent.md b/docs/guides/qq-ai-agent.md
index 9ff110e48..bdd48a309 100644
--- a/docs/guides/qq-ai-agent.md
+++ b/docs/guides/qq-ai-agent.md
@@ -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
diff --git a/docs/guides/remote-instances.md b/docs/guides/remote-instances.md
index 680eb9444..33c64a2a2 100644
--- a/docs/guides/remote-instances.md
+++ b/docs/guides/remote-instances.md
@@ -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.
-
-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.
-
-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.
+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.
+
+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.
## 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.
-
-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:
-
-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.
-
-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.
-
-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.
-
-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:
+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.
+
+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.
+
+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.
+
+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.
+
+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.
+
+**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.
-
-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.
-
-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.
+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.
+
+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.
## 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.
-
-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.
-
-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.
+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.
+
+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.
## 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.
-
-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.
+- 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.
## 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.
-
-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.
+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.
### 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.
-
-- **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.
-
-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.
-
-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.
-
-- **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.
+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.
+
+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.
+
+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.
+
+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.
## 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.
-
-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.
-
-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.
-
-**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.
-
-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.
+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.
+
+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.
+
+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.
+
+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.
diff --git a/docs/guides/secure-local-ai-agent.md b/docs/guides/secure-local-ai-agent.md
index dce014b62..c0ab7593c 100644
--- a/docs/guides/secure-local-ai-agent.md
+++ b/docs/guides/secure-local-ai-agent.md
@@ -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
diff --git a/docs/guides/self-hosted-ai-agent.md b/docs/guides/self-hosted-ai-agent.md
index 081027eb8..6c806a049 100644
--- a/docs/guides/self-hosted-ai-agent.md
+++ b/docs/guides/self-hosted-ai-agent.md
@@ -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
diff --git a/docs/guides/slack-ai-agent.md b/docs/guides/slack-ai-agent.md
index 3f222446e..2c1eae6ea 100644
--- a/docs/guides/slack-ai-agent.md
+++ b/docs/guides/slack-ai-agent.md
@@ -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
diff --git a/docs/guides/telegram-ai-agent.md b/docs/guides/telegram-ai-agent.md
index b19be8ca9..7b549f734 100644
--- a/docs/guides/telegram-ai-agent.md
+++ b/docs/guides/telegram-ai-agent.md
@@ -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
diff --git a/docs/guides/wechat-ai-agent.md b/docs/guides/wechat-ai-agent.md
index 3c8b28d81..c38d0f0bf 100644
--- a/docs/guides/wechat-ai-agent.md
+++ b/docs/guides/wechat-ai-agent.md
@@ -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
diff --git a/docs/guides/whatsapp-ai-agent.md b/docs/guides/whatsapp-ai-agent.md
index 8c1748c9e..53e53a841 100644
--- a/docs/guides/whatsapp-ai-agent.md
+++ b/docs/guides/whatsapp-ai-agent.md
@@ -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
diff --git a/docs/memory.md b/docs/memory.md
index 75e4e733b..14ac173eb 100644
--- a/docs/memory.md
+++ b/docs/memory.md
@@ -1,8 +1,6 @@
# AI Agent Memory in nanobot
-This page explains how nanobot implements long-term AI agent memory: session
-history, compressed archives, durable knowledge files, Dream consolidation, and
-Git-backed memory changes.
+This page explains how nanobot implements long-term AI agent memory: session history, compressed archives, durable knowledge files, Dream consolidation, and Git-backed memory changes.
nanobot's memory is built on a simple belief: memory should feel alive, but it should not feel chaotic.
@@ -66,10 +64,7 @@ This is why nanobot's memory is not just archival. It is interpretive.
## The Files
-In this page, `workspace` means the configured **agent workspace** (the default
-is `~/.nanobot/workspace/`, or the path passed with `--workspace`). Selecting a
-different project in the WebUI changes that chat's project context and tool
-working directory; it does not relocate the files below.
+In this page, `workspace` means the configured **agent workspace** (the default is `~/.nanobot/workspace/`, or the path passed with `--workspace`). Selecting a different project in the WebUI changes that chat's project context and tool working directory; it does not relocate the files below.
```text
workspace/
@@ -86,10 +81,7 @@ workspace/
└── .dream_cursor # Dream consumption cursor
```
-A selected project may provide its own `AGENTS.md`, but project-local `SOUL.md`,
-`USER.md`, and `memory/` do not replace the agent-owned files above. This keeps
-one agent's profile and memory continuous while it works across projects. Use a
-separate configured agent workspace when identity or memory must be isolated.
+A selected project may provide its own `AGENTS.md`, but project-local `SOUL.md`, `USER.md`, and `memory/` do not replace the agent-owned files above. This keeps one agent's profile and memory continuous while it works across projects. Use a separate configured agent workspace when identity or memory must be isolated.
These files play different roles:
diff --git a/docs/my-tool.md b/docs/my-tool.md
index 8c5f1d16c..65dbcdb87 100644
--- a/docs/my-tool.md
+++ b/docs/my-tool.md
@@ -27,8 +27,7 @@ To allow the agent to set its configuration (e.g. switch models, adjust paramete
Legacy `tools.myEnabled` / `tools.mySet` keys are auto-migrated on load, and rewritten in-place the next time `nanobot onboard` refreshes the config.
-Most modifications are held in memory only. `model_preset` is the exception: it is
-stored in the current session so the selection survives a restart.
+Most modifications are held in memory only. `model_preset` is the exception: it is stored in the current session so the selection survives a restart.
---
@@ -77,11 +76,7 @@ my(action="check", key="web_config.enable")
## set — Runtime tuning
-Changes do not require a restart. `model_preset` is saved for the current session and
-applies to its next turn; other writable runtime tuning takes effect immediately.
-Direct `model` and `context_window_tokens` writes are rejected during an active session
-because those setters change the shared instance default. Configure a named preset for
-model or context-window changes instead.
+Changes do not require a restart. `model_preset` is saved for the current session and applies to its next turn; other writable runtime tuning takes effect immediately. Direct `model` and `context_window_tokens` writes are rejected during an active session because those setters change the shared instance default. Configure a named preset for model or context-window changes instead.
```text
my(action="set", key="max_iterations", value=80)
@@ -160,10 +155,7 @@ Agent: I've used ~53k tokens total so far. I'll keep my remaining replies concis
### "Subagent monitoring"
-Subagent snapshots include only tasks created by the current session. This scope
-also applies to `subagents._task_statuses.<task_id>` and nested fields. Without a
-current session key, direct subagent checks return an error and the full overview
-contains no tasks. Completed tasks are removed; this is not a result archive.
+Subagent snapshots include only tasks created by the current session. This scope also applies to `subagents._task_statuses.<task_id>` and nested fields. Without a current session key, direct subagent checks return an error and the full overview contains no tasks. Completed tasks are removed; this is not a result archive.
```text
Agent: Let me check on the background tasks.
@@ -183,9 +175,7 @@ Agent: The code review is progressing well. The test task hasn't started yet.
## Safety Mechanisms
-Core design principle: **The tool does not rewrite `config.json`.** Instance-wide
-changes live in memory only, while `model_preset` persists only as the current
-session's selector.
+Core design principle: **The tool does not rewrite `config.json`.** Instance-wide changes live in memory only, while `model_preset` persists only as the current session's selector.
### Off-limits (BLOCKED)
diff --git a/docs/openai-api.md b/docs/openai-api.md
index 7c315a875..cefaa2497 100644
--- a/docs/openai-api.md
+++ b/docs/openai-api.md
@@ -14,10 +14,7 @@ For setup help, see [`quick-start.md`](./quick-start.md), [`providers.md`](./pro
## Authentication
-Local-only `127.0.0.1` usage does not require an API key. If you bind the API
-server to all interfaces with `api.host: "0.0.0.0"` or `"::"`, nanobot requires
-`api.apiKey`; otherwise startup fails to avoid exposing an unauthenticated agent
-endpoint on the network.
+Local-only `127.0.0.1` usage does not require an API key. If you bind the API server to all interfaces with `api.host: "0.0.0.0"` or `"::"`, nanobot requires `api.apiKey`; otherwise startup fails to avoid exposing an unauthenticated agent endpoint on the network.
```json
{
@@ -29,9 +26,7 @@ endpoint on the network.
}
```
-When `api.apiKey` is set, send it as a Bearer token on API routes. The health
-endpoint remains unauthenticated so local probes and load balancers can still
-check process health.
+When `api.apiKey` is set, send it as a Bearer token on API routes. The health endpoint remains unauthenticated so local probes and load balancers can still check process health.
```bash
curl http://127.0.0.1:8900/v1/models \
diff --git a/docs/provider-cookbook.md b/docs/provider-cookbook.md
index 909bde074..085d8f1da 100644
--- a/docs/provider-cookbook.md
+++ b/docs/provider-cookbook.md
@@ -97,9 +97,7 @@ If this fails with `401` or `unauthorized`, check that `OPENROUTER_API_KEY` is v
## Recipe: OpenCode Zen or Go
-This recipe applies when your credential comes from OpenCode Zen or OpenCode Go.
-Both providers use `OPENCODE_API_KEY`; pick the provider block that matches the
-subscription or balance you want to use.
+This recipe applies when your credential comes from OpenCode Zen or OpenCode Go. Both providers use `OPENCODE_API_KEY`; pick the provider block that matches the subscription or balance you want to use.
OpenCode Zen:
@@ -160,11 +158,7 @@ nanobot status
nanobot agent -m "Hello!"
```
-OpenCode's docs list models across multiple endpoint types. The `opencode_zen`
-and `opencode_go` providers in nanobot use the OpenAI-compatible
-`chat/completions` path. If a model fails with `model not found` or an endpoint
-shape error, choose a model that OpenCode lists under `chat/completions` for the
-matching Zen or Go endpoint.
+OpenCode's docs list models across multiple endpoint types. The `opencode_zen` and `opencode_go` providers in nanobot use the OpenAI-compatible `chat/completions` path. If a model fails with `model not found` or an endpoint shape error, choose a model that OpenCode lists under `chat/completions` for the matching Zen or Go endpoint.
## Recipe: OpenAI Direct
@@ -422,11 +416,7 @@ nanobot agent -m "Hello!"
If you see `connection refused`, Ollama is not running or `apiBase` points to the wrong port. If every response is slow, try a smaller local model or lower `contextWindowTokens`.
-If direct Ollama responses are fast but tool-using nanobot turns repeatedly evaluate
-thousands of prompt tokens, the model's chat template may be moving its tool
-definitions between requests. See
-[Improve Ollama Tool-Calling Prompt Cache Reuse](./guides/configure-ollama-prompt-cache.md)
-for a diagnostic procedure and an optional model-specific workaround.
+If direct Ollama responses are fast but tool-using nanobot turns repeatedly evaluate thousands of prompt tokens, the model's chat template may be moving its tool definitions between requests. See [Improve Ollama Tool-Calling Prompt Cache Reuse](./guides/configure-ollama-prompt-cache.md) for a diagnostic procedure and an optional model-specific workaround.
## Recipe: vLLM or LM Studio
@@ -592,9 +582,7 @@ In chat:
/model fast
```
-`/model` stores the selection in the current session without rewriting `config.json`.
-The selection survives restarts, does not affect other sessions, and an in-progress
-turn keeps using the model it started with.
+`/model` stores the selection in the current session without rewriting `config.json`. The selection survives restarts, does not affect other sessions, and an in-progress turn keeps using the model it started with.
## Quick Failure Map
diff --git a/docs/providers.md b/docs/providers.md
index 3d3e24ae3..ff6bf9c68 100644
--- a/docs/providers.md
+++ b/docs/providers.md
@@ -4,22 +4,7 @@ Use this page when the first reply fails because of provider/model mismatch, or
For normal local setup, open **Settings → Models** in the WebUI to add provider credentials, create a model preset, and select the active model. Use the JSON below for manual deployments, local endpoints, provider-specific fields, or diagnosis.
-The model picker fetches online catalogs for OpenAI Codex, xAI Grok, and GitHub
-Copilot. An explicit authorization failure hides the picker’s search and model
-list and offers **Sign in again** using the existing provider login flow.
-Successful WebUI sign-in clears the catalog cache and restores model selection.
-Existing presets, selected models, and unsaved preset details are preserved.
-Network, rate-limit, and service failures instead keep cached or built-in lists
-available, label them as potentially out of date, and ask you to try again later
-(failed refreshes are cached briefly). Manual model IDs remain available for
-these temporary failures. A successful chat may have used a fallback preset and
-does not prove that the selected provider's authorization is still valid.
-When a live chat uses a fallback model, a dismissible notice above the composer
-names that model and links to model settings. If the provider explicitly rejected
-OAuth credentials, the notice instead names the provider that needs a new login,
-with fallback completion as secondary information. Network errors, ordinary
-permission denials, and rate limits do not request reauthentication. The notice
-does not change your selected preset.
+The model picker fetches online catalogs for OpenAI Codex, xAI Grok, and GitHub Copilot. An explicit authorization failure hides the picker’s search and model list and offers **Sign in again** using the existing provider login flow. Successful WebUI sign-in clears the catalog cache and restores model selection. Existing presets, selected models, and unsaved preset details are preserved. Network, rate-limit, and service failures instead keep cached or built-in lists available, label them as potentially out of date, and ask you to try again later (failed refreshes are cached briefly). Manual model IDs remain available for these temporary failures. A successful chat may have used a fallback preset and does not prove that the selected provider's authorization is still valid. When a live chat uses a fallback model, a dismissible notice above the composer names that model and links to model settings. If the provider explicitly rejected OAuth credentials, the notice instead names the provider that needs a new login, with fallback completion as secondary information. Network errors, ordinary permission denials, and rate limits do not request reauthentication. The notice does not change your selected preset.
For every setup, answer three questions:
@@ -88,20 +73,9 @@ Use `proxy` when one provider must send HTTP traffic through a proxy without cha
## Inline Image Requests
-Before sending a large inline image batch, providers prepare smaller copies while
-keeping the attachment files intact. This applies to Responses, Chat Completions,
-Anthropic Messages, and Bedrock Converse requests, including images returned by tools
-and images in Responses history replay. Preparation first re-encodes at the original
-dimensions, then reduces each dimension by at most 25% if needed, with JPEG quality
-at least 65. PNG transparency is preserved. The shared 1 MB image data URL budget is
-a best-effort transport target; small image blocks, animated images, and remote
-references keep their original payloads. Gateway logs report image sizes and byte counts.
-
-Preparation preserves each adapter's model and API capability rules. When automatic
-Responses compatibility fallback is allowed, switching to Chat Completions retains
-the images. The shared retry policy can retry a non-transient image request error once
-without images, using text placeholders that explicitly say the images were not delivered.
-Responses state containing images is discarded before that text-only retry.
+Before sending a large inline image batch, providers prepare smaller copies while keeping the attachment files intact. This applies to Responses, Chat Completions, Anthropic Messages, and Bedrock Converse requests, including images returned by tools and images in Responses history replay. Preparation first re-encodes at the original dimensions, then reduces each dimension by at most 25% if needed, with JPEG quality at least 65. PNG transparency is preserved. The shared 1 MB image data URL budget is a best-effort transport target; small image blocks, animated images, and remote references keep their original payloads. Gateway logs report image sizes and byte counts.
+
+Preparation preserves each adapter's model and API capability rules. When automatic Responses compatibility fallback is allowed, switching to Chat Completions retains the images. The shared retry policy can retry a non-transient image request error once without images, using text placeholders that explicitly say the images were not delivered. Responses state containing images is discarded before that text-only retry.
## Common Provider Patterns
@@ -151,16 +125,11 @@ To opt into OpenRouter server-managed search and fetch, add:
}
```
-Chat Completions-compatible OpenRouter
-[server tools](https://openrouter.ai/docs/guides/features/server-tools), such as those above, are
-appended to nanobot's generated functions. This keeps unrelated local tools such as `write_file`
-available in the same request. Responses-only server tools require an API surface that the
-OpenRouter provider does not currently enable.
+Chat Completions-compatible OpenRouter [server tools](https://openrouter.ai/docs/guides/features/server-tools), such as those above, are appended to nanobot's generated functions. This keeps unrelated local tools such as `write_file` available in the same request. Responses-only server tools require an API surface that the OpenRouter provider does not currently enable.
### OrcaRouter Gateway
-[OrcaRouter](https://www.orcarouter.ai) is an OpenAI-compatible model routing gateway. Configure
-the built-in `orcarouter` provider and use a model ID from OrcaRouter's catalog:
+[OrcaRouter](https://www.orcarouter.ai) is an OpenAI-compatible model routing gateway. Configure the built-in `orcarouter` provider and use a model ID from OrcaRouter's catalog:
```json
{
@@ -185,17 +154,11 @@ the built-in `orcarouter` provider and use a model ID from OrcaRouter's catalog:
}
```
-Use the model ID exactly as OrcaRouter lists it. `orcarouter/auto` routes to a
-suitable upstream automatically; explicit IDs such as
-`anthropic/claude-sonnet-4.6` or `openai/gpt-5` are also accepted. OrcaRouter API keys start with
-`sk-orca-`. The WebUI can load the account's model catalog after the API key is saved under
-**Settings → Models**.
+Use the model ID exactly as OrcaRouter lists it. `orcarouter/auto` routes to a suitable upstream automatically; explicit IDs such as `anthropic/claude-sonnet-4.6` or `openai/gpt-5` are also accepted. OrcaRouter API keys start with `sk-orca-`. The WebUI can load the account's model catalog after the API key is saved under **Settings → Models**.
### Eden AI Gateway
-Eden AI exposes an OpenAI-compatible chat-completions endpoint at
-`https://api.edenai.run/v3`. Configure the built-in `edenai` provider and use
-the full `provider/model` identifier listed by Eden AI:
+Eden AI exposes an OpenAI-compatible chat-completions endpoint at `https://api.edenai.run/v3`. Configure the built-in `edenai` provider and use the full `provider/model` identifier listed by Eden AI:
```json
{
@@ -219,16 +182,11 @@ the full `provider/model` identifier listed by Eden AI:
}
```
-Nanobot sends the model ID unchanged, including its provider prefix. Use
-Eden AI's [model listing](https://www.edenai.co/docs/v3/llms/listing-models)
-to choose a currently available model. The WebUI can also load that catalog
-after the Eden AI API key is saved under **Settings → Models**.
+Nanobot sends the model ID unchanged, including its provider prefix. Use Eden AI's [model listing](https://www.edenai.co/docs/v3/llms/listing-models) to choose a currently available model. The WebUI can also load that catalog after the Eden AI API key is saved under **Settings → Models**.
### OpenCode Zen and Go
-OpenCode Zen and OpenCode Go are OpenCode-managed gateways for coding-agent models.
-They share `OPENCODE_API_KEY`, but use separate provider config keys and default base
-URLs in nanobot.
+OpenCode Zen and OpenCode Go are OpenCode-managed gateways for coding-agent models. They share `OPENCODE_API_KEY`, but use separate provider config keys and default base URLs in nanobot.
```json
{
@@ -273,12 +231,7 @@ For OpenCode Go, switch the provider block and preset:
}
```
-OpenCode documents model IDs with `opencode/<model-id>` for Zen and
-`opencode-go/<model-id>` for Go. nanobot accepts those prefixes and strips them
-before sending the request to OpenCode. Use model IDs that OpenCode lists under
-the `chat/completions` endpoint; models listed only under `responses`,
-`messages`, or provider-specific endpoints are not handled by this
-OpenAI-compatible provider path.
+OpenCode documents model IDs with `opencode/<model-id>` for Zen and `opencode-go/<model-id>` for Go. nanobot accepts those prefixes and strips them before sending the request to OpenCode. Use model IDs that OpenCode lists under the `chat/completions` endpoint; models listed only under `responses`, `messages`, or provider-specific endpoints are not handled by this OpenAI-compatible provider path.
### Anthropic Direct
@@ -506,12 +459,7 @@ Start Ollama separately, then point nanobot at the OpenAI-compatible endpoint.
Most Ollama setups do not require an API key.
-Ollama renders the OpenAI-compatible messages and tools through each model's chat
-template. If ordinary model responses are fast but tool-using turns show low prompt
-cache reuse, diagnose the rendered template before changing nanobot's context or
-memory settings. The
-[Ollama prompt-cache guide](./guides/configure-ollama-prompt-cache.md) explains the
-log pattern and a tested `llama3.1:8b` workaround.
+Ollama renders the OpenAI-compatible messages and tools through each model's chat template. If ordinary model responses are fast but tool-using turns show low prompt cache reuse, diagnose the rendered template before changing nanobot's context or memory settings. The [Ollama prompt-cache guide](./guides/configure-ollama-prompt-cache.md) explains the log pattern and a tested `llama3.1:8b` workaround.
### vLLM or Other Local OpenAI-Compatible Server
@@ -608,14 +556,9 @@ For OpenAI Codex:
nanobot provider login openai-codex --set-main
```
-The WebUI reads the account's Codex model catalog online, including current
-context-window and reasoning-effort metadata. A small compatible catalog remains
-available when the service cannot be reached.
+The WebUI reads the account's Codex model catalog online, including current context-window and reasoning-effort metadata. A small compatible catalog remains available when the service cannot be reached.
-After three WebSocket transport failures without a completed reply, the same
-authenticated session uses HTTP for subsequent attempts. The existing retry policy
-controls replay and cancellation. WebSocket logs include request bytes, first-event timing,
-and close codes; unrecognized close reasons are redacted.
+After three WebSocket transport failures without a completed reply, the same authenticated session uses HTTP for subsequent attempts. The existing retry policy controls replay and cancellation. WebSocket logs include request bytes, first-event timing, and close codes; unrecognized close reasons are redacted.
For an eligible X Premium / Grok subscription:
@@ -623,33 +566,13 @@ For an eligible X Premium / Grok subscription:
nanobot provider login xai-grok --set-main
```
-This selects `xai-grok/grok-4.6`. The WebUI model selector reads xAI's online
-model catalog, so newly available subscription models appear without a nanobot
-release. Online metadata is cached and enriched with nanobot's curated labels;
-if xAI is temporarily unavailable, nanobot uses the last successful catalog or
-a small built-in fallback instead of emptying the selector. The same catalog
-controls whether the provider exposes the hosted `x_search` tool; models that do
-not advertise support continue without hosted X Search.
-When enabled, Grok can search current X posts and return inline source links
-without invoking a local nanobot tool. Credentials are stored under the
-active instance's `auth/xai.json` (normally `~/.nanobot/auth/xai.json`), not in
-`config.json` and not in Grok Build's credential file.
-Hosted X Search remains enabled by default and can be disabled with the WebUI
-switch or `providers.xaiGrok.extraBody.tools: []`.
-
-The login is xAI subscription OAuth, not X Developer OAuth. It follows the
-public client contract documented and implemented by
-[Grok Build](https://github.com/xai-org/grok-build/blob/main/crates/codegen/xai-grok-pager/docs/user-guide/02-authentication.md);
-xAI may change that upstream contract independently of nanobot.
+This selects `xai-grok/grok-4.6`. The WebUI model selector reads xAI's online model catalog, so newly available subscription models appear without a nanobot release. Online metadata is cached and enriched with nanobot's curated labels; if xAI is temporarily unavailable, nanobot uses the last successful catalog or a small built-in fallback instead of emptying the selector. The same catalog controls whether the provider exposes the hosted `x_search` tool; models that do not advertise support continue without hosted X Search. When enabled, Grok can search current X posts and return inline source links without invoking a local nanobot tool. Credentials are stored under the active instance's `auth/xai.json` (normally `~/.nanobot/auth/xai.json`), not in `config.json` and not in Grok Build's credential file. Hosted X Search remains enabled by default and can be disabled with the WebUI switch or `providers.xaiGrok.extraBody.tools: []`.
+
+The login is xAI subscription OAuth, not X Developer OAuth. It follows the public client contract documented and implemented by [Grok Build](https://github.com/xai-org/grok-build/blob/main/crates/codegen/xai-grok-pager/docs/user-guide/02-authentication.md); xAI may change that upstream contract independently of nanobot.
For GitHub Copilot:
-You can also sign in from the WebUI's model settings. The sign-in dialog shows a
-device code: copy it, select **Open GitHub**, and enter the code on GitHub. Keep
-the dialog open; nanobot detects approval and refreshes the model catalog
-automatically. Closing the dialog cancels the pending sign-in without replacing
-your saved credentials. This works from a remote browser too; no browser needs
-to open on the gateway machine.
+You can also sign in from the WebUI's model settings. The sign-in dialog shows a device code: copy it, select **Open GitHub**, and enter the code on GitHub. Keep the dialog open; nanobot detects approval and refreshes the model catalog automatically. Closing the dialog cancels the pending sign-in without replacing your saved credentials. This works from a remote browser too; no browser needs to open on the gateway machine.
For terminal sign-in:
@@ -657,9 +580,7 @@ For terminal sign-in:
nanobot provider login github-copilot --set-main
```
-The WebUI reads the models enabled for the signed-in Copilot account. nanobot
-lists entries that support its current Copilot chat-completions or Responses
-transport and hides models that it cannot route safely.
+The WebUI reads the models enabled for the signed-in Copilot account. nanobot lists entries that support its current Copilot chat-completions or Responses transport and hides models that it cannot route safely.
Each command authenticates the selected provider and makes its current default model active. OpenAI Codex and eligible GitHub Copilot models participate in [Responses state retention](./configuration.md#responses-state-and-compaction), while native compaction remains provider-capability-specific. OAuth providers are not valid automatic fallbacks. See [`troubleshooting.md`](./troubleshooting.md#provider-and-model-problems) for proxy, headless-login, model-name, and config-key errors.
diff --git a/docs/python-sdk.md b/docs/python-sdk.md
index 0a4271db2..20b794562 100644
--- a/docs/python-sdk.md
+++ b/docs/python-sdk.md
@@ -1,16 +1,13 @@
# Nanobot Python SDK: Run an AI Agent from Python
-Use nanobot as a Python library. The SDK gives you the same agent runtime used
-by the CLI, but from code: model routing, tools, workspace access, conversation
-history, memory, streaming events, and runtime helpers.
+Use nanobot as a Python library. The SDK gives you the same agent runtime used by the CLI, but from code: model routing, tools, workspace access, conversation history, memory, streaming events, and runtime helpers.
If you have used the OpenAI SDK before, the most important difference is this:
- OpenAI SDK calls a model.
- nanobot SDK runs an agent around a model.
-That means one SDK call can read files, call tools, keep session history, use
-memory, stream progress, and return structured runtime information.
+That means one SDK call can read files, call tools, keep session history, use memory, stream progress, and return structured runtime information.
```text
your Python code
@@ -25,36 +22,27 @@ your Python code
## Before You Start
-Install and configure nanobot first. If you have not done that yet, follow the
-[Quick Start](quick-start.md) and complete the setup wizard. For SDK-only Python
-environments, install the package with:
+Install and configure nanobot first. If you have not done that yet, follow the [Quick Start](quick-start.md) and complete the setup wizard. For SDK-only Python environments, install the package with:
```bash
python -m pip install nanobot-ai
```
-`Nanobot.from_config()` reuses your normal `~/.nanobot/config.json` and
-`~/.nanobot/workspace/`. Provider, model, tools, memory, and session behavior
-match the CLI unless you override them. For the difference between config and
-workspace, see [Concepts: Config vs Workspace](concepts.md#config-vs-workspace).
+`Nanobot.from_config()` reuses your normal `~/.nanobot/config.json` and `~/.nanobot/workspace/`. Provider, model, tools, memory, and session behavior match the CLI unless you override them. For the difference between config and workspace, see [Concepts: Config vs Workspace](concepts.md#config-vs-workspace).
-Before writing SDK code, run the same first-run checks from the main
-[Install and Quick Start](quick-start.md):
+Before writing SDK code, run the same first-run checks from the main [Install and Quick Start](quick-start.md):
```bash
nanobot status
```
-`nanobot status` should show the config path, workspace path, active model or
-preset, and provider summary. Then send one real message:
+`nanobot status` should show the config path, workspace path, active model or preset, and provider summary. Then send one real message:
```bash
nanobot agent -m "Hello!"
```
-A normal assistant reply means install, config, provider/model selection, and
-workspace access are all usable. Once that works, the SDK should see the same
-runtime.
+A normal assistant reply means install, config, provider/model selection, and workspace access are all usable. Once that works, the SDK should see the same runtime.
## 5-Minute Quick Start
@@ -75,14 +63,9 @@ async def main() -> None:
asyncio.run(main())
```
-Use `async with` when possible so tool connections and background cleanup are
-closed before the event loop exits. If you manage the instance manually, call
-`await bot.aclose()` in a `finally` block.
+Use `async with` when possible so tool connections and background cleanup are closed before the event loop exits. If you manage the instance manually, call `await bot.aclose()` in a `finally` block.
-The SDK is async-first because agent runs may stream tokens, execute tools, and
-wait on external services. In a normal Python script, wrap your async function
-with `asyncio.run(...)` as shown above. In a notebook or another async app, call
-`await bot.run(...)` directly from your existing event loop.
+The SDK is async-first because agent runs may stream tokens, execute tools, and wait on external services. In a normal Python script, wrap your async function with `asyncio.run(...)` as shown above. In a notebook or another async app, call `await bot.run(...)` directly from your existing event loop.
### Inspect What Happened
@@ -99,8 +82,7 @@ print(result.stop_reason) # why the run stopped
### Continue A Conversation
-Use a `session_key` when you want history to carry across turns. Different
-session keys are isolated from each other:
+Use a `session_key` when you want history to carry across turns. Different session keys are isolated from each other:
```python
await bot.run("My name is Alice.", session_key="user:alice")
@@ -109,8 +91,7 @@ result = await bot.run("What is my name?", session_key="user:alice")
print(result.content)
```
-This is the SDK equivalent of giving each user, task, eval case, or workflow
-its own conversation thread.
+This is the SDK equivalent of giving each user, task, eval case, or workflow its own conversation thread.
### Stream A Long Answer
@@ -124,8 +105,7 @@ async for event in bot.stream("Write a migration plan"):
print(event.delta, end="", flush=True)
```
-Streaming returns structured events, so you can also observe tool calls,
-reasoning chunks, completion, and failures.
+Streaming returns structured events, so you can also observe tool calls, reasoning chunks, completion, and failures.
## Complete Starter Script
@@ -181,9 +161,7 @@ Run it:
python sdk_demo.py "List the top-level files in the current workspace."
```
-You should see the configured model, workspace path, streamed assistant text,
-and final run metadata. The exact answer depends on your config and workspace,
-but a file-listing prompt may look like this:
+You should see the configured model, workspace path, streamed assistant text, and final run metadata. The exact answer depends on your config and workspace, but a file-listing prompt may look like this:
```text
model: openai/gpt-4.1-mini
@@ -197,9 +175,7 @@ tools_used: ['list_dir']
usage: {'prompt_tokens': ..., 'completion_tokens': ..., 'total_tokens': ...}
```
-This script shows the usual production shape: create one `Nanobot`, choose a
-stable `session_key`, stream events, keep the final `RunResult`, and let
-`async with` close runtime resources.
+This script shows the usual production shape: create one `Nanobot`, choose a stable `session_key`, stream events, keep the final `RunResult`, and let `async with` close runtime resources.
## Core Concepts
@@ -231,12 +207,9 @@ nanobot has two programming surfaces:
| Python code running in the same process as nanobot | Python SDK | Direct access to `RunResult`, sessions, memory, runtime helpers, hooks, and stream events. |
| Existing OpenAI-compatible clients, another language, or a separate process | [OpenAI-Compatible API](openai-api.md) | HTTP `/v1/chat/completions` compatibility with familiar client libraries. |
-The Python SDK is best when you are writing evals, notebooks, benchmark
-runners, product backends, local scripts, or integrations that should control
-nanobot directly.
+The Python SDK is best when you are writing evals, notebooks, benchmark runners, product backends, local scripts, or integrations that should control nanobot directly.
-The OpenAI-compatible API is best when you already have an HTTP client, want
-process isolation, or need to call nanobot from a non-Python service.
+The OpenAI-compatible API is best when you already have an HTTP client, want process isolation, or need to call nanobot from a non-Python service.
## Common Patterns
@@ -251,8 +224,7 @@ async with Nanobot.from_config(workspace="/my/project") as bot:
result = await bot.run("Explain the project structure")
```
-Use a custom config when you run multiple nanobot instances or test an isolated
-setup:
+Use a custom config when you run multiple nanobot instances or test an isolated setup:
```python
async with Nanobot.from_config(
@@ -262,9 +234,7 @@ async with Nanobot.from_config(
result = await bot.run("Hello from bot A")
```
-The config controls what nanobot may use. The workspace is where nanobot keeps
-state for that instance. See [multiple-instances.md](multiple-instances.md) for
-multi-instance CLI and gateway examples.
+The config controls what nanobot may use. The workspace is where nanobot keeps state for that instance. See [multiple-instances.md](multiple-instances.md) for multi-instance CLI and gateway examples.
### Choose a default or per-run model
@@ -290,12 +260,7 @@ result = await bot.run("Think deeply about this bug", model_preset="reasoning")
`model` and `model_preset` are mutually exclusive.
-For first setup, prefer named presets in `config.json`. Mixing an API key from
-one provider with a model ID from another is the most common first-run failure.
-For the exact difference between `provider`, `model`, `apiKey`, and `apiBase`,
-see [Providers: Provider, Model, API Key, and Base URL](providers.md#provider-model-api-key-and-base-url).
-If a run fails before the SDK does anything interesting, confirm the same
-provider and model work with `nanobot agent -m "Hello!"` first.
+For first setup, prefer named presets in `config.json`. Mixing an API key from one provider with a model ID from another is the most common first-run failure. For the exact difference between `provider`, `model`, `apiKey`, and `apiBase`, see [Providers: Provider, Model, API Key, and Base URL](providers.md#provider-model-api-key-and-base-url). If a run fails before the SDK does anything interesting, confirm the same provider and model work with `nanobot agent -m "Hello!"` first.
### Isolate conversations with `session_key`
@@ -313,15 +278,11 @@ session_key = f"user:{user_id}"
result = await bot.run(user_message, session_key=session_key)
```
-Avoid using the default `"sdk:default"` for multiple users or unrelated
-workflows. It is convenient for local experiments, but stable product code
-should choose explicit keys such as `user:<id>`, `project:<id>`, or
-`eval:<case-id>`.
+Avoid using the default `"sdk:default"` for multiple users or unrelated workflows. It is convenient for local experiments, but stable product code should choose explicit keys such as `user:<id>`, `project:<id>`, or `eval:<case-id>`.
### Handle failures
-For a normal non-streamed run, catch exceptions around `bot.run(...)` and inspect
-`RunResult.error` when the runtime returns a structured failure:
+For a normal non-streamed run, catch exceptions around `bot.run(...)` and inspect `RunResult.error` when the runtime returns a structured failure:
```python
try:
@@ -347,13 +308,11 @@ finally:
await run.aclose()
```
-Use `await run.cancel()` when the user presses a stop button or leaves the page
-before the stream finishes.
+Use `await run.cancel()` when the user presses a stop button or leaves the page before the stream finishes.
### Stream long-running output
-Use `bot.stream()` when you want Cursor/OpenAI-style live events instead of
-waiting for the final `RunResult`:
+Use `bot.stream()` when you want Cursor/OpenAI-style live events instead of waiting for the final `RunResult`:
```python
from nanobot import (
@@ -385,18 +344,13 @@ async for event in run.stream_events():
result = await run.wait()
```
-Always either consume the stream, call `await run.wait()` / `await run.text()`,
-or close it with `await run.cancel()` / `await run.aclose()`. Exiting
-`stream_events()` or `bot.stream()` early cancels the underlying run so a
-half-consumed stream cannot leave a background task stuck behind backpressure.
+Always either consume the stream, call `await run.wait()` / `await run.text()`, or close it with `await run.cancel()` / `await run.aclose()`. Exiting `stream_events()` or `bot.stream()` early cancels the underlying run so a half-consumed stream cannot leave a background task stuck behind backpressure.
### Import an existing transcript
This is useful for evals, benchmark runners, migrations, and tests.
-Use `bot.sessions.ingest()` when you already have a transcript and want it to
-become nanobot session history. Ingesting a transcript does not call the model,
-execute tools, update memory, or compact automatically.
+Use `bot.sessions.ingest()` when you already have a transcript and want it to become nanobot session history. Ingesting a transcript does not call the model, execute tools, update memory, or compact automatically.
```python
await bot.sessions.ingest(
@@ -429,8 +383,7 @@ print(result.content)
### Attach hooks for observability
-Hooks are an advanced escape hatch. Use them when you want custom logging,
-metrics, tracing, or output post-processing without modifying nanobot internals:
+Hooks are an advanced escape hatch. Use them when you want custom logging, metrics, tracing, or output post-processing without modifying nanobot internals:
```python
from nanobot.agent import AgentHook, AgentHookContext
@@ -447,8 +400,7 @@ result = await bot.run("Review this change", hooks=[AuditHook()])
## Where To Go Next
-The SDK page is the programming entry point. The fuller conceptual and
-configuration docs remain the source of truth for the runtime around it:
+The SDK page is the programming entry point. The fuller conceptual and configuration docs remain the source of truth for the runtime around it:
| Need | Read |
|------|------|
@@ -474,8 +426,7 @@ Create a `Nanobot` instance from a config file.
| `model` | `str \| None` | `None` | Override the instance default model. |
| `model_preset` | `str \| None` | `None` | Override the instance default model preset from `config.json`. |
-Raises `FileNotFoundError` if an explicit config path does not exist.
-Raises `ValueError` if both `model` and `model_preset` are provided.
+Raises `FileNotFoundError` if an explicit config path does not exist. Raises `ValueError` if both `model` and `model_preset` are provided.
### `await bot.run(...)`
@@ -495,15 +446,11 @@ Run the agent once and return a `RunResult`.
| `model` | `str \| None` | `None` | Override the model for this run only. |
| `model_preset` | `str \| None` | `None` | Override the model preset for this run only. |
-Without an override, a run uses the preset saved in its session, or the configured
-default when that session has no saved selection. `model` and `model_preset` are
-mutually exclusive per-run overrides; they do not change the saved session selection
-or `bot.runtime.model` after the run completes.
+Without an override, a run uses the preset saved in its session, or the configured default when that session has no saved selection. `model` and `model_preset` are mutually exclusive per-run overrides; they do not change the saved session selection or `bot.runtime.model` after the run completes.
### `await bot.run_streamed(...)`
-Start a streamed agent turn and return a `RunStream`. It accepts the same
-parameters as `bot.run(...)`.
+Start a streamed agent turn and return a `RunStream`. It accepts the same parameters as `bot.run(...)`.
```python
run = await bot.run_streamed("Generate a long answer")
@@ -516,8 +463,7 @@ result = await run.wait()
### `bot.stream(...)`
-Convenience wrapper around `run_streamed()` for direct event iteration. It
-accepts the same parameters as `bot.run(...)`.
+Convenience wrapper around `run_streamed()` for direct event iteration. It accepts the same parameters as `bot.run(...)`.
```python
async for event in bot.stream("Generate a long answer"):
@@ -534,9 +480,7 @@ async for event in bot.stream("Generate a long answer"):
| `await cancel()` | Cancel the run and release stream resources. |
| `await aclose()` | Close the stream; equivalent cleanup primitive for `async with` / manual lifecycle code. |
-SDK runs with different session keys may overlap, including runs with per-run
-`model` or `model_preset` overrides. Each run receives an immutable runtime without
-mutating the instance default. Runs sharing one session key remain serialized.
+SDK runs with different session keys may overlap, including runs with per-run `model` or `model_preset` overrides. Each run receives an immutable runtime without mutating the instance default. Runs sharing one session key remain serialized.
### `StreamEvent`
@@ -608,14 +552,9 @@ async with Nanobot.from_config() as bot:
| `delete(session_key)` | Delete one session from disk and cache. |
| `flush()` | Flush cached sessions to durable storage. |
-Ingested messages must include `role` and `content`. Roles may be `user`,
-`assistant`, `tool`, or `system`. Other fields, such as `timestamp`,
-`source_session_id`, or `source_date`, are persisted as message metadata.
+Ingested messages must include `role` and `content`. Roles may be `user`, `assistant`, `tool`, or `system`. Other fields, such as `timestamp`, `source_session_id`, or `source_date`, are persisted as message metadata.
-`get()` and snapshots returned by ordinary SDK operations are display-safe and omit
-model-only runtime context. `export()` is an explicit backup boundary and includes
-that internal context so `restore()` can preserve the exact model-visible history.
-Do not expose exported snapshots directly to chat users.
+`get()` and snapshots returned by ordinary SDK operations are display-safe and omit model-only runtime context. `export()` is an explicit backup boundary and includes that internal context so `restore()` can preserve the exact model-visible history. Do not expose exported snapshots directly to chat users.
### `bot.memory`
@@ -639,21 +578,9 @@ Do not expose exported snapshots directly to chat users.
### Host integration context and persisted-turn callbacks
-Host applications can attach external context without copying or modifying the
-nanobot agent loop. A context provider receives a `RequestContext` before each
-model turn and may return one or more `RuntimeContextBlock` values. Use
-`attributes` for caller-owned routing data; nanobot keeps it separate from
-trusted channel metadata and does not persist it in session messages.
-
-`on_session_turn_persisted()` invokes its callback after a non-ephemeral turn
-has been saved. The callback receives `SessionTurnPersisted` and may read the
-completed transcript through `bot.sessions`. Callbacks run in registration
-order, and async callbacks are awaited before the run continues. They are
-observational: callback exceptions are logged and suppressed so the completed
-local turn remains successful. Durable external synchronization must catch
-failures and persist retry work before the callback returns. During SDK runs,
-callbacks execute while the session is still serialized and must not re-enter
-`bot.run()` for the same session.
+Host applications can attach external context without copying or modifying the nanobot agent loop. A context provider receives a `RequestContext` before each model turn and may return one or more `RuntimeContextBlock` values. Use `attributes` for caller-owned routing data; nanobot keeps it separate from trusted channel metadata and does not persist it in session messages.
+
+`on_session_turn_persisted()` invokes its callback after a non-ephemeral turn has been saved. The callback receives `SessionTurnPersisted` and may read the completed transcript through `bot.sessions`. Callbacks run in registration order, and async callbacks are awaited before the run continues. They are observational: callback exceptions are logged and suppressed so the completed local turn remains successful. Durable external synchronization must catch failures and persist retry work before the callback returns. During SDK runs, callbacks execute while the session is still serialized and must not re-enter `bot.run()` for the same session.
```python
import json
@@ -717,10 +644,7 @@ async def run_with_external_memory(external_memory, enqueue_retry) -> None:
remove_context()
```
-Context providers are trusted host extensions, and `RuntimeContextBlock.content`
-is appended verbatim to model-visible context. Apply equivalent bounding,
-encoding, and delimiter escaping to untrusted external content.
-Persisted-turn callbacks are not invoked for `ephemeral=True` runs.
+Context providers are trusted host extensions, and `RuntimeContextBlock.content` is appended verbatim to model-visible context. Apply equivalent bounding, encoding, and delimiter escaping to untrusted external content. Persisted-turn callbacks are not invoked for `ephemeral=True` runs.
## Hooks
diff --git a/docs/quick-start.md b/docs/quick-start.md
index 0f6a3e7b9..e16e525bd 100644
--- a/docs/quick-start.md
+++ b/docs/quick-start.md
@@ -112,11 +112,7 @@ Then start an interactive terminal chat with:
nanobot
```
-In interactive mode, `Enter` sends and `Shift+Enter` inserts a newline (`Ctrl+J` is the
-universal fallback). While nanobot is working, `Enter` sends immediately, `Tab` waits until the
-current response is finished, and `Option+Up` on macOS (`Alt+Up` on Windows/Linux) edits the
-latest waiting message. Exit
-with `exit`, `/exit`, `:q`, or `Ctrl+D`.
+In interactive mode, `Enter` sends and `Shift+Enter` inserts a newline (`Ctrl+J` is the universal fallback). While nanobot is working, `Enter` sends immediately, `Tab` waits until the current response is finished, and `Option+Up` on macOS (`Alt+Up` on Windows/Linux) edits the latest waiting message. Exit with `exit`, `/exit`, `:q`, or `Ctrl+D`.
## Choose One Next Step
@@ -155,8 +151,7 @@ If pip reports `externally-managed-environment`, use the recommended installer,
**Current source**
-Clone the repository and install it in editable mode. Bun is required so the checkout can run
-its matching native TUI instead of mixing current Python with an older release binary.
+Clone the repository and install it in editable mode. Bun is required so the checkout can run its matching native TUI instead of mixing current Python with an older release binary.
```bash
git clone https://github.com/HKUDS/nanobot.git
@@ -164,19 +159,14 @@ cd nanobot
python -m venv .venv
```
-Activate it with `source .venv/bin/activate` on macOS/Linux or
-`.venv\Scripts\Activate.ps1` in Windows PowerShell, then run:
+Activate it with `source .venv/bin/activate` on macOS/Linux or `.venv\Scripts\Activate.ps1` in Windows PowerShell, then run:
```bash
python -m pip install -e .
nanobot webui
```
-The source path follows current `main` and can be newer than the published package. The editable
-install keeps Python pointed at the checkout; `nanobot` runs `tui/` with Bun, and
-`nanobot webui` automatically rebuilds `webui/` when its bundled assets are stale. All normal
-commands remain the same as a stable install. For development details, follow
-[`../CONTRIBUTING.md`](../CONTRIBUTING.md).
+The source path follows current `main` and can be newer than the published package. The editable install keeps Python pointed at the checkout; `nanobot` runs `tui/` with Bun, and `nanobot webui` automatically rebuilds `webui/` when its bundled assets are stale. All normal commands remain the same as a stable install. For development details, follow [`../CONTRIBUTING.md`](../CONTRIBUTING.md).
If the package is installed but the shell cannot find `nanobot`, use the runner that owns the installation. The recommended installer prints the exact command to reuse. Common forms are:
@@ -239,11 +229,7 @@ git pull --ff-only
python -m pip install -e .
```
-Because the install is editable, normal source changes are visible immediately. Re-running the
-install synchronizes any changed Python dependencies; the TUI and WebUI refresh their own
-dependencies/assets when launched. Then check `nanobot --version`. Run
-`nanobot onboard --refresh` when you want to add newly introduced default fields while preserving
-existing settings.
+Because the install is editable, normal source changes are visible immediately. Re-running the install synchronizes any changed Python dependencies; the TUI and WebUI refresh their own dependencies/assets when launched. Then check `nanobot --version`. Run `nanobot onboard --refresh` when you want to add newly introduced default fields while preserving existing settings.
## If the First Reply Fails
diff --git a/docs/releasing.md b/docs/releasing.md
index feb616ccd..7be416529 100644
--- a/docs/releasing.md
+++ b/docs/releasing.md
@@ -1,68 +1,29 @@
# Release checklist
-Use this checklist with the [Release Packaging Contract](../CONTRIBUTING.md#release-packaging-contract).
-Preparing a release does not publish it. Pushing a Git tag, publishing a GitHub Release,
-uploading to PyPI, and deploying the documentation are separate operations.
+Use this checklist with the [Release Packaging Contract](../CONTRIBUTING.md#release-packaging-contract). Preparing a release does not publish it. Pushing a Git tag, publishing a GitHub Release, uploading to PyPI, and deploying the documentation are separate operations.
## Prepare a candidate
-1. Choose the previous release and the exact candidate commit. Work in a clean worktree;
- do not include local configuration, session data, credentials, or unrelated changes.
-2. Update `project.version` in `pyproject.toml` and the final source-only fallback in
- `nanobot/__init__.py`. Private WebUI/TUI package versions are not the Python release version.
-3. Review the changes since the previous tag. Write highlights, upgrade and rollback guidance,
- contributor acknowledgements, and the full changelog. Verify counts against the final
- range; commit counts are not merged-PR counts. Coordinate security disclosures separately.
-4. Run the Python, WebUI, and TUI checks from CI. Confirm the final commit's CI status, not
- just an earlier PR head. Review installation, configuration, session, and API changes.
-5. Build in a clean output directory with `uv build --out-dir <artifact-directory>`.
- Do not set `NANOBOT_SKIP_WEBUI_BUILD`. The build hook bundles the WebUI in the sdist and
- wheel; the wheel is built from the sdist.
-6. Check the intermediate distributions with `twine check`, inspect their contents, and record SHA-256
- hashes. Test installation in an isolated environment outside the source checkout, then
- test upgrading from the previous stable version using disposable configuration and sessions.
- Do not use a maintainer's live workspace for migration tests.
-7. Prepare the matching documentation PR in `Re-bin/nanobot-web`, following its
- `MAINTAINING.md`. Review English and all nine translations, preserve Nightly and previous
- releases, update the latest-version redirects, and run the complete site quality gate.
- Pin source links to the checked candidate commit; confirm those source files match the
- eventual tag before deploying. Never advertise an unpublished version as publicly available.
-8. Review the pinned Bun/OpenTUI licenses, corresponding-source materials, and relinking
- instructions now, not after pushing the tag. Verify the exact upstream revisions are
- retrievable and the runtime versions match the lockfile and notices. Obtain the maintainer's
- commitment to honor `tui/SOURCE_OFFER.md` for its entire stated period; tests cannot grant it.
-9. Build all five native TUI targets using the same scripts as the publication workflow.
- Include ad-hoc signatures for macOS before packaging. Verify every archive's checksum,
- manifest, executable architecture, required notices/licenses, and embedded source contents.
- Run platform-specific smoke tests where supported; record cross-compiled-only targets as
- such and link exact-head CI evidence instead of claiming native execution everywhere.
- Bundle these archives into the five platform wheels using the command below. Check all final
- wheels with `twine check`, validate their RECORDs, tags and installed executable permissions,
- and test first launch with an empty cache and `NANOBOT_TUI_NO_DOWNLOAD=1`. The installed
- executable must come from `site-packages/nanobot/tui/bin/`, not the checkout or a cache.
-10. Merge the release-preparation PR only after its current checks and reviews pass. Confirm the
- merged source tree matches the tested candidate; if it does not, rebuild and recheck before
- tagging. Reconcile the final changelog and documentation source references. The tag must
- point to this verified commit, not an unchecked later `main` tip.
+1. Choose the previous release and the exact candidate commit. Work in a clean worktree; do not include local configuration, session data, credentials, or unrelated changes.
+2. Update `project.version` in `pyproject.toml` and the final source-only fallback in `nanobot/__init__.py`. Private WebUI/TUI package versions are not the Python release version.
+3. Review the changes since the previous tag. Write highlights, upgrade and rollback guidance, contributor acknowledgements, and the full changelog. Verify counts against the final range; commit counts are not merged-PR counts. Coordinate security disclosures separately.
+4. Run the Python, WebUI, and TUI checks from CI. Confirm the final commit's CI status, not just an earlier PR head. Review installation, configuration, session, and API changes.
+5. Build in a clean output directory with `uv build --out-dir <artifact-directory>`. Do not set `NANOBOT_SKIP_WEBUI_BUILD`. The build hook bundles the WebUI in the sdist and wheel; the wheel is built from the sdist.
+6. Check the intermediate distributions with `twine check`, inspect their contents, and record SHA-256 hashes. Test installation in an isolated environment outside the source checkout, then test upgrading from the previous stable version using disposable configuration and sessions. Do not use a maintainer's live workspace for migration tests.
+7. Prepare the matching documentation PR in `Re-bin/nanobot-web`, following its `MAINTAINING.md`. Review English and all nine translations, preserve Nightly and previous releases, update the latest-version redirects, and run the complete site quality gate. Pin source links to the checked candidate commit; confirm those source files match the eventual tag before deploying. Never advertise an unpublished version as publicly available.
+8. Review the pinned Bun/OpenTUI licenses, corresponding-source materials, and relinking instructions now, not after pushing the tag. Verify the exact upstream revisions are retrievable and the runtime versions match the lockfile and notices. Obtain the maintainer's commitment to honor `tui/SOURCE_OFFER.md` for its entire stated period; tests cannot grant it.
+9. Build all five native TUI targets using the same scripts as the publication workflow. Include ad-hoc signatures for macOS before packaging. Verify every archive's checksum, manifest, executable architecture, required notices/licenses, and embedded source contents. Run platform-specific smoke tests where supported; record cross-compiled-only targets as such and link exact-head CI evidence instead of claiming native execution everywhere. Bundle these archives into the five platform wheels using the command below. Check all final wheels with `twine check`, validate their RECORDs, tags and installed executable permissions, and test first launch with an empty cache and `NANOBOT_TUI_NO_DOWNLOAD=1`. The installed executable must come from `site-packages/nanobot/tui/bin/`, not the checkout or a cache.
+10. Merge the release-preparation PR only after its current checks and reviews pass. Confirm the merged source tree matches the tested candidate; if it does not, rebuild and recheck before tagging. Reconcile the final changelog and documentation source references. The tag must point to this verified commit, not an unchecked later `main` tip.
### OpenAI API selector compatibility window
-The temporary `providers.openai.apiType` / `api_type` conversion is supported for exactly
-two consecutive releases: the first release containing `nanobot/config/provider_api_migration.py`
-and the next release. Record the first release tag and the final supported tag in release notes.
-Config saves write the new `api` declaration; there is no legacy runtime selector.
+The temporary `providers.openai.apiType` / `api_type` conversion is supported for exactly two consecutive releases: the first release containing `nanobot/config/provider_api_migration.py` and the next release. Record the first release tag and the final supported tag in release notes. Config saves write the new `api` declaration; there is no legacy runtime selector.
-Before publishing the third release, remove `provider_api_migration.py`, its import and
-`ProvidersConfig._migrate_legacy_api_type`, and the legacy settings query conversion in
-`nanobot/webui/settings_models.py`. Remove the migration-specific tests and update the
-configuration documentation and release notes to require the current format. Keep the
-current-format routing, settings, and persistence regressions.
+Before publishing the third release, remove `provider_api_migration.py`, its import and `ProvidersConfig._migrate_legacy_api_type`, and the legacy settings query conversion in `nanobot/webui/settings_models.py`. Remove the migration-specific tests and update the configuration documentation and release notes to require the current format. Keep the current-format routing, settings, and persistence regressions.
### TUI preflight without a release tag
-Use Bun 1.3.13 and a clean checkout. The local build and packaging scripts do not require a
-tag or GitHub Release. Run targets sequentially because native dependency preparation modifies
-the shared `node_modules` directory:
+Use Bun 1.3.13 and a clean checkout. The local build and packaging scripts do not require a tag or GitHub Release. Run targets sequentially because native dependency preparation modifies the shared `node_modules` directory:
```bash
cd tui
@@ -74,11 +35,7 @@ bun scripts/release-notices.ts <target>
python3 scripts/package-release.py <target>
```
-Repeat for `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64`, and `win32-x64`.
-On macOS, use `codesign --force --sign - <binary>` and verify the signature. The publication
-workflow uses pinned `rcodesign` on Linux. Keep the ten `.zip`/`.zip.sha256` outputs in a
-candidate-specific directory, alongside the Python build intermediates and provenance manifest.
-Do not include local configuration, instance backups, or test environments in upload selections.
+Repeat for `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64`, and `win32-x64`. On macOS, use `codesign --force --sign - <binary>` and verify the signature. The publication workflow uses pinned `rcodesign` on Linux. Keep the ten `.zip`/`.zip.sha256` outputs in a candidate-specific directory, alongside the Python build intermediates and provenance manifest. Do not include local configuration, instance backups, or test environments in upload selections.
### Build the PyPI platform wheels
@@ -91,52 +48,23 @@ uv run python -m scripts.build_tui_wheels \
--out-dir <final-wheels>
```
-The script verifies the Python version and RECORD, native checksums, architecture, notices and
-embedded source against the checkout, then writes five wheels with complete TUI bundles and
-regenerated RECORDs. It refuses to overwrite an existing candidate. `--target <target>` builds
-one platform for a targeted check. Minimum tags are macOS 13, manylinux glibc 2.17 and Windows
-x64; x64 builds use Bun's baseline (SSE4.2) runtime instead of requiring AVX2. Recheck both Bun
-and OpenTUI when upgrading either dependency. No musl or Windows ARM64
-wheel is provided. Native execution checks must still validate the actual binaries; tags alone
-do not prove compatibility. Test pip selection for all five supported platforms.
+The script verifies the Python version and RECORD, native checksums, architecture, notices and embedded source against the checkout, then writes five wheels with complete TUI bundles and regenerated RECORDs. It refuses to overwrite an existing candidate. `--target <target>` builds one platform for a targeted check. Minimum tags are macOS 13, manylinux glibc 2.17 and Windows x64; x64 builds use Bun's baseline (SSE4.2) runtime instead of requiring AVX2. Recheck both Bun and OpenTUI when upgrading either dependency. No musl or Windows ARM64 wheel is provided. Native execution checks must still validate the actual binaries; tags alone do not prove compatibility. Test pip selection for all five supported platforms.
-The final PyPI upload set is **five platform wheels plus one source distribution**. Do not upload
-the intermediate `py3-none-any.whl` or native ZIPs to PyPI. Keep the source distribution produced
-by the same build; it remains usable for Python/classic and WebUI installations on other platforms.
+The final PyPI upload set is **five platform wheels plus one source distribution**. Do not upload the intermediate `py3-none-any.whl` or native ZIPs to PyPI. Keep the source distribution produced by the same build; it remains usable for Python/classic and WebUI installations on other platforms.
-Keep an artifact manifest with the source commit, version, filenames, hashes, checks performed,
-and any remaining release gates. Rebuild and recheck if the packaged source changes.
+Keep an artifact manifest with the source commit, version, filenames, hashes, checks performed, and any remaining release gates. Rebuild and recheck if the packaged source changes.
## Publish, with maintainer approval
-1. Confirm all pre-tag gates above are complete. Create and push exactly
- `vX.Y.Z`; do not move or reuse a published version tag.
-2. Create the matching GitHub Release. A draft may be used while assembling its attachments.
- Pushing the tag alone does not run `Publish Terminal UI` or upload anything to PyPI.
-3. Attach the already verified five TUI archives and their `.sha256` files, after confirming
- the tag's packaged sources match the artifact manifest. Verify the uploaded bytes match
- their preflight hashes; never upload a naked executable.
-4. If instead rebuilding through **Publish Terminal UI**, use `tag=vX.Y.Z` and confirm the
- already completed compliance review. Wait for all five targets and repeat artifact checks
- on those new outputs. Do not substitute their new bytes under the old artifact hashes.
-5. Make the GitHub Release and all TUI attachments publicly available. Verify their public
- downloads for fallback/source-built installations. Supported platform-wheel installs do not
- need these downloads to start the TUI.
-6. Upload only the checked `nanobot_ai-X.Y.Z.tar.gz` and the five final platform wheels
- to PyPI. Do not upload the intermediate universal wheel or stale files from a shared `dist/` directory. This repository has no
- automatic PyPI publication workflow.
-7. Verify installation from PyPI, bundled WebUI startup, and bundled TUI startup without downloads in
- clean environments. Merge the prepared wiki PR only when the stable package is available:
- merging its `main` deploys the site automatically. Confirm all localized `/docs/latest/`
- routes select the new version and old version links still work.
-8. Publish the release announcement and add the dated entry to
- [Release Archive](./release-archive.md). Complete any coordinated advisory publication and
- reporter notification. Record links and completion status in the release tracking issue.
+1. Confirm all pre-tag gates above are complete. Create and push exactly `vX.Y.Z`; do not move or reuse a published version tag.
+2. Create the matching GitHub Release. A draft may be used while assembling its attachments. Pushing the tag alone does not run `Publish Terminal UI` or upload anything to PyPI.
+3. Attach the already verified five TUI archives and their `.sha256` files, after confirming the tag's packaged sources match the artifact manifest. Verify the uploaded bytes match their preflight hashes; never upload a naked executable.
+4. If instead rebuilding through **Publish Terminal UI**, use `tag=vX.Y.Z` and confirm the already completed compliance review. Wait for all five targets and repeat artifact checks on those new outputs. Do not substitute their new bytes under the old artifact hashes.
+5. Make the GitHub Release and all TUI attachments publicly available. Verify their public downloads for fallback/source-built installations. Supported platform-wheel installs do not need these downloads to start the TUI.
+6. Upload only the checked `nanobot_ai-X.Y.Z.tar.gz` and the five final platform wheels to PyPI. Do not upload the intermediate universal wheel or stale files from a shared `dist/` directory. This repository has no automatic PyPI publication workflow.
+7. Verify installation from PyPI, bundled WebUI startup, and bundled TUI startup without downloads in clean environments. Merge the prepared wiki PR only when the stable package is available: merging its `main` deploys the site automatically. Confirm all localized `/docs/latest/` routes select the new version and old version links still work.
+8. Publish the release announcement and add the dated entry to [Release Archive](./release-archive.md). Complete any coordinated advisory publication and reporter notification. Record links and completion status in the release tracking issue.
## If a gate fails
-Do not publish to PyPI while a required TUI artifact or verification is missing. Keep the
-documentation's public `latest` on the previous stable version until the new version is usable.
-If a published package needs a correction, prepare a new version; do not silently replace
-the code behind an existing release tag. Stop all old processes and follow the documented
-session rollback procedure before downgrading a migrated installation.
+Do not publish to PyPI while a required TUI artifact or verification is missing. Keep the documentation's public `latest` on the previous stable version until the new version is usable. If a published package needs a correction, prepare a new version; do not silently replace the code behind an existing release tag. Stop all old processes and follow the documented session rollback procedure before downgrading a migrated installation.
diff --git a/docs/websocket.md b/docs/websocket.md
index 5319b36fe..ce5de191e 100644
--- a/docs/websocket.md
+++ b/docs/websocket.md
@@ -16,8 +16,7 @@ Nanobot can act as a WebSocket server, allowing external clients (web apps, CLIs
### 1. Configure
-The WebSocket channel is enabled by default. Add only the fields you want to
-override under `channels.websocket`:
+The WebSocket channel is enabled by default. Add only the fields you want to override under `channels.websocket`:
```json
{
@@ -152,8 +151,7 @@ All frames are JSON text. Each message has an `event` field.
Reasoning frames only flow when the channel's `showReasoning` is `true` (default) and the model returns reasoning content (DeepSeek-R1 / Kimi / MiMo / OpenAI reasoning models, Anthropic extended thinking, or inline `<think>` / `<thought>` tags). Models without reasoning produce zero `reasoning_delta` frames.
-**`runtime_model_updated`** — broadcast when the gateway default runtime changes or
-when a config reload requires clients to refresh their model catalog:
+**`runtime_model_updated`** — broadcast when the gateway default runtime changes or when a config reload requires clients to refresh their model catalog:
```json
{
@@ -163,10 +161,7 @@ when a config reload requires clients to refresh their model catalog:
}
```
-`model_preset` is omitted when no named preset is active. WebUI clients use this event
-to refresh model settings after default-runtime and config changes. `/model <preset>`
-is session-scoped; its selection is reflected through `session_updated` and the
-session row's `model_preset` field instead of this global event.
+`model_preset` is omitted when no named preset is active. WebUI clients use this event to refresh model settings after default-runtime and config changes. `/model <preset>` is session-scoped; its selection is reflected through `session_updated` and the session row's `model_preset` field instead of this global event.
**`attached`** — confirmation for `new_chat` / `attach` inbound envelopes (see [Multi-chat multiplexing](#multi-chat-multiplexing)):
@@ -206,54 +201,28 @@ See [Multi-chat multiplexing](#multi-chat-multiplexing) for the full flow.
### Binary attachments (WebUI and TUI)
-The gateway advertises `webui.attachments.binary.v1`. WebUI protocol 1 and the
-terminal protocol are unchanged. Bundled clients and their gateway use HTTP on
-the same listener for attachment uploads. After an authorized handshake, `ready`
-includes an `upload` object with `path: "/api/attachments"` and an opaque `token`.
-This token is a short-lived capability tied to that live connection, not the
-one-time handshake token, API token, or client-selected `client_id`.
+The gateway advertises `webui.attachments.binary.v1`. WebUI protocol 1 and the terminal protocol are unchanged. Bundled clients and their gateway use HTTP on the same listener for attachment uploads. After an authorized handshake, `ready` includes an `upload` object with `path: "/api/attachments"` and an opaque `token`. This token is a short-lived capability tied to that live connection, not the one-time handshake token, API token, or client-selected `client_id`.
-1. `POST` the raw file bytes to the advertised path with `Authorization: Bearer
- <upload token>`, the file's `Content-Type`, and an exact `Content-Length`.
- `X-Attachment-Name` may contain a percent-encoded display filename.
- Compressed request bodies and chunked transfer encoding are rejected.
-2. The response is `201 {"reference": "<opaque reference>"}`. Use it in a small
- WebSocket envelope, for example:
+1. `POST` the raw file bytes to the advertised path with `Authorization: Bearer <upload token>`, the file's `Content-Type`, and an exact `Content-Length`. `X-Attachment-Name` may contain a percent-encoded display filename. Compressed request bodies and chunked transfer encoding are rejected.
+2. The response is `201 {"reference": "<opaque reference>"}`. Use it in a small WebSocket envelope, for example:
```json
{"type":"message","chat_id":"chat-id","content":"Inspect this","webui":true,"turn_id":"unique-turn-id","media":[{"reference":"opaque-reference","name":"report.pdf"}]}
```
-3. Retain the draft and local preview until `message_accepted` confirms the turn.
- A connection close before confirmation means delivery is uncertain, not that
- the draft should be discarded. Reconnect obtains a new upload capability;
- old uncommitted references cannot be used by the new connection. A repeated
- accepted `(chat_id, turn_id)` is acknowledged without another dispatch within
- the gateway's bounded ten-minute in-memory retry window.
+3. Retain the draft and local preview until `message_accepted` confirms the turn. A connection close before confirmation means delivery is uncertain, not that the draft should be discarded. Reconnect obtains a new upload capability; old uncommitted references cannot be used by the new connection. A repeated accepted `(chat_id, turn_id)` is acknowledged without another dispatch within the gateway's bounded ten-minute in-memory retry window.
-The upload path accepts the existing image, document, and video MIME whitelist.
-Existing file/count/total limits still apply independently of `maxMessageBytes`.
-Uploads time out after five minutes, or after 30 seconds without receiving more
-data. Uploads are not resumable, so a retry sends the whole file.
+The upload path accepts the existing image, document, and video MIME whitelist. Existing file/count/total limits still apply independently of `maxMessageBytes`. Uploads time out after five minutes, or after 30 seconds without receiving more data. Uploads are not resumable, so a retry sends the whole file.
-Update WebUI and TUI together with the gateway. Existing messages and attachments
-remain available without a history migration. Clients must use HTTP uploads;
-`media.data_url` message uploads are no longer accepted. Local previews and the
-separate audio transcription protocol are unchanged.
+Update WebUI and TUI together with the gateway. Existing messages and attachments remain available without a history migration. Clients must use HTTP uploads; `media.data_url` message uploads are no longer accepted. Local previews and the separate audio transcription protocol are unchanged.
-Reverse proxies must forward `POST /api/attachments` (including its authorization
-header) to the gateway and permit the configured file sizes. Do not enable public
-CORS for this capability endpoint.
+Reverse proxies must forward `POST /api/attachments` (including its authorization header) to the gateway and permit the configured file sizes. Do not enable public CORS for this capability endpoint.
-For a remote host opened through the local WebUI, update the local installation
-and the remote gateway together to use binary attachments. An older host's text
-chats and HTTP reads remain available.
+For a remote host opened through the local WebUI, update the local installation and the remote gateway together to use binary attachments. An older host's text chats and HTTP reads remain available.
## Configuration Reference
-All fields go under `channels.websocket` in `config.json`.
-Unrecognized options retain the existing behavior: they are ignored without
-preventing startup. Active options below remain validated.
+All fields go under `channels.websocket` in `config.json`. Unrecognized options retain the existing behavior: they are ignored without preventing startup. Active options below remain validated.
### Connection
@@ -321,37 +290,17 @@ For production deployments where `websocketRequiresToken: true`, use short-lived
3. Client opens WebSocket with `?token=nbwt_aBcDeFg...&client_id=...`.
4. The token is consumed (single use) and cannot be reused.
-The embedded WebUI's `/webui/bootstrap` route returns a WebSocket token and
-REST `api_token` for local or secret-authenticated requests. When
-`trustedProxyAuth` authenticates the direct proxy peer, it returns connection
-metadata only: no bootstrap token, no REST API token, and no token query
-parameter is required for the WebSocket handshake or subsequent REST requests.
+The embedded WebUI's `/webui/bootstrap` route returns a WebSocket token and REST `api_token` for local or secret-authenticated requests. When `trustedProxyAuth` authenticates the direct proxy peer, it returns connection metadata only: no bootstrap token, no REST API token, and no token query parameter is required for the WebSocket handshake or subsequent REST requests.
### Trusted proxy no-token bootstrap
-`trustedProxyAuth` is an opt-in alternative for deployments where an
-identity-aware reverse proxy authenticates the user before connecting to nanobot.
-The proxy assertion becomes the authentication boundary for the entire WebUI
-surface: `/webui/bootstrap`, the WebSocket handshake, and REST API routes.
-Bootstrap is accepted only when **both** the direct TCP peer matches one of
-`trustedPeerCidrs` and the configured assertion header is present and non-empty.
-A trusted address by itself is never sufficient.
-
-Nanobot deliberately uses only `connection.remote_address` for the peer check.
-It never uses `X-Forwarded-For`, `Forwarded`, `X-Real-IP`, `CF-Connecting-IP`,
-or `X-Forwarded-Host` to decide whether the proxy is trusted. Nanobot trusts the
-assertion supplied by the explicitly trusted peer, but does not cryptographically
-validate or interpret the JWT/assertion contents. Do not enable this option if
-untrusted clients can connect directly to the nanobot listener.
-
-The configured assertion header must be a proxy-generated authentication
-assertion, not a routing or client metadata header. Headers such as `Host`,
-`Forwarded`, `X-Forwarded-*`, `X-Real-IP`, and `CF-Connecting-IP` are rejected
-by configuration; use the identity provider's post-authentication assertion
-header instead (for example, `Cf-Access-Jwt-Assertion`).
-
-For example, a local Cloudflare Tunnel with Cloudflare Access can validate the
-user at the edge and forward the resulting `Cf-Access-Jwt-Assertion`:
+`trustedProxyAuth` is an opt-in alternative for deployments where an identity-aware reverse proxy authenticates the user before connecting to nanobot. The proxy assertion becomes the authentication boundary for the entire WebUI surface: `/webui/bootstrap`, the WebSocket handshake, and REST API routes. Bootstrap is accepted only when **both** the direct TCP peer matches one of `trustedPeerCidrs` and the configured assertion header is present and non-empty. A trusted address by itself is never sufficient.
+
+Nanobot deliberately uses only `connection.remote_address` for the peer check. It never uses `X-Forwarded-For`, `Forwarded`, `X-Real-IP`, `CF-Connecting-IP`, or `X-Forwarded-Host` to decide whether the proxy is trusted. Nanobot trusts the assertion supplied by the explicitly trusted peer, but does not cryptographically validate or interpret the JWT/assertion contents. Do not enable this option if untrusted clients can connect directly to the nanobot listener.
+
+The configured assertion header must be a proxy-generated authentication assertion, not a routing or client metadata header. Headers such as `Host`, `Forwarded`, `X-Forwarded-*`, `X-Real-IP`, and `CF-Connecting-IP` are rejected by configuration; use the identity provider's post-authentication assertion header instead (for example, `Cf-Access-Jwt-Assertion`).
+
+For example, a local Cloudflare Tunnel with Cloudflare Access can validate the user at the edge and forward the resulting `Cf-Access-Jwt-Assertion`:
```json
{
@@ -368,10 +317,7 @@ user at the edge and forward the resulting `Cf-Access-Jwt-Assertion`:
}
```
-This works only when the directly connected `cloudflared` process reaches
-nanobot over the configured loopback address and supplies a non-empty assertion.
-Keep nanobot firewalled from untrusted clients; this configuration is not a
-CIDR-based bootstrap bypass.
+This works only when the directly connected `cloudflared` process reaches nanobot over the configured loopback address and supplies a non-empty assertion. Keep nanobot firewalled from untrusted clients; this configuration is not a CIDR-based bootstrap bypass.
### Example setup
diff --git a/docs/webui.md b/docs/webui.md
index 81a2177da..a2f2a4833 100644
--- a/docs/webui.md
+++ b/docs/webui.md
@@ -2,17 +2,11 @@
<!-- Meta description: Run nanobot from a browser WebUI with persistent and temporary chats, visible tool activity, workspace controls, Apps, skill discovery, settings, and Automations. -->
-The WebUI is nanobot's browser workbench for persistent topics, grouped
-conversation panes, temporary chats, visible agent activity, workspace controls,
-Apps, skill discovery, settings, and Automations in one place. It shares the
-gateway and saved sessions with the native terminal client.
+The WebUI is nanobot's browser workbench for persistent topics, grouped conversation panes, temporary chats, visible agent activity, workspace controls, Apps, skill discovery, settings, and Automations in one place. It shares the gateway and saved sessions with the native terminal client.
-For a visual tour, see the [README feature gallery](../README.md#-webui).
-This guide follows the current source tree; some features are newer than the
-published release.
+For a visual tour, see the [README feature gallery](../README.md#-webui). This guide follows the current source tree; some features are newer than the published release.
-The published `nanobot-ai` wheel already includes the WebUI bundle. You only need
-the `webui/` source directory when you are changing the frontend itself.
+The published `nanobot-ai` wheel already includes the WebUI bundle. You only need the `webui/` source directory when you are changing the frontend itself.
## Open the WebUI
@@ -22,15 +16,7 @@ Use the launcher:
nanobot webui
```
-`nanobot webui` creates the config/workspace when needed, enables the local
-WebSocket channel after confirmation, generates a WebUI bootstrap secret when
-one is missing, starts or joins the same on-demand gateway used by the native
-TUI, and opens the browser. With a fresh config,
-it can open before a model is configured so you can finish setup in **Settings
-→ Models**. The first-run path binds the WebUI to `127.0.0.1` by default, so
-it is not available from other devices on your LAN. While the launcher remains
-attached, it mirrors new log output from that exact gateway instance in the
-terminal without replaying older logs.
+`nanobot webui` creates the config/workspace when needed, enables the local WebSocket channel after confirmation, generates a WebUI bootstrap secret when one is missing, starts or joins the same on-demand gateway used by the native TUI, and opens the browser. With a fresh config, it can open before a model is configured so you can finish setup in **Settings → Models**. The first-run path binds the WebUI to `127.0.0.1` by default, so it is not available from other devices on your LAN. While the launcher remains attached, it mirrors new log output from that exact gateway instance in the terminal without replaying older logs.
After model setup, explicitly promote the shared gateway when you do not want to keep a client open:
@@ -38,17 +24,11 @@ After model setup, explicitly promote the shared gateway when you do not want to
nanobot gateway --background
```
-`nanobot webui --background` is retained only to print migration guidance. This keeps one
-unambiguous owner for persistent process lifecycle.
+`nanobot webui --background` is retained only to print migration guidance. This keeps one unambiguous owner for persistent process lifecycle.
-Each foreground WebUI or TUI launcher releases only its own client. The last
-interactive launcher stops an on-demand gateway. `nanobot gateway --background` makes the
-gateway persistent; manage it with `nanobot gateway status`, `nanobot gateway
-logs`, `nanobot gateway restart`, and `nanobot gateway stop`.
+Each foreground WebUI or TUI launcher releases only its own client. The last interactive launcher stops an on-demand gateway. `nanobot gateway --background` makes the gateway persistent; manage it with `nanobot gateway status`, `nanobot gateway logs`, `nanobot gateway restart`, and `nanobot gateway stop`.
-Manual config still works. Same-machine localhost WebUI access can run without
-a browser password. Set `tokenIssueSecret` when you intentionally expose the
-WebUI beyond localhost or want a browser password:
+Manual config still works. Same-machine localhost WebUI access can run without a browser password. Set `tokenIssueSecret` when you intentionally expose the WebUI beyond localhost or want a browser password:
```json
{
@@ -63,8 +43,7 @@ WebUI beyond localhost or want a browser password:
}
```
-The WebUI is served by the WebSocket channel on port `8765` by default. The
-gateway health endpoint, `18790` by default, is not the browser UI.
+The WebUI is served by the WebSocket channel on port `8765` by default. The gateway health endpoint, `18790` by default, is not the browser UI.
## First 10 Minutes
@@ -97,225 +76,87 @@ This path avoids hand-editing `config.json` for normal setup. Use the reference
### Optional GitHub invitation
-Returning users may see an illustrated invitation to star nanobot on GitHub.
-It follows the WebUI language and theme; the button's star animation also
-supports keyboard focus and respects reduced-motion preferences. **Maybe later**,
-the close button, or Escape dismisses it for now. **Don't ask again** or opening
-GitHub from the invitation stops future reminders for the gateway instance,
-including in other browsers. Starring is optional and never required to use nanobot.
+Returning users may see an illustrated invitation to star nanobot on GitHub. It follows the WebUI language and theme; the button's star animation also supports keyboard focus and respects reduced-motion preferences. **Maybe later**, the close button, or Escape dismisses it for now. **Don't ask again** or opening GitHub from the invitation stops future reminders for the gateway instance, including in other browsers. Starring is optional and never required to use nanobot.
## Topic Workspace
-The sidebar is the topic switcher. Each topic keeps its own history, title,
-workspace selection, and linked automations. Use a new topic when you want a
-separate context; use fork when you want to continue from an existing point
-without changing the original thread.
+The sidebar is the topic switcher. Each topic keeps its own history, title, workspace selection, and linked automations. Use a new topic when you want a separate context; use fork when you want to continue from an existing point without changing the original thread.
-On touch devices, sidebar action buttons stay visible with larger touch areas
-for topics, conversation groups, panes, and projects. Tap a title to select it
-or the adjacent action button for its menu. Desktop actions still appear on
-hover or keyboard focus. Press Escape in an action menu to return focus to its
-button and continue with Tab, including from the **Move to** submenu. ArrowLeft
-leaves the submenu and returns to **Move to** without closing the parent menu.
-Choosing Rename instead moves focus into the
-dialog; clicking outside a menu keeps focus at the clicked destination.
+On touch devices, sidebar action buttons stay visible with larger touch areas for topics, conversation groups, panes, and projects. Tap a title to select it or the adjacent action button for its menu. Desktop actions still appear on hover or keyboard focus. Press Escape in an action menu to return focus to its button and continue with Tab, including from the **Move to** submenu. ArrowLeft leaves the submenu and returns to **Move to** without closing the parent menu. Choosing Rename instead moves focus into the dialog; clicking outside a menu keeps focus at the clicked destination.
-Drag a topic within its current sidebar group to keep frequently used work in
-your preferred order. Drag a topic from the sidebar into the composer when you
-want to reference it in the next message instead of switching to it.
+Drag a topic within its current sidebar group to keep frequently used work in your preferred order. Drag a topic from the sidebar into the composer when you want to reference it in the next message instead of switching to it.
### Conversation groups and panes
-Open a topic's sidebar action menu and choose **Create group** to turn it into
-a conversation group. Use **Add pane** in the workbench header to start another
-topic alongside it. A group holds up to four panes. To bring in an existing
-topic, drag it onto the group or use **Move to** in its action menu.
+Open a topic's sidebar action menu and choose **Create group** to turn it into a conversation group. Use **Add pane** in the workbench header to start another topic alongside it. A group holds up to four panes. To bring in an existing topic, drag it onto the group or use **Move to** in its action menu.
-Use **Pane layout** to choose columns, rows, a grid, BSP, or a main pane with a
-stack. Drag a divider to resize panes. Each pane has its own conversation;
-select one to direct the shared composer to that topic. Group membership and
-layout persist across refreshes. Grouping topics does not merge their histories.
+Use **Pane layout** to choose columns, rows, a grid, BSP, or a main pane with a stack. Drag a divider to resize panes. Each pane has its own conversation; select one to direct the shared composer to that topic. Group membership and layout persist across refreshes. Grouping topics does not merge their histories.
-To bring another topic's work into a conversation, select it from the `@` menu
-or drag it from the sidebar into the composer. The agent can read the selected
-session and exchange messages with other saved sessions. See [Composer](#composer)
-for the distinction between an attached reference and plain text.
+To bring another topic's work into a conversation, select it from the `@` menu or drag it from the sidebar into the composer. The agent can read the selected session and exchange messages with other saved sessions. See [Composer](#composer) for the distinction between an attached reference and plain text.
### Activity and context usage
-The message timeline shows replies and agent activity. Expand the **Worked for**
-section to inspect the reasoning and tool activity for a completed turn.
-
-When the agent writes or edits files, the activity item shows the target path,
-status, and changed line counts. Choose **Settings → Appearance → File edit
-display** to control the detail: **Summary** shows the change summary, **Diff**
-shows available unified patches inline, and **Collapsed diff** lets you expand
-them with **View diff**. Large diffs may hide unchanged lines or truncate the
-inline preview. Select the filename in the activity row to open the read-only
-file preview panel.
-
-Files open as tabs in one preview pane. Select another file to add or switch a
-tab without reopening the pane; close a tab with its **×**, or close the pane
-with **Escape**. Tabs and width follow each session while the WebUI remains open.
-They are kept only in memory and cleared when that session is deleted or the
-connection ends. The pane overlays the conversation on narrow screens.
-
-Text previews include up to 384 KiB, with a notice when the file is truncated.
-Large previews show readable text before adding syntax colors; very large or
-minified source stays plain text. All previewed text remains available for
-selection and browser search, and the code pane scrolls in both directions.
-
-PNG, JPEG, GIF and WebP files up to 8 MiB can be previewed as images.
-Hover or focus an image file reference for a compact quick look, or select it
-to open the pane. Select the preview image for the full-size viewer, which
-supports zoom controls, pinch-to-zoom and panning. HTML and SVG files remain
-read-only source previews rather than executable pages.
-
-A plain image file link does not automatically insert a large image into the
-reply. Explicit Markdown images appear inline; image attachments use a compact
-gallery, showing at most four thumbnails before a count of the remaining images.
-An image already displayed inline is not duplicated in the attachment gallery.
-
-Select a file reference to preview it. Right-click the reference or its preview
-tab to copy its absolute or project-relative path. Keyboard users can focus a
-reference and press **Shift+F10**.
-Paths are resolved on the gateway machine, which may not be the computer running
-your browser. Files outside the project do not have a project-relative path.
-If a reference cannot be resolved, you can still copy the original reference;
-the menu does not invent an absolute path. Finder, external editor and terminal
-launching are not available from this browser menu.
-
-File previews follow the active topic's access mode. Restricted workspace access
-previews only files under the selected workspace. Full Access can preview files
-outside the workspace when that access mode is allowed by the gateway.
-
-Website links normally open in a new browser tab. Right-click a link (or press
-**Shift+F10** while it is focused) for link actions. On mobile, use the reply's
-**Message actions → View links** menu. **Preview website** appears only when the
-current browser and URL allow credential-isolated embedding; otherwise the menu
-explains the restriction and keeps **Open in browser** and **Copy link** available.
-Sites can still refuse embedding through their own security headers. nanobot
-does not proxy pages or bypass those restrictions; use **Open in browser** instead.
-
-On touch devices with Visual Viewport support, the app follows the visible area
-when the on-screen keyboard opens or pans the page. Navigation and the composer
-stay in view while messages scroll independently. Session search also follows
-the visible area: the search field stays above the keyboard and results scroll
-inside the dialog. In short landscape viewports, its input and results sit side
-by side so a result remains reachable. Taller dialogs scroll from their top
-instead of centering content outside the visible area. The `@` mention and `/` command
-menus use the visible app area above or below the composer, including when the
-keyboard pans the page. Scroll within a menu to reach more results. Mention rows
-use the app's larger touch targets on phones while retaining desktop density.
-In very short, wide viewports (such as landscape with the keyboard open), menus
-sit beside the input instead of overflowing the scrollable composer. Scroll the
-menu for more candidates and the input area for its controls. If the browser
-bars and keyboard leave no usable page area, dismiss
-the keyboard or return to portrait. Pinch zoom keeps the existing layout instead of resizing it to the
-magnified area; normal fitting resumes when
-you return to the default zoom. Non-touch desktop and native-host layout remain
-unchanged.
-
-On touch devices, compact text fields use a readable 16px minimum baseline to
-avoid Safari automatically zooming the page on focus. Desktop field density
-and manual page zoom remain unchanged.
-
-On touch devices, preview tab controls and
-the full-screen image viewer's close button use larger touch areas without
-enlarging the icons. Preview tabs remain horizontally scrollable when space is
-limited.
-
-Open the context indicator beside the composer model badge to see how much of
-the model's context window is in use. The **Recent rounds** chart shows input
-tokens for each logical model round, including tool-call rounds. Hover or focus
-a bar for input tokens, output tokens, generation time, and the KV cache hit
-rate when reported. Provider usage may be estimated or unavailable; these
-figures are not a billing statement.
-
-When nanobot compacts context, the timeline shows its progress and outcome.
-The model continues with a summary and any messages after it; messages covered
-by the summary remain in your chat history but are no longer sent to the model
-verbatim. Use `/compact` to compact the current topic's context manually.
-See [Memory](./memory.md) for compaction and Dream consolidation.
+The message timeline shows replies and agent activity. Expand the **Worked for** section to inspect the reasoning and tool activity for a completed turn.
+
+When the agent writes or edits files, the activity item shows the target path, status, and changed line counts. Choose **Settings → Appearance → File edit display** to control the detail: **Summary** shows the change summary, **Diff** shows available unified patches inline, and **Collapsed diff** lets you expand them with **View diff**. Large diffs may hide unchanged lines or truncate the inline preview. Select the filename in the activity row to open the read-only file preview panel.
+
+Files open as tabs in one preview pane. Select another file to add or switch a tab without reopening the pane; close a tab with its **×**, or close the pane with **Escape**. Tabs and width follow each session while the WebUI remains open. They are kept only in memory and cleared when that session is deleted or the connection ends. The pane overlays the conversation on narrow screens.
+
+Text previews include up to 384 KiB, with a notice when the file is truncated. Large previews show readable text before adding syntax colors; very large or minified source stays plain text. All previewed text remains available for selection and browser search, and the code pane scrolls in both directions.
+
+PNG, JPEG, GIF and WebP files up to 8 MiB can be previewed as images. Hover or focus an image file reference for a compact quick look, or select it to open the pane. Select the preview image for the full-size viewer, which supports zoom controls, pinch-to-zoom and panning. HTML and SVG files remain read-only source previews rather than executable pages.
+
+A plain image file link does not automatically insert a large image into the reply. Explicit Markdown images appear inline; image attachments use a compact gallery, showing at most four thumbnails before a count of the remaining images. An image already displayed inline is not duplicated in the attachment gallery.
+
+Select a file reference to preview it. Right-click the reference or its preview tab to copy its absolute or project-relative path. Keyboard users can focus a reference and press **Shift+F10**. Paths are resolved on the gateway machine, which may not be the computer running your browser. Files outside the project do not have a project-relative path. If a reference cannot be resolved, you can still copy the original reference; the menu does not invent an absolute path. Finder, external editor and terminal launching are not available from this browser menu.
+
+File previews follow the active topic's access mode. Restricted workspace access previews only files under the selected workspace. Full Access can preview files outside the workspace when that access mode is allowed by the gateway.
+
+Website links normally open in a new browser tab. Right-click a link (or press **Shift+F10** while it is focused) for link actions. On mobile, use the reply's **Message actions → View links** menu. **Preview website** appears only when the current browser and URL allow credential-isolated embedding; otherwise the menu explains the restriction and keeps **Open in browser** and **Copy link** available. Sites can still refuse embedding through their own security headers. nanobot does not proxy pages or bypass those restrictions; use **Open in browser** instead.
+
+On touch devices with Visual Viewport support, the app follows the visible area when the on-screen keyboard opens or pans the page. Navigation and the composer stay in view while messages scroll independently. Session search also follows the visible area: the search field stays above the keyboard and results scroll inside the dialog. In short landscape viewports, its input and results sit side by side so a result remains reachable. Taller dialogs scroll from their top instead of centering content outside the visible area. The `@` mention and `/` command menus use the visible app area above or below the composer, including when the keyboard pans the page. Scroll within a menu to reach more results. Mention rows use the app's larger touch targets on phones while retaining desktop density. In very short, wide viewports (such as landscape with the keyboard open), menus sit beside the input instead of overflowing the scrollable composer. Scroll the menu for more candidates and the input area for its controls. If the browser bars and keyboard leave no usable page area, dismiss the keyboard or return to portrait. Pinch zoom keeps the existing layout instead of resizing it to the magnified area; normal fitting resumes when you return to the default zoom. Non-touch desktop and native-host layout remain unchanged.
+
+On touch devices, compact text fields use a readable 16px minimum baseline to avoid Safari automatically zooming the page on focus. Desktop field density and manual page zoom remain unchanged.
+
+On touch devices, preview tab controls and the full-screen image viewer's close button use larger touch areas without enlarging the icons. Preview tabs remain horizontally scrollable when space is limited.
+
+Open the context indicator beside the composer model badge to see how much of the model's context window is in use. The **Recent rounds** chart shows input tokens for each logical model round, including tool-call rounds. Hover or focus a bar for input tokens, output tokens, generation time, and the KV cache hit rate when reported. Provider usage may be estimated or unavailable; these figures are not a billing statement.
+
+When nanobot compacts context, the timeline shows its progress and outcome. The model continues with a summary and any messages after it; messages covered by the summary remain in your chat history but are no longer sent to the model verbatim. Use `/compact` to compact the current topic's context manually. See [Memory](./memory.md) for compaction and Dream consolidation.
### Delegated work
-When nanobot delegates work to subagents, a work group appears under the request
-that started it. Progress continues to update after the main reply finishes.
-Completed tasks stay available for inspection, and refreshing or reopening the
-WebUI restores saved progress and results without restarting the work.
+When nanobot delegates work to subagents, a work group appears under the request that started it. Progress continues to update after the main reply finishes. Completed tasks stay available for inspection, and refreshing or reopening the WebUI restores saved progress and results without restarting the work.
-Work groups follow the browser's **Activity details** preference: **Auto** opens
-running work and folds it when all tasks finish; **Expanded** keeps it open by
-default. You can also expand or fold a group manually to check individual
-outcomes, including failures and partial results.
+Work groups follow the browser's **Activity details** preference: **Auto** opens running work and folds it when all tasks finish; **Expanded** keeps it open by default. You can also expand or fold a group manually to check individual outcomes, including failures and partial results.
-Select a task to open its read-only conversation on the right, or across the
-screen on mobile. Read its messages, tool activity, file edits, and results,
-including formatted Markdown. Closing the details leaves the task running; its
-stop button cancels only that task. Give follow-up instructions to nanobot in
-the main conversation.
+Select a task to open its read-only conversation on the right, or across the screen on mobile. Read its messages, tool activity, file edits, and results, including formatted Markdown. Closing the details leaves the task running; its stop button cancels only that task. Give follow-up instructions to nanobot in the main conversation.
-These controls appear when the connected host supports subagent tasks. See
-[Subagents](./concepts.md#subagents) for cancellation, saved history, and gateway
-restart behavior.
+These controls appear when the connected host supports subagent tasks. See [Subagents](./concepts.md#subagents) for cancellation, saved history, and gateway restart behavior.
## Temporary Chats
-Use a temporary chat for a conversation that should not be added to nanobot's
-topic history or long-term memory:
+Use a temporary chat for a conversation that should not be added to nanobot's topic history or long-term memory:
1. Select **New topic**.
2. Select the **Temporary chat** control in the page header.
3. Send the first message.
-You can keep more than one temporary chat open and switch between them under
-**Temporary chats** in the sidebar while the current WebUI connection remains
-open. Reloading or closing the page, restarting the gateway, or losing the
-WebSocket connection ends all of them. They cannot be recovered afterward.
-
-Temporary chats do not create saved files for oversized text tool results; these
-stay in memory and are truncated to the configured tool-result limit. Tool-call
-arguments and execution-error details are hidden from the built-in tool logs,
-while tool activity remains visible in the current chat.
-
-Temporary does not mean consequence-free. Requests still go to the configured
-model provider, and tools can still change files, run commands, or affect
-external services. Files and image artifacts created or exported by tools
-(including images returned by MCP tools) are not erased when the chat closes.
-Temporary chats always use the default workspace in
-Restricted mode; the project picker and Full Access are unavailable. Commands
-and tools that create durable goals, automations, or subagent work are also
-unavailable. Use a regular topic when you need reusable context, scheduled work,
-or a result you must retain.
+You can keep more than one temporary chat open and switch between them under **Temporary chats** in the sidebar while the current WebUI connection remains open. Reloading or closing the page, restarting the gateway, or losing the WebSocket connection ends all of them. They cannot be recovered afterward.
+
+Temporary chats do not create saved files for oversized text tool results; these stay in memory and are truncated to the configured tool-result limit. Tool-call arguments and execution-error details are hidden from the built-in tool logs, while tool activity remains visible in the current chat.
+
+Temporary does not mean consequence-free. Requests still go to the configured model provider, and tools can still change files, run commands, or affect external services. Files and image artifacts created or exported by tools (including images returned by MCP tools) are not erased when the chat closes. Temporary chats always use the default workspace in Restricted mode; the project picker and Full Access are unavailable. Commands and tools that create durable goals, automations, or subagent work are also unavailable. Use a regular topic when you need reusable context, scheduled work, or a result you must retain.
## Workspace and Access
-Use the workspace picker to browse folders on the connected nanobot host, enter
-an absolute path, or return to recent and starred projects; favorites persist
-across gateway restarts. The host name appears above saved locations. Project paths refer to
-that machine, not the browser's filesystem.
-
-Use the breadcrumb nodes or Back and Forward controls to navigate. **Last
-visited folder** returns directly to the folder you most recently left,
-restoring its directory columns, selected rows, filter, and scroll positions.
-**Filter this folder** only filters the current directory. Click the empty area
-in the path bar or press **Cmd/Ctrl+Shift+G** to enter a host path; Tab completes
-it and Enter opens it. Click outside the input or press Escape to cancel path
-editing; **Confirm** confirms the edited path.
-Browsing does not change the workspace until you choose **Confirm**.
-**Cancel** leaves the current workspace unchanged. Desktop uses directory
-columns with Shift+wheel horizontal scrolling; narrow screens show one folder
-at a time, with favorites and recent projects under **Saved locations**.
-Directory columns settle on complete rows after scrolling.
-
-On a compatible host without the optional directory-browser capabilities,
-manual path entry remains available. Browse and favorite requests are not sent
-to that host. The gateway still validates the selected workspace and owns its
-access policy.
-
-Selecting a project does not replace the configured agent workspace. The two
-paths have different responsibilities:
+Use the workspace picker to browse folders on the connected nanobot host, enter an absolute path, or return to recent and starred projects; favorites persist across gateway restarts. The host name appears above saved locations. Project paths refer to that machine, not the browser's filesystem.
+
+Use the breadcrumb nodes or Back and Forward controls to navigate. **Last visited folder** returns directly to the folder you most recently left, restoring its directory columns, selected rows, filter, and scroll positions. **Filter this folder** only filters the current directory. Click the empty area in the path bar or press **Cmd/Ctrl+Shift+G** to enter a host path; Tab completes it and Enter opens it. Click outside the input or press Escape to cancel path editing; **Confirm** confirms the edited path. Browsing does not change the workspace until you choose **Confirm**. **Cancel** leaves the current workspace unchanged. Desktop uses directory columns with Shift+wheel horizontal scrolling; narrow screens show one folder at a time, with favorites and recent projects under **Saved locations**. Directory columns settle on complete rows after scrolling.
+
+On a compatible host without the optional directory-browser capabilities, manual path entry remains available. Browse and favorite requests are not sent to that host. The gateway still validates the selected workspace and owns its access policy.
+
+Selecting a project does not replace the configured agent workspace. The two paths have different responsibilities:
| Selected project provides | Agent workspace continues to provide |
|---|---|
@@ -323,63 +164,27 @@ paths have different responsibilities:
| Relative file paths and shell working directory | Long-term memory and history |
| The normal read/write boundary in Restricted mode | Custom skills and instance state |
-Project-local `SOUL.md` and `USER.md` files are ignored, and the agent workspace's
-`AGENTS.md` is not inherited by a separately selected project. When the selected
-project is the configured agent workspace, both roles naturally use the same
-directory.
-
-The access control in the composer controls the local capability level for the
-chat. It does not bypass your gateway, provider, shell sandbox, or operating
-system configuration; it only selects among the capabilities that are already
-available to the current topic.
-
-In Restricted mode, ordinary file and shell work stays inside the selected
-project. To preserve agent continuity, filesystem/search tools receive narrow,
-read-only access to built-in skills, custom skills in the agent workspace, and
-the exact agent `memory/history.jsonl` file. This does not grant access to
-neighboring memory or profile files, and it does not allow writes outside the
-selected project. These tool exceptions do not broaden the browser's file
-preview boundary.
-
-Remote WebUI connections may reduce access for the current workspace and may
-select a different workspace by browsing folders or entering its server-side
-path. A remote project change must use Restricted mode; enabling Full Access
-remains limited to local and native clients.
+Project-local `SOUL.md` and `USER.md` files are ignored, and the agent workspace's `AGENTS.md` is not inherited by a separately selected project. When the selected project is the configured agent workspace, both roles naturally use the same directory.
+
+The access control in the composer controls the local capability level for the chat. It does not bypass your gateway, provider, shell sandbox, or operating system configuration; it only selects among the capabilities that are already available to the current topic.
+
+In Restricted mode, ordinary file and shell work stays inside the selected project. To preserve agent continuity, filesystem/search tools receive narrow, read-only access to built-in skills, custom skills in the agent workspace, and the exact agent `memory/history.jsonl` file. This does not grant access to neighboring memory or profile files, and it does not allow writes outside the selected project. These tool exceptions do not broaden the browser's file preview boundary.
+
+Remote WebUI connections may reduce access for the current workspace and may select a different workspace by browsing folders or entering its server-side path. A remote project change must use Restricted mode; enabling Full Access remains limited to local and native clients.
## Composer
-With voice transcription configured, the idle composer uses one button for
-voice input when empty and Send when text or attachments are present; speech
-is transcribed into the draft before sending.
-
-The composer supports plain messages, image attachments, voice input when
-transcription is configured, slash commands, and `@` mentions for installed Apps,
-MCP presets, or persisted topics. Topics have short, pronounceable handles such as
-`@luma`; titles are display text rather than addresses. Select a topic
-from the menu, or drag it from the sidebar, to attach its structured reference.
-Typing the same text without selecting it remains plain text.
-
-On touch-primary phones and tablets, **Enter** inserts a newline; tap the send
-arrow to submit. This also applies when a coarse-pointer tablet has a hardware
-keyboard attached. On desktop, **Enter** sends and **Shift+Enter** adds a newline.
-An open slash-command or mention menu takes precedence: Enter selects its item.
-
-While a response is running, the send arrow delivers a ready draft as guidance
-for the active turn; it does not issue a stop command. Other messages already
-waiting in the queue stay there. On desktop, Enter queues guidance and a second
-Enter with an empty input sends that queued message immediately. Queued messages
-also have a **Send now** action. The primary button shows **Stop** when there is
-no sendable draft; clear the draft or use `/stop` to stop instead of sending it.
-
-The agent can inspect an attached topic with `read_session`. It can discover other
-persisted topics with `list_sessions` and send asynchronous messages with
-`send_session_message`; topic messaging is not limited by workspace scope.
-The model badge shows the current model or preset and links to model settings when
-setup is incomplete.
-
-For image generation, configure an image provider first and then use the WebUI
-image mode from the composer. See [`image-generation.md`](./image-generation.md)
-for provider setup and output behavior.
+With voice transcription configured, the idle composer uses one button for voice input when empty and Send when text or attachments are present; speech is transcribed into the draft before sending.
+
+The composer supports plain messages, image attachments, voice input when transcription is configured, slash commands, and `@` mentions for installed Apps, MCP presets, or persisted topics. Topics have short, pronounceable handles such as `@luma`; titles are display text rather than addresses. Select a topic from the menu, or drag it from the sidebar, to attach its structured reference. Typing the same text without selecting it remains plain text.
+
+On touch-primary phones and tablets, **Enter** inserts a newline; tap the send arrow to submit. This also applies when a coarse-pointer tablet has a hardware keyboard attached. On desktop, **Enter** sends and **Shift+Enter** adds a newline. An open slash-command or mention menu takes precedence: Enter selects its item.
+
+While a response is running, the send arrow delivers a ready draft as guidance for the active turn; it does not issue a stop command. Other messages already waiting in the queue stay there. On desktop, Enter queues guidance and a second Enter with an empty input sends that queued message immediately. Queued messages also have a **Send now** action. The primary button shows **Stop** when there is no sendable draft; clear the draft or use `/stop` to stop instead of sending it.
+
+The agent can inspect an attached topic with `read_session`. It can discover other persisted topics with `list_sessions` and send asynchronous messages with `send_session_message`; topic messaging is not limited by workspace scope. The model badge shows the current model or preset and links to model settings when setup is incomplete.
+
+For image generation, configure an image provider first and then use the WebUI image mode from the composer. See [`image-generation.md`](./image-generation.md) for provider setup and output behavior.
## Channels
@@ -397,90 +202,42 @@ Test a new channel with a private DM. When a supported channel sends a pairing c
## Apps
-Open Apps from the sidebar to review and manage installable capabilities. The
-default **Ready** view shows only capabilities that can be used immediately:
-
-- **Agent Plugins** are local packages that can bundle skills, MCP servers, or
- both. A package under `<workspace>/plugins/` is installed but remains inactive
- until you enable it in Apps.
-- **CLI Apps** are local command-line adapters that nanobot runs on your
- machine. Their installer manages the executable and exposes its adapter
- through the same plugin activation model. Installing an adapter does not
- modify the native desktop or web app it connects to.
-- **MCP** lists Model Context Protocol servers. Presets provide known
- configurations, and the **Add MCP server** panel accepts stdio, HTTP, and SSE
- servers. Custom HTTP/SSE servers can use no authentication, OAuth, or request
- headers. After saving an OAuth server, choose **Connect** to open its sign-in
- page. Presets such as Xmind, Notion, and Linear already use OAuth. HTTPS and
- localhost WebUIs return automatically; a remote plain-HTTP WebUI shows one
- field for pasting the complete localhost callback URL.
-
-CLI Apps run with a limited environment that excludes provider API keys. On
-Unix, they inherit `XDG_RUNTIME_DIR` when it is set in the gateway's environment,
-so desktop CLIs such as Obsidian can locate the running application. Start the
-gateway in the same desktop session as the app to inherit that runtime directory.
-
-Apps intentionally does not list nanobot runtime support packages such as
-`api` or `bedrock`. Those packages enable providers, servers, or channels; they
-are not tools that can be attached to a turn with `@`. Manage them from
-**System**, **Models**, or **Web**. PDF and common Office document readers are
-included in nanobot and activate automatically when a file is attached. The
-equivalent CLI for optional integrations remains `nanobot plugins`. See
-[`cli-reference.md`](./cli-reference.md#optional-features).
-That command manages nanobot runtime extras, not Agent Plugin packages.
-
-Some MCP presets connect to hosted keyless endpoints. For example, the Firecrawl
-preset uses Firecrawl's hosted MCP endpoint for search, scrape, crawl, and
-extraction tools without requiring an API key. This does not replace nanobot's
-built-in web search provider; mention the Firecrawl MCP preset with `@` when a
-turn needs Firecrawl's richer web data tools.
-
-The Parallel Search preset connects to the free, anonymous Parallel Search MCP
-endpoint and exposes `web_search` and `web_fetch` without requiring an API key.
-It is an optional integration and does not replace nanobot's built-in web search
-provider; mention `@parallel-search` when a turn should use it.
-
-After a CLI App or MCP server is available, mention it from the composer with
-`@` to attach that tool to the next message. Plugin-provided skills participate
-in normal skill discovery and can be invoked with `$skill-name`.
+Open Apps from the sidebar to review and manage installable capabilities. The default **Ready** view shows only capabilities that can be used immediately:
+
+- **Agent Plugins** are local packages that can bundle skills, MCP servers, or both. A package under `<workspace>/plugins/` is installed but remains inactive until you enable it in Apps.
+- **CLI Apps** are local command-line adapters that nanobot runs on your machine. Their installer manages the executable and exposes its adapter through the same plugin activation model. Installing an adapter does not modify the native desktop or web app it connects to.
+- **MCP** lists Model Context Protocol servers. Presets provide known configurations, and the **Add MCP server** panel accepts stdio, HTTP, and SSE servers. Custom HTTP/SSE servers can use no authentication, OAuth, or request headers. After saving an OAuth server, choose **Connect** to open its sign-in page. Presets such as Xmind, Notion, and Linear already use OAuth. HTTPS and localhost WebUIs return automatically; a remote plain-HTTP WebUI shows one field for pasting the complete localhost callback URL.
+
+CLI Apps run with a limited environment that excludes provider API keys. On Unix, they inherit `XDG_RUNTIME_DIR` when it is set in the gateway's environment, so desktop CLIs such as Obsidian can locate the running application. Start the gateway in the same desktop session as the app to inherit that runtime directory.
+
+Apps intentionally does not list nanobot runtime support packages such as `api` or `bedrock`. Those packages enable providers, servers, or channels; they are not tools that can be attached to a turn with `@`. Manage them from **System**, **Models**, or **Web**. PDF and common Office document readers are included in nanobot and activate automatically when a file is attached. The equivalent CLI for optional integrations remains `nanobot plugins`. See [`cli-reference.md`](./cli-reference.md#optional-features). That command manages nanobot runtime extras, not Agent Plugin packages.
+
+Some MCP presets connect to hosted keyless endpoints. For example, the Firecrawl preset uses Firecrawl's hosted MCP endpoint for search, scrape, crawl, and extraction tools without requiring an API key. This does not replace nanobot's built-in web search provider; mention the Firecrawl MCP preset with `@` when a turn needs Firecrawl's richer web data tools.
+
+The Parallel Search preset connects to the free, anonymous Parallel Search MCP endpoint and exposes `web_search` and `web_fetch` without requiring an API key. It is an optional integration and does not replace nanobot's built-in web search provider; mention `@parallel-search` when a turn should use it.
+
+After a CLI App or MCP server is available, mention it from the composer with `@` to attach that tool to the next message. Plugin-provided skills participate in normal skill discovery and can be invoked with `$skill-name`.
## Skills
-Open **Skills → Installed** to review built-in and workspace-provided skills.
-You can search and filter them, inspect their instructions and setup
-requirements, enable or disable them, and delete workspace skills you no longer
-want.
+Open **Skills → Installed** to review built-in and workspace-provided skills. You can search and filter them, inspect their instructions and setup requirements, enable or disable them, and delete workspace skills you no longer want.
-Open **Skills → Discover** to browse or search skills from skills.sh and
-SkillHub. A marketplace skill is copied into the active agent workspace after
-you confirm the installation. skills.sh installation requires Node.js with
-`npx`; SkillHub installation does not.
+Open **Skills → Discover** to browse or search skills from skills.sh and SkillHub. A marketplace skill is copied into the active agent workspace after you confirm the installation. skills.sh installation requires Node.js with `npx`; SkillHub installation does not.
-Marketplace skills are third-party instructions and may include executable
-scripts. Review the source and instructions before installing one, and enable
-only skills you trust with the same files, tools, and credentials available to
-your agent.
+Marketplace skills are third-party instructions and may include executable scripts. Review the source and instructions before installing one, and enable only skills you trust with the same files, tools, and credentials available to your agent.
## Automations
-Automations are agent turns that run later in a linked topic. Create them from
-the topic or channel where they are supposed to run so nanobot keeps the
-correct target context. When an automation runs, it normally delivers the
-result back to that topic.
+Automations are agent turns that run later in a linked topic. Create them from the topic or channel where they are supposed to run so nanobot keeps the correct target context. When an automation runs, it normally delivers the result back to that topic.
-For the full automation model, creation flow, trigger CLI usage, and delivery
-semantics, see [`automations.md`](./automations.md).
+For the full automation model, creation flow, trigger CLI usage, and delivery semantics, see [`automations.md`](./automations.md).
There are two user-facing automation types:
-- Scheduled automations, created by the agent's cron tool, run at a time,
- interval, or cron expression.
-- Local triggers, created with `/trigger <name>`, run when you call a local
- command such as `nanobot trigger trg_8K4P2Q9X "Review PR #4502"`.
+- Scheduled automations, created by the agent's cron tool, run at a time, interval, or cron expression.
+- Local triggers, created with `/trigger <name>`, run when you call a local command such as `nanobot trigger trg_8K4P2Q9X "Review PR #4502"`.
-For recurring background checks that should stay quiet unless there is something
-useful to report, use the protected heartbeat job by editing `HEARTBEAT.md`
-instead of creating a chat automation.
+For recurring background checks that should stay quiet unless there is something useful to report, use the protected heartbeat job by editing `HEARTBEAT.md` instead of creating a chat automation.
Use the Automations view to:
@@ -492,36 +249,23 @@ Use the Automations view to:
- Copy the CLI command for local triggers.
- Inspect protected system automations without changing them.
-Search accepts plain text and field filters such as `name:backup`,
-`chat:WeChat`, `schedule:09:30`, `cron:"0 23 * * *"`, `trigger`, and
-`status:paused`.
+Search accepts plain text and field filters such as `name:backup`, `chat:WeChat`, `schedule:09:30`, `cron:"0 23 * * *"`, `trigger`, and `status:paused`.
-An automation without a linked topic cannot be enabled or run from the WebUI,
-because nanobot would not know where to deliver the scheduled turn. Recreate it
-from the target topic or channel so the automation has complete context.
+An automation without a linked topic cannot be enabled or run from the WebUI, because nanobot would not know where to deliver the scheduled turn. Recreate it from the target topic or channel so the automation has complete context.
-Local triggers do not have a WebUI "Run now" action because each run needs a
-message. Use the copied `nanobot trigger ...` command and replace `"message"`
-with the content that should be delivered.
+Local triggers do not have a WebUI "Run now" action because each run needs a message. Use the copied `nanobot trigger ...` command and replace `"message"` with the content that should be delivered.
## Settings
-Settings is the control surface for browser-local and gateway-backed
-runtime configuration. Use it to review or adjust model presets, providers,
-image generation, voice transcription, web tools, chat channels, Apps,
-Automations, Skills, runtime identity, and advanced safety controls.
+Settings is the control surface for browser-local and gateway-backed runtime configuration. Use it to review or adjust model presets, providers, image generation, voice transcription, web tools, chat channels, Apps, Automations, Skills, runtime identity, and advanced safety controls.
-Some settings take effect immediately. Runtime settings that affect the gateway
-or agent process may require a restart; the WebUI shows that requirement next to
-the relevant control.
+Some settings take effect immediately. Runtime settings that affect the gateway or agent process may require a restart; the WebUI shows that requirement next to the relevant control.
-Browser-only display preferences, such as file edit display mode, take effect
-immediately for the current browser and do not change gateway configuration.
+Browser-only display preferences, such as file edit display mode, take effect immediately for the current browser and do not change gateway configuration.
## LAN Access
-To open the WebUI from another device on the same network, bind the WebSocket
-channel to all interfaces and set a token or token issue secret:
+To open the WebUI from another device on the same network, bind the WebSocket channel to all interfaces and set a token or token issue secret:
```json
{
@@ -535,22 +279,11 @@ channel to all interfaces and set a token or token issue secret:
}
```
-The gateway refuses to start with `host` set to `"0.0.0.0"` unless `token` or
-`tokenIssueSecret` is configured. After the gateway starts, open
-`http://<your-ip>:8765` from the other device and enter the secret in the login
-form.
+The gateway refuses to start with `host` set to `"0.0.0.0"` unless `token` or `tokenIssueSecret` is configured. After the gateway starts, open `http://<your-ip>:8765` from the other device and enter the secret in the login form.
-Plain HTTP is enough for basic WebUI access, but browsers expose microphone
-capture only in secure contexts. Voice input works on same-machine localhost;
-from another device, serve the WebUI over HTTPS with a certificate that device
-trusts. Configure [`sslCertfile` and `sslKeyfile`](./websocket.md#tlsssl) on the
-WebSocket channel and open `https://<your-host>:8765`, or terminate HTTPS at a
-reverse proxy and use that proxy's HTTPS URL.
+Plain HTTP is enough for basic WebUI access, but browsers expose microphone capture only in secure contexts. Voice input works on same-machine localhost; from another device, serve the WebUI over HTTPS with a certificate that device trusts. Configure [`sslCertfile` and `sslKeyfile`](./websocket.md#tlsssl) on the WebSocket channel and open `https://<your-host>:8765`, or terminate HTTPS at a reverse proxy and use that proxy's HTTPS URL.
-Remote WebUI clients with a valid token can view and use Apps and installed
-skills. Actions that install missing nanobot support packages or third-party
-marketplace skills are blocked by default. To let trusted remote administrators
-perform those installations through the WebUI, opt in explicitly:
+Remote WebUI clients with a valid token can view and use Apps and installed skills. Actions that install missing nanobot support packages or third-party marketplace skills are blocked by default. To let trusted remote administrators perform those installations through the WebUI, opt in explicitly:
```json
{
@@ -560,66 +293,25 @@ perform those installations through the WebUI, opt in explicitly:
}
```
-Use this only for a private deployment where every authenticated WebUI user is
-trusted to change nanobot's Python environment and install workspace skill
-instructions or scripts. If you publish the WebUI through Nginx, Caddy,
-Cloudflare Tunnel, or a similar service, treat it as remote access and leave
-package and skill installs disabled unless that is intentional.
+Use this only for a private deployment where every authenticated WebUI user is trusted to change nanobot's Python environment and install workspace skill instructions or scripts. If you publish the WebUI through Nginx, Caddy, Cloudflare Tunnel, or a similar service, treat it as remote access and leave package and skill installs disabled unless that is intentional.
-Optional feature installs use pip's configured package index, including
-`PIP_INDEX_URL`. skills.sh marketplace installs use `npx` instead.
+Optional feature installs use pip's configured package index, including `PIP_INDEX_URL`. skills.sh marketplace installs use `npx` instead.
-Leave remote package installs disabled when the WebUI is exposed beyond a
-private, trusted network.
+Leave remote package installs disabled when the WebUI is exposed beyond a private, trusted network.
## Troubleshooting
### Links and website previews
-HTTP(S) links in replies have a **Link actions** menu: right-click the link or
-press Shift+F10 while it is focused. Touch and hold keeps the browser's native
-link menu. For in-app actions on touch devices, open the message's existing
-**Message actions → View links** entry. It lists only the web links rendered in
-that message, not URLs inside code blocks or file references. Choose a link to
-copy it, open it externally, or preview it beside the current conversation.
-On phone-sized screens, Copy and Message actions sit below the message, leaving
-the full text width available. Message actions opens a bottom sheet; close it
-with its close button, by tapping outside, or with Escape. Desktop keeps the
-hover-triggered message popover.
-On desktop, hovering or focusing a message also reveals a short timestamp below
-its actions: a 24-hour clock for today, or month/day for every other date. Hover
-or focus that label for the full local date and time, including the year. Replies
-use their completion timestamp when available, otherwise their creation timestamp.
-There is no persistent action button beside each link and no custom long-press
-gesture to interfere with scrolling or text selection.
-Ordinary clicks still open links in a browser tab. File and session links keep
-their own behavior.
-
-The sidebar shares space with file previews and has refresh, external-open and
-close controls. Escape closes it when focus is in the nanobot page, unless a
-menu or dialog handles Escape first. Once focus is inside a third-party page,
-use the sidebar's close button. The opened address and width are remembered
-per session for this app connection, not written to browser storage. Returning
-to a session reloads the original address; it does not preserve the website's
-DOM, navigation history or forms. The header shows the **original link**, not a
-live address bar for navigation inside the embedded page.
-
-This is a restricted preview, not a full browser. It requires browser support
-for credentialless iframes and is disabled in the native host until a separate
-untrusted-content boundary is available. Unsupported browsers can still copy
-links and open new tabs. Previews use an opaque-origin sandbox with scripts
-but without same-origin access, forms, popups, downloads or top navigation.
-No gateway token, host bridge or parent storage is passed into the frame.
-
-Sites may refuse embedding via CSP or X-Frame-Options, and sign-in or some
-interactive features may not work. Use **Open in browser** if the frame is blank
-or reports a failure. The browser does not reliably expose an embedding failure
-to nanobot, so a frame load event is not presented as a success signal. Nanobot
-does not proxy pages or bypass their headers. Same-origin nanobot URLs and
-HTTP pages embedded from an HTTPS WebUI are not previewed.
-
-`localhost` and loopback addresses refer to the device running your browser,
-not a remote nanobot gateway. This feature does not forward remote ports.
+HTTP(S) links in replies have a **Link actions** menu: right-click the link or press Shift+F10 while it is focused. Touch and hold keeps the browser's native link menu. For in-app actions on touch devices, open the message's existing **Message actions → View links** entry. It lists only the web links rendered in that message, not URLs inside code blocks or file references. Choose a link to copy it, open it externally, or preview it beside the current conversation. On phone-sized screens, Copy and Message actions sit below the message, leaving the full text width available. Message actions opens a bottom sheet; close it with its close button, by tapping outside, or with Escape. Desktop keeps the hover-triggered message popover. On desktop, hovering or focusing a message also reveals a short timestamp below its actions: a 24-hour clock for today, or month/day for every other date. Hover or focus that label for the full local date and time, including the year. Replies use their completion timestamp when available, otherwise their creation timestamp. There is no persistent action button beside each link and no custom long-press gesture to interfere with scrolling or text selection. Ordinary clicks still open links in a browser tab. File and session links keep their own behavior.
+
+The sidebar shares space with file previews and has refresh, external-open and close controls. Escape closes it when focus is in the nanobot page, unless a menu or dialog handles Escape first. Once focus is inside a third-party page, use the sidebar's close button. The opened address and width are remembered per session for this app connection, not written to browser storage. Returning to a session reloads the original address; it does not preserve the website's DOM, navigation history or forms. The header shows the **original link**, not a live address bar for navigation inside the embedded page.
+
+This is a restricted preview, not a full browser. It requires browser support for credentialless iframes and is disabled in the native host until a separate untrusted-content boundary is available. Unsupported browsers can still copy links and open new tabs. Previews use an opaque-origin sandbox with scripts but without same-origin access, forms, popups, downloads or top navigation. No gateway token, host bridge or parent storage is passed into the frame.
+
+Sites may refuse embedding via CSP or X-Frame-Options, and sign-in or some interactive features may not work. Use **Open in browser** if the frame is blank or reports a failure. The browser does not reliably expose an embedding failure to nanobot, so a frame load event is not presented as a success signal. Nanobot does not proxy pages or bypass their headers. Same-origin nanobot URLs and HTTP pages embedded from an HTTPS WebUI are not previewed.
+
+`localhost` and loopback addresses refer to the device running your browser, not a remote nanobot gateway. This feature does not forward remote ports.
### Connection checks
@@ -631,10 +323,6 @@ If the page does not open, check these in order:
4. You are opening port `8765`, not the gateway health port.
5. LAN access uses `host: "0.0.0.0"` and a token or token issue secret.
-If voice input asks for a secure connection, use HTTPS with a certificate the
-device trusts. Browsers do not expose microphone capture to
-`http://<your-ip>` origins.
+If voice input asks for a secure connection, use HTTPS with a certificate the device trusts. Browsers do not expose microphone capture to `http://<your-ip>` origins.
-For detailed diagnostics, see
-[`troubleshooting.md#webui-problems`](./troubleshooting.md#webui-problems).
-For frontend development, see [`../webui/README.md`](../webui/README.md).
+For detailed diagnostics, see [`troubleshooting.md#webui-problems`](./troubleshooting.md#webui-problems). For frontend development, see [`../webui/README.md`](../webui/README.md).
diff --git a/nanobot/skills/README.md b/nanobot/skills/README.md
index 36d041c5e..fa603fb8c 100644
--- a/nanobot/skills/README.md
+++ b/nanobot/skills/README.md
@@ -8,16 +8,11 @@ Each skill is a directory containing a `SKILL.md` file with:
- YAML frontmatter (name, description, metadata)
- Markdown instructions for the agent
-When skills reference large local documentation or logs, prefer nanobot's built-in
-`grep` tool to narrow the search space before loading full files.
-Use `grep(output_mode="count")` / `files_with_matches` for broad searches first,
-use `head_limit` / `offset` to page through large result sets,
-and `grep(glob="*.md")` to filter by file name pattern.
+When skills reference large local documentation or logs, prefer nanobot's built-in `grep` tool to narrow the search space before loading full files. Use `grep(output_mode="count")` / `files_with_matches` for broad searches first, use `head_limit` / `offset` to page through large result sets, and `grep(glob="*.md")` to filter by file name pattern.
## Attribution
-These skills are adapted from [OpenClaw](https://github.com/openclaw/openclaw)'s skill system.
-The skill format and metadata structure follow OpenClaw's conventions to maintain compatibility.
+These skills are adapted from [OpenClaw](https://github.com/openclaw/openclaw)'s skill system. The skill format and metadata structure follow OpenClaw's conventions to maintain compatibility.
## Available Skills
diff --git a/tui/README.md b/tui/README.md
index 12f410bed..cc2b947be 100644
--- a/tui/README.md
+++ b/tui/README.md
@@ -11,100 +11,40 @@ bun run --cwd tui build
## Source layout
-Code under `src/` is grouped by responsibility: `app/` coordinates the retained UI, `client/`
-owns gateway transport and API projections, `composer/` owns draft and queue state, `menus/` and
-`views/` own interactive surfaces, `rendering/` owns transcript presentation, and `platform/`
-contains host-specific integration. Unit and component tests stay beside the feature they cover;
-cross-module behavior tests live with the owning `app/` or `client/` boundary. The production
-build still starts from `src/index.ts`, so colocated `*.test.ts` files are not part of the compiled
-executable.
+Code under `src/` is grouped by responsibility: `app/` coordinates the retained UI, `client/` owns gateway transport and API projections, `composer/` owns draft and queue state, `menus/` and `views/` own interactive surfaces, `rendering/` owns transcript presentation, and `platform/` contains host-specific integration. Unit and component tests stay beside the feature they cover; cross-module behavior tests live with the owning `app/` or `client/` boundary. The production build still starts from `src/index.ts`, so colocated `*.test.ts` files are not part of the compiled executable.
`nanobot` (or the explicit `nanobot agent` form) launches this client, leases the shared local gateway or starts it on demand, and passes the local bootstrap endpoint through environment variables. The client paints before gateway readiness, retries bootstrap in the background, and obtains fresh WebSocket and REST credentials for each connection. Other terminals and the WebUI keep that gateway alive; the final interactive launcher to exit releases the on-demand process. `/detach` closes the TUI after promoting the gateway to persistent background mode, keeping any active agent turn running without clients; the restored terminal prints the exact stop command for that config and explicit workspace. `nanobot gateway --background` can start or promote it persistently before opening a client. Source checkouts automatically align dependencies with `bun.lock` before launch; released installs use a version-matched, checksum-verified archive that keeps the executable together with its licenses, notices, corresponding application source, source offer, and relinking instructions. Startup fails explicitly if the native client is unavailable. The legacy Python prompt is selected with `nanobot --classic` or `nanobot agent --classic`.
The TUI uses OpenTUI's retained full-screen layout: the transcript reflows with the terminal while the composer stays fixed at the bottom. Mouse and keyboard scrolling operate inside the transcript, and leaving the TUI restores the previous terminal screen.
-Assistant math written with `$...$`, `$$...$$`, `\\(...\\)`, or `\\[...\\]` is presented as
-Unicode plain text so formulas remain readable in terminals without a math renderer. Currency and
-LaTeX inside inline or fenced code remain literal.
+Assistant math written with `$...$`, `$$...$$`, `\\(...\\)`, or `\\[...\\]` is presented as Unicode plain text so formulas remain readable in terminals without a math renderer. Currency and LaTeX inside inline or fenced code remain literal.
-Automatic theme selection follows the terminal's OSC 10/11 responses. Until a response
-arrives, the TUI uses the terminal's default foreground and background without semantic
-colors or color animations. Terminals that do not answer keep this readable fallback.
-Use `nanobot --theme light` or `nanobot --theme dark` to select a color palette explicitly.
+Automatic theme selection follows the terminal's OSC 10/11 responses. Until a response arrives, the TUI uses the terminal's default foreground and background without semantic colors or color animations. Terminals that do not answer keep this readable fallback. Use `nanobot --theme light` or `nanobot --theme dark` to select a color palette explicitly.
## Herdr pane titles
When Herdr supplies `HERDR_ENV=1` and `HERDR_PANE_ID`, nanobot keeps the same full-screen layout, controls, and navigation available in any other terminal. Its only host-specific behavior is reporting the latest user task as the Herdr pane title through the supported pane CLI. Creating a new chat, switching to a chat without a task, and exiting the TUI clear that title. Nanobot does not report agent lifecycle, session, model, Git branch, workspace, or action metadata to Herdr.
-The model preset and workspace access labels above the composer are live controls. Click either
-label, then click a choice; arrow keys, `Enter`, and `Esc` provide the same flow without a mouse.
-Changes reuse the gateway's normal model command and workspace policy checks.
-
-When you scroll away from the latest output, the scrollbar and `Ctrl+End` hint appear only until
-you return to the bottom. Large pastes are represented by a short editable placeholder in the
-composer; nanobot sends the original text unchanged. Press `Ctrl+V` or `Alt+V` while the composer
-is focused to attach an image from the system clipboard. Image bytes stay behind removable
-`[Image #n]` placeholders until the message is sent; each placeholder behaves as one unit, and
-deleting it removes its image.
-
-While nanobot is working, the composer prompt becomes
-`Enter send now Tab send next`; narrow terminals shorten it to `Enter now Tab next`.
-The footer shows progress and elapsed time without repeating the latest tool activity already
-visible in the transcript.
-
-Type `/` to discover slash commands published by the connected gateway. Use the arrow keys
-to move, `Tab` to complete, and `Esc` to close the menu.
-
-Type `@` to complete installed CLI apps, configured MCP servers, or saved sessions through the
-same gateway metadata used by the WebUI. While nanobot is working, `Enter` sends immediately,
-`Tab` waits until the current response is finished, and `Option+Up` on macOS (`Alt+Up` on
-Windows/Linux) returns the latest waiting message to the composer for editing. Waiting messages
-stay visible above the composer. `/goal <task>` follows the same keys: `Enter` sends the goal
-into the running conversation, while `Tab` waits for the current response to finish.
-Use `Shift+Enter` for a newline; `Ctrl+J` is the universal fallback when a terminal cannot
-distinguish modified Enter keys. `Alt+Enter` and `Ctrl+Enter` are also accepted when distinguishable.
-Unsent prompts return to the composer if the turn stops or fails.
-
-Use `/sessions` to search and switch persisted conversations without leaving the terminal.
-`/new-chat` preserves the current conversation and starts another one; nanobot's existing `/new`
-command keeps its cross-channel behavior and resets the current chat. Each launch starts a new
-session using the launch directory as its workspace; `--session` selects an existing session and
-`--workspace` overrides the launch directory. On exit, the restored terminal prints a ready-to-run
-`nanobot agent --session ...` command that resumes the current session. When earlier transcript
-pages exist, press `PageUp` at the top to load them in place.
-
-The native client accepts bare WebSocket chat IDs or `websocket:<id>` selectors. Use
-`nanobot agent --classic --session <channel:id>` to resume a session owned by another channel;
-the TUI never silently maps one channel's identity into the WebSocket namespace.
-
-Sessions are live across clients: if two terminals or the WebUI attach to the same session, an
-accepted user message and the resulting agent/tool stream appear on every attached client while
-the gateway executes the input only once.
-
-`/branch` creates a new saved conversation from a completed reply without changing the source
-session. The picker uses durable history indices, so paginated transcripts branch at the selected
-turn rather than the currently visible row.
-
-`/context` explains the session-owned material available for the next agent turn: the compacted
-summary, replayable raw suffix, and an estimated token count. It deliberately does not expose
-private reasoning and does not pretend to be the complete model prompt; workspace instructions,
-memory, and skills are assembled separately by the Python runtime.
-
-`/usage` shows the latest measured context occupancy and up to eight recent logical model
-rounds from the latest history page, matching the WebUI usage chart. Bar heights represent input
-tokens; orange indicates uncached input, teal indicates cached input, and gray means cache usage
-is unknown. Use `Left`/`Right` to inspect a round's input, output, cache hit rate, generation time,
-and estimated-usage indicator; `Esc` closes the panel. Details collapse in short terminals.
-The panel refreshes when a turn ends while open. Missing usage is not treated as zero, and a
-successful compaction hides the old context meter until a later request reports context usage.
-Bar heights and cache boundaries are rounded independently to eighths of a character row;
-positive input always occupies at least one eighth. Mixed full cells use both foreground and
-background colors. If a partial top cell contains empty space and both token categories, it
-keeps its height and uses the larger category's color because a terminal cell has only two colors.
-Use the numeric details for exact token counts; the chart remains a grid approximation.
-
-`/diff` opens the latest turn's file changes in a full-screen unified diff. Use `Left`/`Right`
-to switch edits, `PageUp`/`PageDown` or `Home`/`End` to navigate, and `Esc` to return to chat.
-The gateway remains the source of the patch; the TUI never rereads workspace files to rebuild it.
-The footer reports provider token/cache usage when available, and tool activity uses compact,
-tool-specific summaries while retaining the full event history behind `Ctrl+O`.
+The model preset and workspace access labels above the composer are live controls. Click either label, then click a choice; arrow keys, `Enter`, and `Esc` provide the same flow without a mouse. Changes reuse the gateway's normal model command and workspace policy checks.
+
+When you scroll away from the latest output, the scrollbar and `Ctrl+End` hint appear only until you return to the bottom. Large pastes are represented by a short editable placeholder in the composer; nanobot sends the original text unchanged. Press `Ctrl+V` or `Alt+V` while the composer is focused to attach an image from the system clipboard. Image bytes stay behind removable `[Image #n]` placeholders until the message is sent; each placeholder behaves as one unit, and deleting it removes its image.
+
+While nanobot is working, the composer prompt becomes `Enter send now Tab send next`; narrow terminals shorten it to `Enter now Tab next`. The footer shows progress and elapsed time without repeating the latest tool activity already visible in the transcript.
+
+Type `/` to discover slash commands published by the connected gateway. Use the arrow keys to move, `Tab` to complete, and `Esc` to close the menu.
+
+Type `@` to complete installed CLI apps, configured MCP servers, or saved sessions through the same gateway metadata used by the WebUI. While nanobot is working, `Enter` sends immediately, `Tab` waits until the current response is finished, and `Option+Up` on macOS (`Alt+Up` on Windows/Linux) returns the latest waiting message to the composer for editing. Waiting messages stay visible above the composer. `/goal <task>` follows the same keys: `Enter` sends the goal into the running conversation, while `Tab` waits for the current response to finish. Use `Shift+Enter` for a newline; `Ctrl+J` is the universal fallback when a terminal cannot distinguish modified Enter keys. `Alt+Enter` and `Ctrl+Enter` are also accepted when distinguishable. Unsent prompts return to the composer if the turn stops or fails.
+
+Use `/sessions` to search and switch persisted conversations without leaving the terminal. `/new-chat` preserves the current conversation and starts another one; nanobot's existing `/new` command keeps its cross-channel behavior and resets the current chat. Each launch starts a new session using the launch directory as its workspace; `--session` selects an existing session and `--workspace` overrides the launch directory. On exit, the restored terminal prints a ready-to-run `nanobot agent --session ...` command that resumes the current session. When earlier transcript pages exist, press `PageUp` at the top to load them in place.
+
+The native client accepts bare WebSocket chat IDs or `websocket:<id>` selectors. Use `nanobot agent --classic --session <channel:id>` to resume a session owned by another channel; the TUI never silently maps one channel's identity into the WebSocket namespace.
+
+Sessions are live across clients: if two terminals or the WebUI attach to the same session, an accepted user message and the resulting agent/tool stream appear on every attached client while the gateway executes the input only once.
+
+`/branch` creates a new saved conversation from a completed reply without changing the source session. The picker uses durable history indices, so paginated transcripts branch at the selected turn rather than the currently visible row.
+
+`/context` explains the session-owned material available for the next agent turn: the compacted summary, replayable raw suffix, and an estimated token count. It deliberately does not expose private reasoning and does not pretend to be the complete model prompt; workspace instructions, memory, and skills are assembled separately by the Python runtime.
+
+`/usage` shows the latest measured context occupancy and up to eight recent logical model rounds from the latest history page, matching the WebUI usage chart. Bar heights represent input tokens; orange indicates uncached input, teal indicates cached input, and gray means cache usage is unknown. Use `Left`/`Right` to inspect a round's input, output, cache hit rate, generation time, and estimated-usage indicator; `Esc` closes the panel. Details collapse in short terminals. The panel refreshes when a turn ends while open. Missing usage is not treated as zero, and a successful compaction hides the old context meter until a later request reports context usage. Bar heights and cache boundaries are rounded independently to eighths of a character row; positive input always occupies at least one eighth. Mixed full cells use both foreground and background colors. If a partial top cell contains empty space and both token categories, it keeps its height and uses the larger category's color because a terminal cell has only two colors. Use the numeric details for exact token counts; the chart remains a grid approximation.
+
+`/diff` opens the latest turn's file changes in a full-screen unified diff. Use `Left`/`Right` to switch edits, `PageUp`/`PageDown` or `Home`/`End` to navigate, and `Esc` to return to chat. The gateway remains the source of the patch; the TUI never rereads workspace files to rebuild it. The footer reports provider token/cache usage when available, and tool activity uses compact, tool-specific summaries while retaining the full event history behind `Ctrl+O`.
diff --git a/tui/RELINKING.md b/tui/RELINKING.md
index c065fc561..f962a7744 100644
--- a/tui/RELINKING.md
+++ b/tui/RELINKING.md
@@ -1,25 +1,15 @@
# Native TUI corresponding source and relinking
-The nanobot TUI release archive contains the executable, its complete JavaScript/TypeScript
-application source, dependency lockfile, build scripts, and third-party notices. It is built with
-Bun 1.3.13 and OpenTUI 0.5.11. See `SOURCE_OFFER.md` for the corresponding-source
-offer that accompanies the executable. The archive also contains the complete LGPL 2.0 and
-LGPL 2.1 license texts.
+The nanobot TUI release archive contains the executable, its complete JavaScript/TypeScript application source, dependency lockfile, build scripts, and third-party notices. It is built with Bun 1.3.13 and OpenTUI 0.5.11. See `SOURCE_OFFER.md` for the corresponding-source offer that accompanies the executable. The archive also contains the complete LGPL 2.0 and LGPL 2.1 license texts.
Corresponding upstream source:
- nanobot TUI: the `tui/` and `packages/client-events/` directories in the GitHub release tag that contains this archive
-- Bun 1.3.13 (`bf2e2cecf27e800962b1e7f03d66278f9d5d2e79`):
- <https://github.com/oven-sh/bun/tree/bun-v1.3.13>
-- Bun's patched WebKit (`4d5e75ebd84a14edbc7ae264245dcd77fe597c10`):
- <https://github.com/oven-sh/WebKit/tree/4d5e75ebd84a14edbc7ae264245dcd77fe597c10>
-- OpenTUI 0.5.11: <https://www.npmjs.com/package/@opentui/core/v/0.5.11>
- (source: <https://github.com/anomalyco/opentui/tree/6b9863ea7c5fae22bfebb23c242ddcc4c2b0aa0e>)
+- Bun 1.3.13 (`bf2e2cecf27e800962b1e7f03d66278f9d5d2e79`): <https://github.com/oven-sh/bun/tree/bun-v1.3.13>
+- Bun's patched WebKit (`4d5e75ebd84a14edbc7ae264245dcd77fe597c10`): <https://github.com/oven-sh/WebKit/tree/4d5e75ebd84a14edbc7ae264245dcd77fe597c10>
+- OpenTUI 0.5.11: <https://www.npmjs.com/package/@opentui/core/v/0.5.11> (source: <https://github.com/anomalyco/opentui/tree/6b9863ea7c5fae22bfebb23c242ddcc4c2b0aa0e>)
-To rebuild against a modified JavaScriptCore/WebKit, first build Bun 1.3.13 from its complete
-source checkout together with the WebKit revision above by following Bun's pinned license and
-build instructions. Then unpack
-`nanobot-tui-source.tar.gz` from the release archive and run the resulting Bun executable:
+To rebuild against a modified JavaScriptCore/WebKit, first build Bun 1.3.13 from its complete source checkout together with the WebKit revision above by following Bun's pinned license and build instructions. Then unpack `nanobot-tui-source.tar.gz` from the release archive and run the resulting Bun executable:
```bash
cd nanobot-tui-source/tui
@@ -27,8 +17,6 @@ cd nanobot-tui-source/tui
/path/to/modified/bun run build -- <target>
```
-Supported targets are `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64`, and `win32-x64`.
-The resulting executable is written to `dist/`.
+Supported targets are `darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64`, and `win32-x64`. The resulting executable is written to `dist/`.
-Questions about source availability can be reported at
-<https://github.com/HKUDS/nanobot/issues>.
+Questions about source availability can be reported at <https://github.com/HKUDS/nanobot/issues>.
diff --git a/tui/SOURCE_OFFER.md b/tui/SOURCE_OFFER.md
index 1523dc1d9..72fb5875a 100644
--- a/tui/SOURCE_OFFER.md
+++ b/tui/SOURCE_OFFER.md
@@ -2,14 +2,8 @@
This offer applies to the native nanobot TUI executable distributed in the same release archive.
-For at least three years after the release date, HKUDS offers any third party a
-complete machine-readable copy of the corresponding source and relinking materials required for
-the LGPL-covered libraries incorporated through Bun, for no more than the reasonable physical
-cost of conveying that copy.
+For at least three years after the release date, HKUDS offers any third party a complete machine-readable copy of the corresponding source and relinking materials required for the LGPL-covered libraries incorporated through Bun, for no more than the reasonable physical cost of conveying that copy.
-The nanobot application source, lockfile, build scripts, notices, and relinking instructions are
-already included in this archive. Exact upstream revisions are listed in `RELINKING.md`.
+The nanobot application source, lockfile, build scripts, notices, and relinking instructions are already included in this archive. Exact upstream revisions are listed in `RELINKING.md`.
-To request any additional corresponding-source material, open an issue at
-<https://github.com/HKUDS/nanobot/issues> or email <[email protected]> and identify the nanobot
-release tag and target platform shown in `THIRD_PARTY_NOTICES.txt`.
+To request any additional corresponding-source material, open an issue at <https://github.com/HKUDS/nanobot/issues> or email <[email protected]> and identify the nanobot release tag and target platform shown in `THIRD_PARTY_NOTICES.txt`.
diff --git a/webui/README.md b/webui/README.md
index 57becacd2..53506c9e4 100644
--- a/webui/README.md
+++ b/webui/README.md
@@ -1,10 +1,6 @@
# nanobot WebUI Source
-This directory contains the React/TypeScript source for the nanobot WebUI. If
-you installed `nanobot-ai` from PyPI and only want to use the bundled browser UI,
-read the user guide in [`docs/webui.md`](../docs/webui.md). You do not need
-Node.js, Bun, Vite, or anything in this directory unless you are changing the
-frontend.
+This directory contains the React/TypeScript source for the nanobot WebUI. If you installed `nanobot-ai` from PyPI and only want to use the bundled browser UI, read the user guide in [`docs/webui.md`](../docs/webui.md). You do not need Node.js, Bun, Vite, or anything in this directory unless you are changing the frontend.
For the project overview, install guide, and general docs map, see the root [`README.md`](../README.md) and [`docs/README.md`](../docs/README.md).
@@ -17,9 +13,7 @@ For the project overview, install guide, and general docs map, see the root [`RE
| Change WebUI source code | [Develop the WebUI (Vite HMR)](#develop-the-webui-vite-hmr) | `http://127.0.0.1:5173` |
| Debug setup failures | [`docs/troubleshooting.md#webui-problems`](../docs/troubleshooting.md#webui-problems) | Diagnosis order and common fixes |
-The source app is built with Vite + React 18 + TypeScript + Tailwind 3 +
-shadcn/ui. It talks to the gateway over the WebSocket multiplex protocol and
-reads session metadata from the embedded REST surface on the same port.
+The source app is built with Vite + React 18 + TypeScript + Tailwind 3 + shadcn/ui. It talks to the gateway over the WebSocket multiplex protocol and reads session metadata from the embedded REST surface on the same port.
## Layout
@@ -48,12 +42,9 @@ From the repository root:
nanobot webui --dev
```
-The command safely prepares the local WebSocket channel, starts both the gateway and Vite,
-and opens `http://127.0.0.1:5173`. Vite proxies to the configured WebSocket channel and applies
-frontend changes with HMR. Press Ctrl+C in that terminal to stop both processes.
+The command safely prepares the local WebSocket channel, starts both the gateway and Vite, and opens `http://127.0.0.1:5173`. Vite proxies to the configured WebSocket channel and applies frontend changes with HMR. Press Ctrl+C in that terminal to stop both processes.
-Use `--no-open` to skip opening a browser. `--dev` is foreground-only and cannot be combined
-with `--background`.
+Use `--no-open` to skip opening a browser. `--dev` is foreground-only and cannot be combined with `--background`.
## Manual development setup
diff --git a/webui/proposals/automation-chat/README.md b/webui/proposals/automation-chat/README.md
index e3ab9809d..8ef4f9dba 100644
--- a/webui/proposals/automation-chat/README.md
+++ b/webui/proposals/automation-chat/README.md
@@ -1,148 +1,53 @@
# Automation chat selection
-Chat selection uses the production WebUI and Python gateway. The earlier
-in-memory preview and its build transform have been removed.
-See [the user guide](../../../docs/automations.md#change-the-chat-for-a-scheduled-task)
-for the interaction, limits, and downgrade warning.
+Chat selection uses the production WebUI and Python gateway. The earlier in-memory preview and its build transform have been removed. See [the user guide](../../../docs/automations.md#change-the-chat-for-a-scheduled-task) for the interaction, limits, and downgrade warning.
## Design decision
-The concerns in [#5513](https://github.com/HKUDS/nanobot/issues/5513#issuecomment-5488297111)
-and [#5620](https://github.com/HKUDS/nanobot/pull/5620#issuecomment-5534384796)
-still apply: running in chat A and forwarding the result to chat B separates
-the reply from its history and can expose context from A.
-
-This implementation changes the whole binding for future runs: execution chat,
-recorded turn, and default reply route. It does not add a delivery override or
-copy old messages. New tasks start in their creation chat. A user can explicitly
-change the whole binding for future runs.
-
-The detail panel has one control, **Run and reply in**. It does not offer a
-separate result recipient. The confirmation shows the current and new chats,
-explains that old messages stay where they are, and shows read-only task
-instructions. **Edit instructions** opens the text field only when needed, for
-example to remove an old recipient. **Save and change** then saves both changes
-together. Task name and schedule edits remain in the existing **Edit** dialog.
-
-Cancel leaves the task unchanged. After saving, **Change back to** opens the same
-confirmation for the previous chat; it does not silently undo a saved change.
-The selector, confirmation, and saved status use the sidebar's display-name rule.
-Current user-defined names take precedence over older API titles. Duplicate names
-show a stable handle. All mutations still use the server-owned chat ID, not its name.
+The concerns in [#5513](https://github.com/HKUDS/nanobot/issues/5513#issuecomment-5488297111) and [#5620](https://github.com/HKUDS/nanobot/pull/5620#issuecomment-5534384796) still apply: running in chat A and forwarding the result to chat B separates the reply from its history and can expose context from A.
+
+This implementation changes the whole binding for future runs: execution chat, recorded turn, and default reply route. It does not add a delivery override or copy old messages. New tasks start in their creation chat. A user can explicitly change the whole binding for future runs.
+
+The detail panel has one control, **Run and reply in**. It does not offer a separate result recipient. The confirmation shows the current and new chats, explains that old messages stay where they are, and shows read-only task instructions. **Edit instructions** opens the text field only when needed, for example to remove an old recipient. **Save and change** then saves both changes together. Task name and schedule edits remain in the existing **Edit** dialog.
+
+Cancel leaves the task unchanged. After saving, **Change back to** opens the same confirmation for the previous chat; it does not silently undo a saved change. The selector, confirmation, and saved status use the sidebar's display-name rule. Current user-defined names take precedence over older API titles. Duplicate names show a stable handle. All mutations still use the server-owned chat ID, not its name.
## Ownership and commit boundary
-- The gateway resolves existing session handles, titles, canonical reply routes,
- channel availability, and effective workspace policy. The browser cannot submit
- a raw session key, channel, recipient, or topic address.
-- `GET /api/webui/automations/chats?id=...` uses the existing API authentication.
- `automation.change_chat` uses the authenticated WebSocket mutation path. A
- direct HTTP mutation is rejected. Its values are `target_id`, `revision`, and
- the reviewed `message`.
-- The gateway resolves the target again at save time. It rejects unknown,
- offline, foreign-scope, and unsupported targets. Topic address metadata is
- retained; sender identity and previous workspace policy are not copied.
-- The cron owner compares the reviewed revision after merging pending CLI
- actions. It rejects while a scheduled turn owns a live execution snapshot,
- including one waiting in the agent queue. This first version conservatively
- blocks changes while any scheduled turn is active.
-- One atomic write saves the whole binding and reviewed prompt before the new
- snapshot becomes live. A pre-commit write failure leaves the old state intact.
- If directory sync fails after replacement, the owner reads back that exact
- snapshot before reporting success. A binding version prevents an older CLI
- action snapshot from restoring the previous route.
-- Each run retains its session identity. Before the first supported move, older
- run records are stamped with the known unchanged original binding. Audit result
- checks still verify job, run, session, status, and file path.
- History links use that run's WebUI chat key, not the task's current chat.
- External runs expose no recipient key and have no WebUI chat link.
-
-No new execution path, agent-loop policy, dependencies, or separate CSS system
-are added. The dialog uses the existing Select, Dialog, Button, Textarea, channel
-logos, and DropdownMenu. The detail dialog owns the modal lock. Confirmation is
-explicit and progress stays local to that action. The page remains visible.
-Chat names and platform labels use separate lines. Task instructions use the
-same quiet inset surface as other app dialogs. The confirmation and detail
-panel share their action spacing; narrow screens can wrap long action labels.
-While choices load, the known chat stays readable and the selector reports busy
-to assistive technology. Saving reserves space for both button labels and keeps
-the review visible until the host confirms. There is no optimistic route change
-or loading overlay. This applies the continuity principle from
-[The perfect app has no loading states](https://floriankiem.com/writing/the-perfect-app-has-no-loading-states)
-without treating cached choices as permission to change a route.
-The review keeps the selected and original chat identities across refreshes.
-Their display names follow current sidebar names without changing either target.
-If refreshed choices omit the selected chat, its name remains visible and saving
-is disabled. The gateway still checks the route at save time.
-
-The session details endpoint uses the same complete task serializer as the
-Automations page. Both shared-dialog entry points receive the binding needed to
-enable Run now and resume; neither client invents a missing route.
+- The gateway resolves existing session handles, titles, canonical reply routes, channel availability, and effective workspace policy. The browser cannot submit a raw session key, channel, recipient, or topic address.
+- `GET /api/webui/automations/chats?id=...` uses the existing API authentication. `automation.change_chat` uses the authenticated WebSocket mutation path. A direct HTTP mutation is rejected. Its values are `target_id`, `revision`, and the reviewed `message`.
+- The gateway resolves the target again at save time. It rejects unknown, offline, foreign-scope, and unsupported targets. Topic address metadata is retained; sender identity and previous workspace policy are not copied.
+- The cron owner compares the reviewed revision after merging pending CLI actions. It rejects while a scheduled turn owns a live execution snapshot, including one waiting in the agent queue. This first version conservatively blocks changes while any scheduled turn is active.
+- One atomic write saves the whole binding and reviewed prompt before the new snapshot becomes live. A pre-commit write failure leaves the old state intact. If directory sync fails after replacement, the owner reads back that exact snapshot before reporting success. A binding version prevents an older CLI action snapshot from restoring the previous route.
+- Each run retains its session identity. Before the first supported move, older run records are stamped with the known unchanged original binding. Audit result checks still verify job, run, session, status, and file path. History links use that run's WebUI chat key, not the task's current chat. External runs expose no recipient key and have no WebUI chat link.
+
+No new execution path, agent-loop policy, dependencies, or separate CSS system are added. The dialog uses the existing Select, Dialog, Button, Textarea, channel logos, and DropdownMenu. The detail dialog owns the modal lock. Confirmation is explicit and progress stays local to that action. The page remains visible. Chat names and platform labels use separate lines. Task instructions use the same quiet inset surface as other app dialogs. The confirmation and detail panel share their action spacing; narrow screens can wrap long action labels. While choices load, the known chat stays readable and the selector reports busy to assistive technology. Saving reserves space for both button labels and keeps the review visible until the host confirms. There is no optimistic route change or loading overlay. This applies the continuity principle from [The perfect app has no loading states](https://floriankiem.com/writing/the-perfect-app-has-no-loading-states) without treating cached choices as permission to change a route. The review keeps the selected and original chat identities across refreshes. Their display names follow current sidebar names without changing either target. If refreshed choices omit the selected chat, its name remains visible and saving is disabled. The gateway still checks the route at save time.
+
+The session details endpoint uses the same complete task serializer as the Automations page. Both shared-dialog entry points receive the binding needed to enable Run now and resume; neither client invents a missing route.
## Compatibility
-The gateway advertises optional `webui.automation-chat.v1`; the core protocol
-floor stays at 1. The optional `chat_binding_revision` job field exposes the
-control only for supported jobs. A new client sends no new request to an old
-host. An old client can keep using ordinary edits on a new host.
-
-Storage paths and job IDs do not change. `bindingVersion` and per-run `sessionKey`
-are additive fields with legacy defaults. The active instance still owns its
-cron store and action log. **Downgrade after a move is not transparent**: follow
-the backup/restore procedure in the user guide. Mixed-version cron writers after
-a move are not supported. Rejected stale CLI updates are logged; retry the edit
-from the current version after reading the latest task.
-
-Explicit message-tool instructions can still override the default destination.
-Prompt review is required, not automatic rewriting. The selector does not create
-new isolation for shared workspace memory or files and does not guarantee that a
-remote platform will accept delivery.
-
-New reminders need only task instructions. The cron skill, tool descriptions,
-and scheduled-turn prompt agree that nanobot sends the final reply to the saved
-chat. Explicit separate sends and attachments still use `message`. Existing
-instructions and recipients are not rewritten. The confirmation asks users to
-check recipients, not remove intended broadcasts.
-
-Scheduling uses the requested time and notification behavior, not repetition.
-The always-loaded tool contract distinguishes cron schedules from flexible,
-quiet heartbeat checks. Updated workspace templates and the cron skill use the
-same rule. Existing workspace files and heartbeat tasks are not rewritten;
-the user guide explains how to correct an old rule or an existing task.
-
-These instructions are static. No per-run tool list, schema, or system prompt is
-added. Updated tool descriptions and static scheduling rules can cause a cache
-miss after the upgrade.
-Task-specific instructions remain in the current user turn. Moving to another
-chat intentionally changes the history; cache reuse must not override that.
+The gateway advertises optional `webui.automation-chat.v1`; the core protocol floor stays at 1. The optional `chat_binding_revision` job field exposes the control only for supported jobs. A new client sends no new request to an old host. An old client can keep using ordinary edits on a new host.
+
+Storage paths and job IDs do not change. `bindingVersion` and per-run `sessionKey` are additive fields with legacy defaults. The active instance still owns its cron store and action log. **Downgrade after a move is not transparent**: follow the backup/restore procedure in the user guide. Mixed-version cron writers after a move are not supported. Rejected stale CLI updates are logged; retry the edit from the current version after reading the latest task.
+
+Explicit message-tool instructions can still override the default destination. Prompt review is required, not automatic rewriting. The selector does not create new isolation for shared workspace memory or files and does not guarantee that a remote platform will accept delivery.
+
+New reminders need only task instructions. The cron skill, tool descriptions, and scheduled-turn prompt agree that nanobot sends the final reply to the saved chat. Explicit separate sends and attachments still use `message`. Existing instructions and recipients are not rewritten. The confirmation asks users to check recipients, not remove intended broadcasts.
+
+Scheduling uses the requested time and notification behavior, not repetition. The always-loaded tool contract distinguishes cron schedules from flexible, quiet heartbeat checks. Updated workspace templates and the cron skill use the same rule. Existing workspace files and heartbeat tasks are not rewritten; the user guide explains how to correct an old rule or an existing task.
+
+These instructions are static. No per-run tool list, schema, or system prompt is added. Updated tool descriptions and static scheduling rules can cause a cache miss after the upgrade. Task-specific instructions remain in the current user turn. Moving to another chat intentionally changes the history; cache reuse must not override that.
## Verification
-The focused regression suite exercises the actual HTTP/WebSocket gateway,
-session manager, scheduler, agent queue, persistence, and audit reader. It
-checks save/read-back, execution history and outbound topic routing, old results,
-revision conflict, pre/post-replace errors, stale CLI actions, running jobs,
-scope and route filtering, and old-host UI behavior.
-
-The regression suite also checks follow-up model input in the new chat, a
-background result after the parent turn's wait timeout, and confirmed or
-cancelled deletion of the new WebUI chat. These use the existing session owner;
-no separate delivery context is added to the agent loop.
-
-The reply-contract test covers normal replies, legacy same-chat `message` calls
-without duplicate replies, and multiple explicit recipients with attachments.
-It compares serialized tools and system messages across ordinary turns, two
-scheduled runs, and tool continuations. It also checks that continuation history
-keeps structured tool calls and results. This is not a live provider cache-hit
-measurement or proof that every model will follow the prompt.
-
-Browser checks use the normal production build served by an isolated real
-gateway. Chat data, model replies, and channel status are synthetic. Saves are
-persisted to a temporary cron store; model network calls and external channel
-senders are not started. Checks cover restart/read-back, running a saved task,
-concurrent-edit rejection with retained draft, deletion cancellation, and
-desktop/320 px/390 px layouts. This is not physical-iOS or real-platform delivery
-acceptance. Raw test logs and local fixture state are kept outside the repository.
+The focused regression suite exercises the actual HTTP/WebSocket gateway, session manager, scheduler, agent queue, persistence, and audit reader. It checks save/read-back, execution history and outbound topic routing, old results, revision conflict, pre/post-replace errors, stale CLI actions, running jobs, scope and route filtering, and old-host UI behavior.
+
+The regression suite also checks follow-up model input in the new chat, a background result after the parent turn's wait timeout, and confirmed or cancelled deletion of the new WebUI chat. These use the existing session owner; no separate delivery context is added to the agent loop.
+
+The reply-contract test covers normal replies, legacy same-chat `message` calls without duplicate replies, and multiple explicit recipients with attachments. It compares serialized tools and system messages across ordinary turns, two scheduled runs, and tool continuations. It also checks that continuation history keeps structured tool calls and results. This is not a live provider cache-hit measurement or proof that every model will follow the prompt.
+
+Browser checks use the normal production build served by an isolated real gateway. Chat data, model replies, and channel status are synthetic. Saves are persisted to a temporary cron store; model network calls and external channel senders are not started. Checks cover restart/read-back, running a saved task, concurrent-edit rejection with retained draft, deletion cancellation, and desktop/320 px/390 px layouts. This is not physical-iOS or real-platform delivery acceptance. Raw test logs and local fixture state are kept outside the repository.
## Screenshots