Adds `whatsapp_agent`, an additive channel that connects nanobot to the
official WhatsApp Agent Platform API (https://api.whatsapp.com/agent/v1).
It authenticates with a per-agent API token and long-polls `GET /updates`
instead of linking a device, so it is the officially supported interface
rather than the Neonize linked-device protocol used by the existing
`whatsapp` channel.
The existing `whatsapp` channel is unchanged; both can run at once under
different names.
Design notes:
- The poll cursor, dedup window, and creator identifier live in one
atomically replaced state file. A message id is recorded before it is
handled, so a crash re-reads the batch without answering twice, and the
cursor is only accepted after the batch is processed.
- The first poll omits `offset`, which resolves the head and never replays
up to 30 days of history into an auto-replying agent.
- A changed token resets the cursor, because `next_offset` is only valid
for the agent that issued it.
- Each API method is paced below its own rolling 60-second limit, and
progress/tool-hint messages default to off because they spend the shared
12-per-minute send budget.
- Retries are limited to confirmed non-delivery (`429`, `503`/`131016`).
A `500` or read timeout is ambiguous, so it is not retried unless
`retryAmbiguousSends` is set; a duplicate is worse than a missed reply.
- Inbound media is downloaded through the shared SSRF guard, size-capped,
and verified against the reported digest. Outbound media is validated
before upload.
- Reactions are receive-only, matching the API. The token is never logged
or persisted; state stores only a SHA-256 fingerprint.
Docs compare both WhatsApp channels, including the lack of end-to-end
encryption, country availability, and rate limits.
* 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>
* feat(webui): expand MCP service presets
* refactor(webui): load MCP presets from JSON
Validate and package the static service catalogue while preserving existing preset definitions. Pass Redis connection URLs through the official CLI option to retain target, TLS, database, and credential settings.
* docs(mcp): include all built-in service presets
* feat(webui): add local first-run access setup
* feat(webui): defer password setup until network access
Keep generated local credentials and provide the full browser login link in every launch mode. Require a chosen password when enabling network access, preserve existing authentication, and show pending listener changes until restart.
Remove mandatory first-run initialization gates and simplify startup output while retaining gateway warnings and errors.
* fix(webui): align access settings with channel contracts
* fix(webui): clarify startup guidance and spacing
* fix(webui): keep setup guidance readable in narrow terminals
* fix(webui): clarify startup and preserve remote password access
* fix(webui): move access explanations into settings hints
* fix(webui): require strong ASCII passwords and reject malformed auth
* fix(webui): simplify access password character rules
* test(webui): reflect pending restart after password save
* fix(webui): open Windows browser from WSL
* fix(webui): clarify public access copy
* refactor(webui): focus on WSL launch and startup output
* fix(webui): preserve platform browser fallback
* feat(webui): improve model and provider settings UX
* refactor(webui): organize provider forms and model picker interactions
* fix(webui): separate OAuth credentials from provider configuration
* fix(webui): stabilize shared combobox navigation
* refactor(config): store provider connections as sparse entries
* fix(webui): preserve provider validation and isolate catalog tests
* refactor(config): manage explicit provider connections
* refactor(webui): decouple settings UX from provider removal
* fix(webui): select current combobox options during rapid input
* feat(webui): refine model preset and provider management
* style(webui): refine preset footer actions
* fix(webui): align model settings with responsive layout rules
* refactor(webui): finalize preset dialogs and simplify provider state
* fix(webui): keep fallback heading stable while sorting presets
Animate card dimensions without changing layout height and keep the section heading outside sortable cards. Remove proxy normalization from this PR.
* docs: update WebUI model and provider setup instructions
* docs: start model setup from new preset
* docs: remove duplicate WebUI model setup instructions
Keep nanobot web_search available on DeepSeek Responses, including old saved hosted-tool settings, and remove the switch and user-facing claims.
Preserve legacy API_TYPE and APITYPE environment selectors during OpenAI connection migration.