Commit Graph
767 Commits
Author SHA1 Message Date
Xubin Ren 86f16ff493 fix(whatsapp_agent): clarify privacy and align current channel setup 2026-10-18 14:49:49 +08:00
Carmelo Campos b7cb5da4b5 feat(channels): add WhatsApp Agent Platform channel
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.
2026-10-18 14:49:49 +08:00
chengyongru 74942bd190 test: replace false-green checks with behavioral coverage (#6282)
* test: replace false-green checks with behavioral coverage

* test: complete behavior-focused audit coverage
2026-10-18 03:16:25 +08:00
chengyongru c7ab7aa6da refactor(webui): remove obsolete topic rename dialog mode 2026-10-18 01:48:42 +08:00
chengyongru d9537bcc94 feat(webui): rename sidebar topics inline 2026-10-18 01:48:42 +08:00
chengyongru 7edd377352 fix(webui): keep search activity summaries on one line 2026-10-18 01:45:53 +08:00
chengyongru c91e2bd553 fix(webui): preserve list semantics around links
Classify compact title-plus-URL previews at the Markdown AST boundary instead of flattening arbitrary list descendants. Preserve ordinary prose, nested lists, independent links, numbering, task status, and inline formatting across streaming modes.

Refs NAN-269.
2026-10-18 00:48:07 +08:00
chengyongru 1a4cee5815 fix(webui): align mention overlay spacing with the native caret 2026-10-18 00:25:47 +08:00
Xubin Ren 61666c495a fix(webui): reuse preview tabs for resolved file aliases 2026-10-18 00:14:36 +08:00
Xubin Ren 0869c928a2 feat(webui): preview Markdown files with a source toggle 2026-10-18 00:14:36 +08:00
chengyongru 8de03ac0a2 fix(webui): use file-type icons in file change activity 2026-10-17 23:27:00 +08:00
chengyongru 559107172a fix(webui): hide recovery notice while resumed tasks run
Render recovery decisions only for awaiting_user and failed states so a reload cannot resurrect a resuming banner. Preserve the runtime recovery state and normal running controls.

Refs NAN-260
2026-10-16 18:25:40 +08:00
chengyongru 8f6a5594fb refactor(session): centralize state ownership in SQLite (#5943)
* fix(session): move persistence off event loop

* refactor(session): isolate async persistence boundary

* refactor(session): keep a single session manager

* refactor(session): use stateless async adapters

* fix(session): serialize local persistence without file-lock contention

* refactor(session): own async persistence and snapshot commits

* refactor(session): narrow persistence changes to async adapters

* refactor(session): remove redundant async forwarding helpers

* fix(command): offload compact session persistence

* fix(session): adapt idle compaction to current main

* fix(webui): offload session metadata persistence

* refactor(session): centralize state ownership in SQLite

* fix(session): skip storage for non-recoverable followups

* test(webui): honor the full gateway event deadline

* perf(session): persist incremental changes and reuse owner snapshots

* test(agent): allow durable worker shutdown in burst test

* fix(gateway): drain session storage on Windows console shutdown

* fix(session): enforce bounded ownership and lifecycle-safe persistence

* fix: reject unresolved home paths and stabilize platform tests

* fix(session): preserve request context compatibility and owner-backed tests

* docs: focus configuration guide on user-facing behavior

* fix(session): adapt goal admission to async ownership after rebase

* fix(session): integrate current gateway and subagent contracts

* fix(session): align rebased workspace admission and async tests

* fix(session): support compatible SQLite schema evolution

* test(agent): use session owner in workspace context regressions

* test: stabilize Windows lifecycle and browser checks

* refactor(session): remove premature JSONL file export

* ci: bound Windows full-suite worker concurrency

* chore: remove session state refactor notes

* fix(session): queue writes and retain worker connections

* perf(webui): read detached metadata for session and task lists

* perf(agent): bound prompt preparation and local token counting

* docs: remove internal session storage guide

* perf(session): skip archived transcripts during idle scans

* fix(session): coordinate turns and isolate legacy session data

Bind WebUI input generations to the execution session and serialize idle
and SDK compaction with turns. Keep turn drafts through preparation so the
latest channel route persists.

Move imported workspace JSONL and checkpoints to durable private backups
before gateway admission, resuming cleanup after interruptions. Remove
committed child sessions when task creation is cancelled.

Validation: focused Python and frontend regressions, Ruff, BasedPyright,
import boundaries, WebUI build, and isolated gateway/browser flows.

* fix(agent): keep cancellation hooks independent of prompt preparation

* fix(session): preserve admission, delivery, and migration contracts

* fix(agent): preserve cancellation settlement after rebase

* fix(session): preserve request attribution through async ownership
2026-10-16 17:28:47 +08:00
Willow Lopezandchengyongru d2aaa8e54b fix(webui): preserve sidebar state after failed initial fetch (#6009)
* fix(webui): wait for sidebar state before persisting edits

* test(webui): load sidebar state in temporary chat fixtures

* fix(webui): preserve sidebar pushes during initial reads

* fix(webui): require successful session reads before pruning

Treat sidebar initialization and session-list completeness as separate permissions. Retain sidebar metadata, workbench panes, activity markers, and workspace overrides when the session list fails or only a partial reload cache is available.

Add integration coverage for recovery with and without cached sessions, successful deletion reconciliation, and successful empty session lists.

* test(webui): align sidebar recovery fixture with current schema

Remove obsolete preview and timestamp settings from the raw API fixture. Assert supported view preferences while retaining exact metadata and workbench comparisons.

---------

Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-10-16 15:47:15 +08:00
chengyongru 0d09b3dc09 perf(webui): avoid subtree style invalidation while typing 2026-10-16 15:00:38 +08:00
chengyongru b8df1f0418 refactor(settings): preserve domain controller objects 2026-10-16 14:57:33 +08:00
chengyongru 0d1beac3aa refactor(webui): centralize client run lifecycle state 2026-10-16 14:54:37 +08:00
chengyongru 6f04038d21 fix(webui): preserve custom shell runtime editing 2026-10-16 14:09:55 +08:00
chengyongru 3ccc181d29 fix(webui): load history for running sessions 2026-10-16 14:07:10 +08:00
chengyongru 6310a39bac fix(shell): separate wait, idle, and runtime limits (#6228)
* fix(shell): separate wait, idle, and runtime limits

* fix(shell): separate wait, idle, and runtime limits

* fix(exec): preserve settings aliases and reclaim completed sessions

* fix(webui): make shell runtime limits explicit
2026-10-16 13:44:15 +08:00
chengyongru 70ac000ad9 fix(webui): space other tasks from following messages 2026-10-16 13:40:14 +08:00
chengyongru 836092424d fix(webui): resume queued prompts after turn completion (#6242)
* fix(webui): resume queued prompts after turn completion

Persist the lifecycle turn each queued prompt waits for and use canonical completion identities to resume after navigation or reconnect. Release one entry at a time, and retain stopped or rejected entries for manual sending.

* fix(webui): drain temporary chat prompts on live completion

* perf(webui): resume queued prompts from live completion
2026-10-16 13:33:41 +08:00
chengyongru fdeda8a468 fix(webui): reconcile turns after reconnect (#6211)
* fix(webui): reconcile turns after reconnect

* perf(webui): bound reconnect recovery and index turn reconciliation

* refactor(webui): simplify reconnect reconciliation

* fix(webui): preserve turn authority during recovery

* fix(webui): validate canonical completion identities
2026-10-16 11:38:05 +08:00
chengyongru a721eb8476 fix(webui): keep sheet close focus rings keyboard-only 2026-10-16 10:34:38 +08:00
chengyongru c24153db86 fix(ui): keep theme text and selections readable (#6226)
* fix(ui): keep theme text and selections readable

* fix(tui): theme the blank composer cursor cell

* refactor(webui): centralize diff theme colors

* fix(tui): keep conversation selections readable

* fix(ui): preserve nested syntax colors and selection lifetimes
2026-10-15 15:21:28 +08:00
chengyongru 1a77d8fc66 fix(webui): give media gallery components distinct examples 2026-10-15 01:11:22 +08:00
chengyongru 152abe7949 feat(webui): expand MCP service presets (#6216)
* 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
2026-10-14 22:41:55 +08:00
chengyongru a482281092 fix(webui): remove subtask polling and load error UI (#6212)
* fix(webui): stop subtask reads when gateway disconnects

* refactor(webui): limit subtask change to polling removal

* fix(webui): hide subtask load errors after disconnect

* fix(webui): remove subtask load error UI

* refactor(webui): keep subtask refresh fix focused
2026-10-14 18:02:03 +08:00
chengyongru 2d62d99038 fix(webui): restore and synchronize live activity sheen 2026-10-14 16:25:12 +08:00
David KlaperandCopilot 2732e2b3ce fix(webui): send same-origin cookies with uploads
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-14 16:12:50 +08:00
chengyongru 061b19afe1 fix(webui): require double tildes for strikethrough 2026-10-14 14:56:03 +08:00
chengyongru cdb6210b45 refactor(webui): remove session list previews and timestamps (#6189)
* refactor(webui): remove session list previews and timestamps

* test(webui): limit legacy coverage to persisted sidebar files

* refactor(webui): simplify chat rows and fix gallery states

* refactor(webui): flatten chat row title wrapper
2026-10-14 14:41:52 +08:00
chengyongru bdb6c369d0 fix(webui): prevent equation tags from overlapping formulas 2026-10-14 14:32:14 +08:00
chengyongru 4497f7ef24 refactor: remove unused internal code and styles 2026-10-14 10:50:16 +08:00
chengyongru 30e43aec82 refactor(webui): separate presentation views and expand component gallery (#6179)
* refactor(webui): organize shared components with an internal gallery

* refactor(webui): decouple views and expand component gallery

* fix(docker): include channel sources in WebUI build

* refactor(webui): cover all channel interfaces in gallery

* docs(webui): remove manual paragraph wrapping
2026-10-14 00:11:00 +08:00
chengyongru 328e933d36 refactor: isolate runtime contracts and enforce import boundaries (#6166)
* test: enforce Python import ownership boundaries

* test: protect client import boundaries and rehome shared UI contracts

* refactor: remove gateway and client dependency inversions

* fix: detect dynamic imports in conditional expressions

* refactor(tools): keep configuration contracts with their owners

* docs: keep design guidance focused on ownership and checks

* fix: preserve default threaded turn delivery
2026-10-13 13:56:28 +08:00
Xubin Renandchengyongru 23941355a8 feat(images): reuse named connections and image request settings
Preserve the reviewed tree while removing obsolete stacked branch history.

Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-10-12 21:22:35 +08:00
Xubin Ren b89ef23df5 fix(webui): make pairing recovery explicit and retryable 2026-10-12 17:38:43 +08:00
Xubin Ren 2aa98677c6 fix(feishu): restore assistant creation and pairing recovery
Refs NAN-239
2026-10-12 17:38:43 +08:00
Xubin Ren cfb0f51e78 fix(webui): complete restarts independently in each tab 2026-10-12 17:30:53 +08:00
Xubin Ren 1e5ab8e95c test(webui): follow relocated proxy editor across page changes 2026-10-12 17:24:04 +08:00
Xubin Ren 7a3a0559c4 fix(webui): place web proxy with web access settings 2026-10-12 17:24:04 +08:00
Xubin Ren 7575269e7a fix(webui): localize missing request secret errors 2026-10-12 17:17:02 +08:00
Xubin Ren 885a0d4597 fix: preserve config import order and restore editor focus 2026-10-12 17:17:02 +08:00
Xubin Ren 1066adb10b fix: isolate preset requests and confirm parameter saves 2026-10-12 17:17:02 +08:00
Xubin Ren d4b01285a9 feat(models): add per-preset request overrides 2026-10-12 17:17:02 +08:00
chengyongru 73af08efab fix(webui): allow switching Default permissions back to Full Access (#6175)
* fix(webui): allow authenticated access mode switching

* refactor(webui): remove constant full access eligibility helpers

* refactor(webui): remove obsolete full access policy parameter

* docs(webui): remove redundant access switching paragraph

* refactor(webui): remove obsolete full access capability
2026-10-12 15:39:33 +08:00
chengyongru 9261e731ce feat(webui): improve model and provider settings UX (#6145)
* 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
2026-10-11 04:30:43 +08:00
chengyongru 8080ea843a fix(webui): clarify Chinese temporary chat tooltip 2026-10-10 14:59:48 +08:00
chengyongru d808dbdb44 fix(providers): remove obsolete DeepSeek hosted search
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.
2026-10-10 01:33:02 +08:00