Commit Graph

110 Commits

Author SHA1 Message Date
LIziak112
a5e3e0a808 fix: make the repository pre-commit checks portable on Windows (#2966)
Independent maintainer review approved for 257c5e62. Windows Python 3.12 pre-commit 15/15, targeted Windows and WSL Linux regressions passed; latest HEAD CI has no failures.
2026-11-26 18:36:45 +08:00
Bingxi Zhao (Frank)
9e7f44f978 Merge PR #2616: feat(search): add SearchApi provider with web, news and scholar modes
Remove the obsolete Google News link=resolved parameter; preserve returned redirect URLs and verify them with a realistic response fixture.
2026-11-14 23:06:04 +08:00
Bingxi Zhao (Frank)
4c67b87018 Merge PR #2529: feat: add SpecStream as a web search provider
Register both independently added search providers and preserve both provider test cases and display labels.
2026-11-14 23:00:45 +08:00
Gabs Ferreira
c027138329 feat(search): add SearchApi provider with web, news and scholar modes
Add SearchApi (searchapi.io) as a web-search provider, following the Serply
shape: one key, three modes (search -> google, news -> google_news,
scholar -> google_scholar) behind a single GET endpoint selected by the
`engine` parameter. Rows are plain SERP results, so consolidation still
writes the answer and Scholar rows render through the shared academic
template via the `searchapi_scholar` -> `serper_scholar` mapping.

- Key travels only as `Authorization: Bearer`, never in the URL; requests
  carry `Accept: application/json` and `User-Agent: DeepTutor`.
- Google retired `num` for web and news results, so those are cut
  client-side with `max_results`; Scholar still honors `num` (capped at 20).
- News sends `link=resolved` so links point at the publisher instead of a
  Google redirect, and prefers `iso_date` over the relative `date`.
- Scholar maps `publication`, `inline_links.cited_by.total`, `resource.link`
  and `data_cid` onto the Serper attribute keys; a dead `javascript:` PDF
  badge is dropped.
- Non-200 raises with the API's `error` message; a non-JSON body raises too.
- Spec table entry (`requires_api_key=True, soft_fallback=False`), registry
  import, consolidation mapping and `deeptutor init` wizard entry reading
  `SEARCHAPI_API_KEY` / `SEARCH_API_KEY`.
- Nine tests mirroring the Serply block, with fixtures shaped after live
  responses from each engine.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-10 15:58:19 -03:00
evan188199-tech
0a54ec76af feat(search): add DeepSeek standalone SERP provider (POST /v1/tools/search)
Engine-level search provider backed by DeepSeek's /v1/tools/search endpoint,
distinct from the model-side web_search tool mapping: works with any
configured LLM. Rows carry no model-written answer, so consolidation still
supplies it.

- providers/deepseek.py: Bearer auth, count capped 1-50, need_content
  default False (page Markdown kept in SearchResult.content only when
  requested), summary preferred over snippet as the model-facing blurb,
  authority/rerank_score in attributes, proxy honored, base_url used
  verbatim with the documented endpoint as fallback. No new dependency.
- SEARCH_PROVIDERS: label DeepSeek, requires_api_key=True,
  soft_fallback=False (billed per request; a missing key raises instead
  of landing on DuckDuckGo).
- Init wizard entry with DEEPSEEK_API_KEY/SEARCH_API_KEY env keys, keeping
  the wizard set equal to the backend table.
- TracePresentation PROVIDER_LABELS: deepseek -> DeepSeek (titleCase would
  render "Deepseek").
- Tests: row mapping, 401/402/429 paths, missing key fails before network,
  and the base_url/proxy/max_results contract via _NEW_PROVIDERS.
2026-11-09 11:52:03 +08:00
evan188199-tech
7117594329 fix: register SpecStream in wizard and branding for CI 2026-11-09 11:24:08 +08:00
Bingxi Zhao (Frank)
ebcebd4723 Unify migration locks and plugin environments, and cover compatibility boundaries 2026-11-06 02:04:52 +08:00
Bingxi Zhao (Frank)
2cc3c4ae27 Merge #2317 from rudycelekli 2026-11-06 01:56:40 +08:00
Bingxi Zhao (Frank)
b320e367b1 Merge #2265 from tanishqbaweja 2026-11-06 01:56:39 +08:00
Bingxi Zhao (Frank)
94e8c2a81b Merge #2460 from Bortlesboat 2026-11-06 01:56:27 +08:00
Bortlesboat
f8540eb5c7 fix(cli): print session and notebook JSON without Rich markup or wrapping
`session show --format json`, `notebook show --format json` and
`notebook create` passed json.dumps() output to console.print(), which
treats a plain string as Rich text: long lines were wrapped inside JSON
strings (invalid JSON), [bracketed] text was dropped, a stray closing
tag such as [/INST] raised MarkupError, and :name: codes became emoji.

Use console.print_json() as the kb, config and doctor commands already
do, and turn off emoji codes in the `run --format json` NDJSON stream,
which already disabled markup and wrapping.
2026-11-05 00:37:16 -05:00
Rudy Celekli
bbdf745f42 fix(cli): decode non-UTF-8 markdown in notebook add-md/replace-md
`notebook add-md` and `replace-md` read the file with read_text(encoding="utf-8"),
so a markdown file in another encoding (e.g. a Windows-authored cp1252/latin-1
file) aborted the command with an uncaught UnicodeDecodeError traceback instead
of the clean CLI errors these commands raise for other problems.

Read the bytes and decode through FileTypeRouter.decode_bytes, the shared
fallback-encoding chain the rest of the app already uses for text input (as in
`deeptutor notebook`'s sibling `kb` command).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-01 09:34:39 -05:00
Rudy Celekli
1eb4d01d07 fix(cli): do not crash the chat REPL on a malformed /notebook add ref
In the interactive chat REPL, `/notebook add <ref>` passed the ref straight to
_parse_notebook_refs, which raises typer.BadParameter on an empty notebook id
(e.g. `/notebook add :`). The REPL loop does not guard the _apply_command call,
so the exception propagated out and terminated the whole session — while every
other command (bad /config, unparsable shlex input, etc.) just prints a notice
and keeps the session alive.

Catch BadParameter at the `/notebook add` site, print the message, and continue.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-01 09:09:34 -05:00
Tanishq
22aa804d6f fix(cli): replace unencodable characters in piped output instead of crashing
On Windows, piped or redirected output uses the ANSI code page, and a
character outside it (an emoji or check mark in a model reply, CJK text
on a cp1252 system, a CJK notebook name, the Chinese help of skill login)
raised UnicodeEncodeError: the command exited 1 and the rest of its
output was lost. deeptutor run --format json stopped after three events.

main() now calls the launcher's _relax_console_encoding(), which
deeptutor start has used since #702: the streams keep their encoding and
characters it cannot represent are written as "?".
2026-11-01 01:40:29 +05:30
Bingxi Zhao (Frank)
2c47cc22ce fix(integration): authenticate search and regenerate route contracts 2026-10-29 01:19:18 +08:00
Bingxi Zhao (Frank)
5ad749ac9c Merge pull request #2025: You.com search provider 2026-10-29 01:13:31 +08:00
Bingxi Zhao (Frank)
031b801c80 Merge pull request #2026 into validated PR integration 2026-10-29 00:56:14 +08:00
Bingxi Zhao (Frank)
dd31a77f58 Merge pull request #2076 into validated PR integration 2026-10-29 00:56:11 +08:00
Bingxi Zhao (Frank)
1ea7df1554 docs: consolidate developer and agent handbook 2026-10-29 00:36:18 +08:00
Bingxi Zhao (Frank)
a6389d7ee8 docs: align agent and manual setup with modular dev 2026-10-28 19:34:11 +08:00
Bingxi Zhao (Frank)
e99d632de5 fix: prepare modular installs and align dev documentation 2026-10-28 19:02:44 +08:00
Bingxi Zhao (Frank)
efc6604c44 fix: close CLI runtime before event loop shutdown 2026-10-28 01:49:21 +08:00
Bingxi Zhao (Frank)
fbab59acbf feat: modularize installation and enforce feature dependency boundaries 2026-10-28 01:02:29 +08:00
Bingxi Zhao (Frank)
e347c0c2e0 fix: preserve tutoring replies and stabilize preview runtime
Keep learner-facing explanations visible across finish checks, persistence, and replay. Remove mastery prose heuristics and prioritize learner objections.

Coordinate service shutdown and descendant cleanup, and preserve video lesson identity and playable results across chat completion and reload.
2026-10-27 17:58:46 +08:00
aleekaz
ac742e572f feat(search): add google-browser-scraper as a self-hosted Google provider 2026-10-26 20:46:26 +03:00
XZH
8f131c4fd4 fix(cli): raise reasoning probe budget (#1220) 2026-10-22 14:29:39 -07:00
XZH
0d26c4b1f4 feat(search): add You.com provider (#1915) 2026-10-22 13:40:22 -07:00
Kung
5c6997c552 feat(cli): add kb eval --rewrite and kb eval-diff for A/B comparison
- kb eval gains --rewrite [off|standalone] to force the query-rewrite layer per run (omit to defer to settings), so the same QA set can be scored with the layer on and off for a like-for-like diff.
- kb eval-diff BASELINE CANDIDATE reads two saved --save reports and prints per-metric and per-case movement (rich table, or --format json), quantifying whether a retrieval change helped.
2026-10-11 15:08:18 +08:00
Bingxi Zhao (Frank)
6cf793bd86 release: v1.6.14
Ship original-source visual practice, recoverable indexing, unified video
Reading, scientific research tools, managed plugins, and a learning journal
as summarized in assets/releases/ver1-6-14.md.

Improve provider setup and protocol-aware endpoints. Restore missing
localized setup and Ukrainian UI text, keep plugin loading in the plugin
layer, harden research XML parsing, and repair isolated test fixtures and
type-checking errors found by the release gate.

Sync README prose and all eleven translations, bump the package version,
and update the stable release announcement.

Validation: 10180 Python tests and 8 subtests passed (28 skipped); 1303
Node tests passed on Node 22; 24 provider UI tests passed. All pre-commit
hooks, ruff, translation checks, documentation checks, and docs build passed.
2026-10-08 11:34:42 +08:00
Bingxi Zhao (Frank)
7885daa98a feat(plugins): add reviewed managed lifecycle and revocable runtime gates (#1307)
Adapt the Phase 1 foundation from PR #1309 and complete scoped API lifecycle, pre-import approval, artifact-bound revocation, recovery, bounded workers and frontend isolation. Keep the stronger ecosystem roadmap explicit in the RFC.

Co-authored-by: XZH <cto@xzh.ai>
2026-10-08 08:50:05 +08:00
Bingxi Zhao (Frank)
e49f518669 Reconcile user setup and provider changes with all reviewed PRs 2026-10-07 20:54:24 +08:00
Yongliang
b19a837457 feat(cli): add GitHub Copilot device login to init (#1277)
* Save uncommitted changes

* fix: isolate Copilot credentials and honor model routing

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix: normalize Copilot Responses history replay

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix: correct Copilot model discovery and response language

Honor Astra temperature restrictions, synchronize response language preferences, and preserve system prompts in Responses requests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Keep Copilot integration focused on owner authentication and runtime

---------

Co-authored-by: Yongliang Wang <yonwa@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-10-07 20:50:55 +08:00
Bingxi Zhao (Frank)
33c95086f6 refactor(runtime): share home-dependent cache reset implementation 2026-10-07 20:39:30 +08:00
Bingxi Zhao (Frank)
fb2065b6a9 Preserve current provider configuration and settings scroll work 2026-10-07 20:38:11 +08:00
Bingxi Zhao (Frank)
f8be756906 Integrate saved user workspace changes with reviewed dev updates 2026-10-07 20:37:55 +08:00
evan188199-tech
3a192f6a53 fix(runtime): log swallowed launcher, init and update-worker failures (#1704)
* fix: log singleton reset failures instead of swallowing them

_reset_runtime_singletons() (deeptutor_cli/init_cmd.py and
deeptutor/runtime/launcher.py) swallowed every exception while dropping
cached PathService/RuntimeSettings/ModelCatalog singletons. A failed
PathService reset leaves the previous home's cached paths in place, so
deeptutor init --home / launcher start silently keep writing into the
old workspace. Log PathService failures at ERROR and cache-clear
failures at WARNING so the misdirection is observable.

* fix(launcher): log handoff failure when mark_failed fails too

_handoff_pending_update wrapped the fallback store.mark_failed in a bare
'except Exception: pass'. When the handoff itself failed and recording
the failure failed again (corrupt state, IO error), the launcher shut
down with no persistent trace of either error. Keep the minimal fix:
emit a fallback log naming the update job, the handoff error and the
recording error before returning False.

* fix(update): log and skip recovery when job state is unreadable

The update worker's recovery path wrapped store.load() in a bare
except-pass: with a corrupt state.json the failed-update bookkeeping and
the app restore were skipped silently, leaving the job stuck and no
trace in worker.log. Load failures now append a durable record (load
error plus the original failure) to the store log and skip the round
without touching the damaged state.

* test(codebuddy): make credential fixture expiry relative to now

test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.

Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.

---------

Co-authored-by: XZH <cto@xzh.ai>
2026-10-07 20:37:37 +08:00
Bingxi Zhao (Frank)
dcb157886d fix(rag-eval): discount duplicate gold and keep JSON output parseable 2026-10-04 15:04:24 +08:00
Kung
fb8effd98a chore: merge upstream dev (v1.6.12) to resolve README conflict 2026-09-29 16:45:35 +08:00
Kung
9808ca42ee feat: add kb eval command for RAG retrieval quality scoring 2026-09-29 14:45:27 +08:00
Bingxi Zhao (Frank)
176257b1f8 style: format knowledge source integrations 2026-09-27 11:15:15 +08:00
Bingxi Zhao (Frank)
64c2316093 Add connected Kiwix ZIM knowledge sources 2026-09-27 11:01:04 +08:00
Bingxi Zhao (Frank)
da856ad670 release: v1.6.9
Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.

Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.
2026-09-21 02:30:40 +08:00
evan188199-tech
9b066b5f98 feat(sessions): add recycle bin for deleted chats (#1398)
* feat(sessions): add recycle bin for deleted chats

Implements soft-delete for chat sessions so users can restore
accidentally deleted conversations from a recycle bin.

Backend:
- Schema migration adds deleted_at REAL column to sessions
- delete_session becomes a soft-delete (sets deleted_at timestamp)
- New store methods: restore_session, purge_session, list_deleted_sessions
- Session list queries exclude soft-deleted sessions
- API endpoints: GET /sessions/recycle-bin, POST /{id}/restore,
  DELETE /{id}/purge (purge triggers attachment/mastery cleanup)

Frontend:
- RecycleBinSection: collapsible sidebar section listing deleted
  sessions with Restore and Delete permanently actions
- Wired into SidebarShell via recycleBinSlot prop
- API client functions for list, restore, and purge
- en/zh translations for all recycle-bin UI strings

Tests: 6 backend tests covering the soft-delete lifecycle

* style: apply ruff format to sqlite_store

* fix(sessions): preserve recycled chat artifacts

* feat(sessions): fold #1444's backend into this recycle bin

#1444 built the same feature from the other end. This PR had the SQLite
column, the routes and the sidebar UI; #1444 had the protocol declarations,
the PocketBase implementation and the CLI wording. Neither shipped alone —
this one left multi-user deployments answering AttributeError on
/recycle-bin, and #1444 built a bin nobody could see. Closes #1444; its
backend is here.

Kept from here: one `deleted_at` column. #1444 carried `is_deleted` beside it
in both backends, and `deleted_at IS NOT NULL` already says everything the
boolean did — PocketBase now derives the outward `is_deleted` field from the
timestamp instead of storing it twice.

Taken from #1444: the naming, which turns out to fix the residual both PRs
shipped with. `delete_session` keeps meaning what every existing caller
already meant by it — remove the row — so `reading.py`'s two internal
cleanups need no patch: a deleted reading workspace still takes its sessions
with it instead of depositing them in a learner's bin, where restoring one
would resurrect a session pointing at a workspace that no longer exists. The
chat surface's delete is a separate, explicitly named `soft_delete_session`,
and `hard_delete_session` empties the bin. Both backends agree, and the
protocol declares all five so a backend cannot silently lack one again.

`test_entries_cascade_on_session_purge` becomes two tests, because there are
now two deletions worth pinning: one the bin can undo, and one that skips it
and cascades immediately.

Co-Authored-By: sjagadee <srini.jagadeesh@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: XZH <cto@xzh.ai>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: sjagadee <srini.jagadeesh@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 01:43:35 +08:00
evan188199-tech
4c2428db09 fix(api): preserve actual proxy peer identity (#1426) (#1427)
Co-authored-by: XZH <cto@xzh.ai>
2026-09-14 01:28:09 +08:00
Bingxi Zhao (Frank)
04040a2c06 release: v1.6.5
Ship a content workspace you choose, one exec tool for every language,
Mastery Path modes that gate its tools, and Settings that grades
readiness instead of listing faults.

Release notes: assets/releases/ver1-6-5.md
2026-09-06 13:46:29 +08:00
Bingxi Zhao (Frank)
02ba56793e chore: checkpoint backend stabilization workspace 2026-09-01 21:28:15 +08:00
Bingxi Zhao (Frank)
921078ac3b fix(runtime): make Windows launcher browser-safe (#1147) 2026-09-01 02:51:40 +08:00
Bingxi Zhao (Frank)
3dc372f551 release: v1.6.2 — immersive watching and extensible visualizers
Add synchronized YouTube learning, a plugin-driven visualizer catalog, and Hermes, OpenClaw, and DeepSeek agent harnesses. Refresh Reading, Knowledge, Partner status, guided updates, documentation, translations, and release notes for v1.6.2.
2026-08-31 01:13:07 +08:00
XZH
b984b8709c fix(skills): scope ClawHub installs by publisher (#639) 2026-08-27 11:19:22 -07:00
XZH
0d8b734a76 feat(knowledge): add web source sync 2026-08-26 02:26:58 +08:00