Commit Graph
686 Commits
Author SHA1 Message Date
chengyongru 282839cc65 feat(webui): add reading text size preferences (#6325)
* feat(webui): add reading text size preferences

* fix(webui): align loading skeletons with reading typography
2026-10-20 16:33:05 +08:00
chengyongru 816c9221a0 fix(webui): add spring feedback at the history boundary (#6322)
* fix(webui): add spring feedback at the history boundary

Refs NAN-287.

* fix(webui): refine history boundary states and retry feedback

* fix(webui): share history loading states with subagents
2026-10-20 15:32:21 +08:00
chengyongru a1bca7dc50 fix(webui): restore full-project typechecking 2026-10-20 14:47:38 +08:00
chengyongru f869212e7d perf(ci): shorten WebUI feedback latency
Run WebUI checks/build and browser regressions on independent runners while preserving the existing webui aggregate check and every acceptance command. Advance the existing invalid-input validation windows with scoped fake timers instead of real sleeps.
2026-10-20 14:38:57 +08:00
chengyongru 11152626f8 fix(webui): refine browser notifications (NAN-227)
Reconcile the original notification fix with the integrated main snapshot.

Group notification settings and simplify localized copy and documentation.
Preserve permission opt-out and notification click routing across app transitions.
Suppress late completion notifications for discarded temporary chats and align
notification settings skeletons with the loaded layout.
2026-10-20 13:45:04 +08:00
Xubin Ren 7b2af031c0 fix(webui): make browser notification failures actionable 2026-10-20 13:45:04 +08:00
chengyongru 909b277e7a fix(webui): recognize typed session handles as references (#6311)
* fix(webui): recognize typed session handles as references

Refs NAN-286

* refactor(webui): simplify session reference handling

* fix(webui): recognize mentions after punctuation

* docs(webui): focus topic references on usage
2026-10-20 01:05:11 +08:00
chengyongru 125d9221d0 fix(webui): merge consecutive waiting messages (#6309)
* fix(webui): merge consecutive waiting messages

* fix(webui): retain legacy draft session targets on refresh
2026-10-19 21:06:46 +08:00
chengyongru 8778c69774 test(webui): await rendered canonical reconciliation 2026-10-19 17:42:04 +08:00
chengyongru f57018aa7f feat(webui): render Mermaid diagrams with Pele (#6302)
* feat(webui): render Mermaid diagrams with Pele

* fix(webui): reserve diagram replacement capacity

* fix(webui): prebundle lazy diagram worker dependencies

* fix(webui): account diagram capacity by encoded size

* fix(webui): use shared hover hints for diagram actions

* docs(webui): focus diagram guide on usage
2026-10-19 17:16:20 +08:00
chengyongru 0f3b47bc3a fix(webui): isolate transcript replay from live observers (#6306)
* fix(webui): isolate transcript replay from live observers

* docs(webui): shorten chat subscription ownership notes
2026-10-19 17:13:12 +08:00
chengyongru dca49c258a fix(tools): refine DeepSeek search credentials and query validation
Require a configured Search API key while preserving explicit ${VAR_NAME} references.
Reject overlong Unicode queries locally instead of silently truncating them.
Keep the shared Settings flow and condense the configuration documentation.
2026-10-19 16:50:17 +08:00
moran e5b469ebd4 feat(tools): add DeepSeek Search as a web_search provider
Add a standalone `deepseek` search backend that calls the DeepSeek Search
API (POST https://api.deepseek.com/v1/tools/search), following the
provider layout used by AnySearch (#5607) and Bocha (#4182).

This is a search-only integration. It does not touch the DeepSeek LLM
provider, does not inject a `web_search` tool into model requests, and
does not implement the Fetch endpoint.

- Trim and truncate queries to the API's 128 Unicode-character limit
  locally, rejecting whitespace-only queries without a network call.
- Clamp `count` to the API's 1-50 range and always send
  `need_content: false` so page bodies stay out of the model context.
- Format results from `summary`, falling back to `snippet` when a summary
  is missing or blank, and include `date` when present. Cap each result's
  text at 500 characters: live responses reach ~4,500 characters, so ten
  uncapped results cost roughly 10k tokens per call.
- Return actionable 401 and 402 messages; retry 408/429/5xx once after
  1.0s like the Brave provider; surface `error.message` for other 4xx,
  tag-stripped because the upstream body is untrusted. Unexpected
  transport errors report the exception type only, with the detail
  logged when tool log content is allowed.
- Read the key from `tools.web.search.apiKey` or `DEEPSEEK_API_KEY` and
  fall back to DuckDuckGo when neither is set, like other keyed
  providers. The key is never logged or echoed in errors.
- Register the provider for the CLI wizard and WebUI settings, and reuse
  the bundled DeepSeek brand asset.
2026-10-19 16:50:17 +08:00
chengyongru 5d886fbb20 fix(webui): show route-aligned skeletons from first paint (#6303) 2026-10-19 15:57:32 +08:00
chengyongru 53e0edf709 fix(session): prevent consumed follow-ups from replaying after restart (#6299)
* fix(session): atomically acknowledge consumed follow-ups

* refactor(webui): drop legacy follow-up replay compatibility
2026-10-19 11:31:19 +08:00
chengyongru 0a8b18fa58 fix(deepseek): align model capabilities with the official API (#6283)
* fix(deepseek): preserve vision for legacy Flash aliases

* fix(deepseek): expose validated model catalog capabilities

* fix(deepseek): retain explicit off control with live reasoning levels

* docs: clarify provider-specific model guidance
2026-10-18 19:17:05 +08:00
Xubin Ren 6baf7178a8 fix(webui): cancel stale history reads on local navigation 2026-10-18 17:13:18 +08:00
Xubin Ren f230409b5a fix(webui): navigate from history to unsaved live prompts 2026-10-18 17:13:18 +08:00
Xubin Ren f9a3e55b64 perf(webui): revalidate prompt summaries and bound navigation work 2026-10-18 17:13:18 +08:00
Xubin Ren bf1eada575 fix(webui): navigate complete prompt history with bounded pages 2026-10-18 17:13:18 +08:00
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 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 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 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 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