120 Commits

Author SHA1 Message Date
chengyongru
d1a94dae8a
refactor(dream): replace two-phase Dream class with simple cron + process_direct (#3990)
* refactor(dream): replace two-phase Dream class with simple cron + process_direct

- Remove the heavyweight Dream class (AgentRunner-based two-phase system)
  from nanobot/agent/memory.py
- Delete dream_phase1.md and dream_phase2.md templates
- New dream.md template serves as the consolidation prompt
- Cron callback uses agent.process_direct(prompt, session_key=\"dream\")
  instead of agent.dream.run()
- Always performs git auto_commit after execution
- /dream command updated to use process_direct + git commit
- DreamConfig kept for backward compatibility; deprecated fields
  (model_override, max_batch_size, max_iterations, annotate_line_ages)
  are ignored but accepted in config
- interval_h remains configurable via agents.defaults.dream.interval_h
- Update tests and webui settings to match new architecture

* feat(loop): add ephemeral mode to process_direct, skip history writes for Dream

When ephemeral=True, _state_save skips enforce_file_cap (which calls
raw_archive -> append_history) and consolidator.maybe_consolidate_by_tokens.
This prevents Dream sessions from creating a positive feedback loop where
they process their own output. The session IS still saved to disk.

* fix(loop): skip extra hooks for ephemeral sessions (Dream)

* feat(dream): per-run timestamped sessions with rotation for WebUI

* test(config): restore DreamConfig schedule and alias tests

* fix(dream): include LLM response summary in git auto-commit message

The old two-phase Dream class included the Phase 1 analysis in the git
commit message body. The new single-phase version lost this. Restore it
by extracting resp.content from the process_direct return value and
appending it to the commit message in both the cron handler and the
/dream command.

* fix(test): accept ephemeral kwarg in test_openai_api fake_process

* refactor(dream): merge dream_session.py into MemoryStore

The standalone dream_session.py module only contained three small helpers
that all revolve around MemoryStore concerns (session keys, commit messages,
file pruning). Fold them into MemoryStore as @staticmethod to reduce
indirection and avoid a 35-line module with no independent reason to exist.

* fix(test): address code review — patch correct instance, use actual function

- Fix test_ephemeral_skips_raw_archive to patch loop.context.memory
  instead of the fixture's separate MemoryStore instance
- Fix TestDreamCommitMessage to call MemoryStore.build_dream_commit_message
  instead of reimplementing the logic inline
- Move Dream helpers in memory.py above the Consolidator section comment
  to avoid misleading visual boundary

* fix(dream): gate cursor advancement and restrict tools

maintainer edit: Dream now processes backlog from the oldest unprocessed entries, only advances the cursor after a completed ephemeral run, and uses a restricted file-only tool registry for background consolidation.

* fix(dream): skip idle compact for dream sessions

Dream runs use internal dream:* sessions that are pruned by Dream retention. Exclude them from AutoCompact scheduling, archive execution, and summary injection so idle-session compaction cannot truncate Dream transcripts.

* fix(dream): keep batched history isolated

* feat(dream): tag archived memory for single-phase Dream

---------

Co-authored-by: Xubin Ren <52506698+Re-bin@users.noreply.github.com>
2026-06-02 22:46:47 +08:00
chengyongru
456ed77e79 fix(webui): bound startup fetch waits 2026-06-02 18:47:34 +08:00
Xubin Ren
7aa5e620be chore(webui): remove useless timezone assignment 2026-06-02 16:18:57 +08:00
Xubin Ren
a371907809 fix(webui): keep tool activity in one thought block 2026-06-02 16:18:57 +08:00
Xubin Ren
fd61203be4 feat(webui): bucket dense prompt rails 2026-06-02 16:18:57 +08:00
Xubin Ren
1af2bc513f feat(webui): add prompt rail navigation 2026-06-02 16:18:57 +08:00
Xubin Ren
e8d4aff5be fix(webui): polish links and thought timing 2026-06-02 16:18:57 +08:00
chengyongru
3e98a03188 fix: support fallback copy for webui replies 2026-06-02 14:08:55 +08:00
chengyongru
1886d22352 fix webui refresh location routing 2026-06-02 14:08:47 +08:00
chengyongru
b2cabb2bd8 fix(webui): keep project heading singular
maintainer edit: render the Projects divider only before the first project group so Chats can sort between projects without duplicating the heading. Add middle and last ordering regression coverage.
2026-06-02 14:08:45 +08:00
chengyongru
a70871679c fix(webui): sort Chats group among projects by recency
In project-based sidebar grouping, the "Chats" section (non-project
conversations) was always appended at the end regardless of its most
recent updated_at. This meant the newest conversation could appear
below older project groups.

Move Chats group insertion before the global sort, compute its
updatedAt from its most recently updated session, and sort all groups
together by updatedAt descending.
2026-06-02 14:08:45 +08:00
Xubin Ren
a4bd4befd4 Fix thought activity ordering 2026-06-01 16:05:42 +08:00
Xubin Ren
be2e0172d1 fix(agent): extend sustained goal iteration budget 2026-06-01 04:00:15 +08:00
Xubin Ren
cba9ff1f57 fix(webui): simplify rendered source links 2026-06-01 00:00:37 +08:00
Xubin Ren
33a13b701b feat(webui): render source links with favicons 2026-06-01 00:00:37 +08:00
Xubin Ren
34386fe676 fix(webui): stabilize streaming output and settings i18n 2026-06-01 00:00:37 +08:00
Xubin Ren
31722120b7 feat(webui): polish native host experience 2026-06-01 00:00:37 +08:00
Xubin Ren
15c6abc991 test(webui): assert code block language fallback 2026-05-31 15:42:40 +08:00
Flinn-X
bdb3a2ded7 fix(webui): handle undefined language in code blocks
When fenced code blocks have no language specifier, react-syntax-highlighter
receives undefined for the language prop, causing a white screen crash.

- CodeBlock.tsx: fallback to 'text' when language is undefined
- MarkdownTextRenderer.tsx: defensive fallback at fence rendering site
- Added test cases for both components

Fixes #4116
2026-05-31 15:42:40 +08:00
Xubin Ren
3dcf511c84
feat(webui): refine output timeline and model controls (#4108)
* feat(webui): refine output timeline and composer queue

* feat(webui): add provider model picker

* fix(webui): polish model settings and heartbeat checks

* chore: keep heartbeat changes out of webui pr

* refactor(webui): isolate settings routes

* fix(providers): align minimax anthropic test

* fix(providers): keep minimax anthropic base sdk-compatible

* fix(providers): normalize anthropic base urls
2026-05-30 23:45:26 +08:00
Xubin Ren
a71e6a0ae8 fix(webui): persist markdown video previews 2026-05-29 17:26:58 +08:00
Xubin Ren
57563b671f fix(apps): recover stale npm installs 2026-05-29 17:26:58 +08:00
Xubin Ren
404b68cdd4 feat(webui): add context window setting 2026-05-29 13:09:08 +08:00
Xubin Ren
3a420136bb
feat(webui): add project workspaces and access controls (#4007)
* feat(webui): add project workspaces and access controls

* feat(webui): add project workspaces and access controls

* refactor(tools): centralize workspace access resolution

* refactor(webui): remove unused workspace host state

* fix(webui): hide estimated file edit label

* fix(webui): clarify file edit deletion feedback

* fix(webui): label deleted file activity

* fix(webui): flatten file edit activity rows

* fix(core): remove path-only patch deletion

* fix(core): keep apply patch non-destructive

* refactor(webui): trim workspace host plumbing

* fix(tools): register exec with tools config
2026-05-29 03:42:53 +08:00
Xubin Ren
9b9b48f1ea chore(webui): restore rollup libc selectors 2026-05-26 17:12:13 +08:00
Stellar鱼
1eddc129a1 chore: enable WebUI ESLint 2026-05-26 17:12:13 +08:00
Xubin Ren
418cb23da2
feat(apps): unify CLI apps and MCP (#3991)
* refactor(cli): load bundled apps from catalog

* feat(plugins): unify CLI and MCP settings

* feat(plugins): add settings category filter

* style(plugins): refine settings catalog

* refactor(cli): load nanobot apps from repo catalog

* feat(store): add capability store entry

* feat(apps): rename capability store

* fix(apps): verify clean app removal

* fix(apps): keep main sidebar on apps view

* feat(apps): add shared app manifest protocol

* fix(apps): dismiss app status message

* refactor(apps): move CLI adapter under apps

* refactor(apps): drop legacy cli apps package
2026-05-25 20:07:02 +08:00
outlook84
d472595417 feat: Add OpenAI API type configuration and update provider settings 2026-05-25 01:23:36 +08:00
Xubin Ren
92915ea424 feat(webui): improve slash command actions 2026-05-24 21:24:54 +08:00
Xubin Ren
c4e2fcaf0c fix(webui): preserve activity duration on replay 2026-05-24 19:43:20 +08:00
Xubin Ren
8fedee276b fix(webui): auto-collapse completed activity 2026-05-24 19:43:20 +08:00
Xubin Ren
547f81e4aa fix(webui): baseline-align activity diff counts 2026-05-24 19:43:20 +08:00
Xubin Ren
00a6e720dc fix(webui): align inline file references with text 2026-05-24 19:43:20 +08:00
Xubin Ren
6ea7a6a2ac refactor(webui): prune unused legacy components 2026-05-24 19:43:20 +08:00
Xubin Ren
704ac558f6 feat(mcp): add preset setup and capability mentions 2026-05-24 19:43:20 +08:00
Xubin Ren
8be258212e fix(webui): handle final stream image rewrites 2026-05-24 19:43:20 +08:00
Xubin Ren
c9ff64fc0f fix(webui): render local CLI image artifacts 2026-05-24 19:43:20 +08:00
Xubin Ren
9efdce276f fix(cli): refresh installed apps after settings changes 2026-05-24 19:43:20 +08:00
Xubin Ren
e2d00ffc8f feat: add CLI Apps settings MVP 2026-05-23 00:33:31 +08:00
Xubin Ren
a5a956d9af fix(webui): preserve localized chat show-more copy 2026-05-23 00:01:52 +08:00
Stellar鱼
8c5acea3b0 chore: fill remaining webui locale keys 2026-05-23 00:01:52 +08:00
yu-xin-c
b1140f6aee chore: fill zh-TW and ja locale keys 2026-05-22 22:38:34 +08:00
Xubin Ren
effc1efd92 fix(webui): avoid misleading file edit counters 2026-05-22 13:58:09 +08:00
Xubin Ren
d660573b18 feat(webui): improve sidebar performance 2026-05-22 03:35:20 +08:00
Xubin Ren
cb7daa77db feat(webui): refine collapsible sidebar 2026-05-22 00:34:42 +08:00
hanyuanling
de0a8f5e41 fix(webui): keep new chat during session refresh 2026-05-21 12:42:56 +08:00
Xubin Ren
eae51333ad fix(providers): point Skywork at APIFree agent endpoint 2026-05-20 12:33:03 +08:00
moran
61ae869610 feat(providers): add APIFree support
Add APIFree as a built-in OpenAI-compatible provider. APIFree offers
agent-optimised models such as skywork-ai/skyclaw-v1 through an
OpenAI-compatible API at https://api.apifree.ai/agent/v1.

Changes:
- Register apifree provider in the provider registry
- Add config schema field
- Add documentation with configuration example
- Add provider tests, websocket channel tests, and webui tests
- Add provider icon in settings UI
2026-05-20 12:33:03 +08:00
Xubin Ren
e00220bdb6 feat(providers): add Skywork provider support 2026-05-20 02:20:44 +08:00
Xubin Ren
cda1de863e Merge remote-tracking branch 'origin/main' into codex/review-pr-3894
# Conflicts:
#	tests/utils/test_webui_transcript.py
2026-05-19 23:19:33 +08:00