Files
nanobot/docs/guides
akinolurandchengyongru 9d2762a4f1 feat(provider): langfuse tracing for codex (#5520)
* feat: trace Codex requests via Langfuse native SDK

Codex has no OpenAI SDK client for Langfuse's usual swap trick, so
log one generation per request through langfuse's native SDK
instead. Tracing failures never affect the returned Codex response.

* docs: note Codex Langfuse tracing support

* fix: trace every Codex request, close every generation

- Move the Langfuse generation inside _send so the compaction
  sub-request gets its own trace too, not just the main request.
- Derive traced model/input from the wire body (post extra_body
  override, post response-item-ID stripping) instead of the
  pre-normalized one.
- Wrap package detection in the same try/except as the SDK call, so
  a broken find_spec() can't turn a valid Codex request into an error.
- Make generation finalization idempotent and cancellation-safe via
  try/except/else/finally, so update() failures or a cancelled
  request no longer leave a generation open.
- Add tests for compaction tracing, update() failures, and
  cancellation.

* docs: fix cli-reference.md langfuse plugin row

* fix: don't trace a rejected compaction as success

- Add a validate hook to _send so a transport-successful compaction
  reply with no usable item traces as an error, not a success.
- Add regression tests for a find_spec() failure, for the traced
  model/input matching the actual wire body (extra_body override,
  ID-stripped replayed items), and for the rejected-compaction case.

* fix: convert LLMUsage to dict for Langfuse usage_details

LLMResponse.usage is now the LLMUsage dataclass upstream, not a
plain dict - Langfuse's usage_details param needs the latter.

* fix: satisfy basedpyright strict on compaction items

* fix(providers): normalize Codex Langfuse cache usage

* fix(providers): migrate Langfuse tracing to SDK 4

---------

Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-10-16 00:44:17 +08:00
..

nanobot Task Guides

Start with Install and Quick Start and get one reply before using a guide below. Each guide targets one outcome; linked reference pages hold the complete option tables and edge cases.

You can ask nanobot to guide your next task using the built-in nanobot-document skill, or read a guide yourself. See Continue with nanobot for availability and examples. Each task guide describes its starting requirements, setup steps, and how to check the result; use the parts that match your current instance.

Start and Use

Goal Guide
Build a personal AI agent Build a personal AI agent
Use the browser workbench AI agent WebUI
Run a self-hosted AI agent Self-hosted AI agent
Run a sustained goal Long-running AI agent
Add long-term memory AI agent memory

Connect a Chat App

Use Channels in the WebUI for guided setup. These guides explain the account, bot, token, permission, and test-message steps on each platform.

Goal Guide
Connect chat apps Chat app AI agent
Connect Telegram Telegram AI agent
Connect Discord Discord AI agent
Connect Slack Slack AI agent
Connect Feishu Feishu AI agent
Connect WhatsApp WhatsApp AI agent
Connect WeChat WeChat AI agent
Connect QQ QQ AI agent
Connect Email Email AI agent
Connect Mattermost Mattermost AI agent
Connect Linear Native Linear agent

Integrate from Code

Goal Guide
Run from Python Python AI agent SDK
Expose /v1/chat/completions OpenAI-compatible agent API

Configure and Operate

Goal Guide
Add MCP tools Configure MCP tools
Enable web search Configure web search
Add model fallback Configure model fallback
Add an OpenAI-compatible provider Configure an OpenAI-compatible provider
Improve Ollama tool prompt-cache reuse Configure Ollama prompt caching
Add Langfuse tracing Configure Langfuse observability
Secure local tools Secure a local AI agent
Deploy the gateway Deploy nanobot gateway