Commit Graph

1105 Commits

Author SHA1 Message Date
Bingxi Zhao
e0023d3214 Merge pull request #652 from eason2026/fix/siliconflow-encoding-format
fix(embedding): don't send encoding_format by default for OpenAI-compatible providers
2026-07-23 22:38:31 +08:00
Bingxi Zhao (Frank)
26d388fc02 refactor(book): drop orphaned openBookSocket after WS migration
The persistent-listener useEffect that used openBookSocket was removed in
#658 when confirm-proposal/compile-page moved onto per-operation sockets
via runBookSocketOperation. The exported helper had no remaining callers;
remove it and keep only the BookWsEvent re-export.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 22:37:21 +08:00
Bingxi Zhao
e098da6696 Merge pull request #658 from suainam/fix/book-websocket-long-operations-dev
fix(book): stream long-running operations over WebSocket
2026-07-23 22:34:57 +08:00
Bingxi Zhao
27ad1f5849 Merge pull request #654 from binyangzhu000-sudo/codex/add-atlascloud-provider
Add Atlas Cloud LLM provider
2026-07-23 22:32:51 +08:00
Bingxi Zhao (Frank)
10a72b076e Merge branch 'dev' into codex/add-atlascloud-provider
# Conflicts:
#	tests/services/test_provider_registry.py
2026-07-23 22:32:18 +08:00
Bingxi Zhao
307d4352b6 Merge pull request #670 from santhreal/fix/safe-filename-strip-controls
fix(partners): strip control chars in safe_filename
2026-07-23 22:30:23 +08:00
Bingxi Zhao
ed078122f0 Merge pull request #644 from santhreal/fix/split-message-nonpositive-maxlen-dev
fix(partners): avoid hang in split_message when max_len <= 0
2026-07-23 22:29:02 +08:00
Bingxi Zhao
d0306b8fa4 Merge pull request #657 from Sanjays2402/fix/codex-url-provider-detection
fix: require explicit OpenAI Codex selection
2026-07-23 22:27:38 +08:00
Bingxi Zhao
b0ec5daba5 Merge pull request #646 from santhreal/fix/update-facts-raw-decode-dev
fix(memory): parse update facts JSON with raw_decode
2026-07-23 22:26:55 +08:00
Bingxi Zhao
2460b3ec7a Merge pull request #645 from santhreal/fix/line-doc-raw-decode-edits-dev
fix(memory): parse line-edit JSON with raw_decode
2026-07-23 22:26:47 +08:00
Bingxi Zhao
5dbf537f34 Merge pull request #668 from santhreal/fix/json-parser-raw-decode-trailing
fix(utils): decode trailing-prose JSON before repair
2026-07-23 22:26:31 +08:00
Bingxi Zhao
3d51623663 Merge pull request #667 from santhreal/fix/quiz-payload-raw-decode
fix(question): parse quiz JSON with raw_decode
2026-07-23 22:26:22 +08:00
Bingxi Zhao
ca9aae3c69 Merge pull request #669 from santhreal/fix/extract-code-block-optional-newline
fix(visualize): allow code fences without a blank closing line
2026-07-23 22:26:14 +08:00
Bingxi Zhao
77bc735669 Merge pull request #663 from cmddirexit/fix/cli-utf8-terminal-input
fix(cli): harden UTF-8 terminal input handling
2026-07-23 22:26:04 +08:00
santhreal
19789f19be style(utils): one-line comment on trailing-prose JSON decode 2026-07-22 22:52:15 -07:00
santhreal
968038f756 style(question): one-line comment on quiz JSON raw_decode 2026-07-22 22:52:14 -07:00
santhreal
240ad1afbe fix(partners): strip control chars in safe_filename
Embedded null bytes survived sanitization and made path.write_bytes raise
ValueError on partner attachment uploads. Strip controls and collapse
dot-only names, matching DocumentValidator posture.
2026-07-22 22:49:07 -07:00
santhreal
5d5c2ef36e fix(visualize): allow code fences without a blank closing line
Models often close a fenced block on the same line as the last content.
Require only an optional newline before the closing fence so mermaid and
chart payloads are extracted instead of returned still-fenced.
2026-07-22 22:49:05 -07:00
santhreal
5c3e5bf560 fix(utils): decode trailing-prose JSON before repair
json-repair wrapped a valid object plus trailing brace-prose into an array,
corrupting book/question callers that expect a single object. Prefer
raw_decode of the first JSON value before repair.
2026-07-22 22:49:04 -07:00
santhreal
aee2e76c1e fix(question): parse quiz JSON with raw_decode
Trailing prose that contains braces made the greedy brace slice invalid, so
valid quiz payloads were dropped to {}. Decode the first JSON object instead.
2026-07-22 22:49:03 -07:00
wcl
4bd326405a refactor: centralize terminal input handling 2026-07-22 16:45:17 +08:00
wcl
4b8016cf01 fix: harden CLI UTF-8 terminal input 2026-07-22 16:31:22 +08:00
Bingxi Zhao (Frank)
2fcc8b18f9 myagent update - mimo code, gemini cli, opencode, kimi cli 2026-07-21 20:23:42 +08:00
dsl_mac
649230776a fix: stream long-running book operations 2026-07-21 16:55:58 +08:00
Sanjay Santhanam
14cd912d38 fix: require explicit OpenAI Codex selection
Stop generic OpenAI-compatible endpoints whose hostname contains codex from being routed through the OAuth-only backend. Add a provider-registry regression test.
2026-07-20 20:38:23 -07:00
binyangzhu000-sudo
0d898690be Add Atlas Cloud LLM provider 2026-07-20 18:53:20 +08:00
eason2026
df55052de1 fix(embedding): don't send encoding_format by default for OpenAI-compatible providers
SiliconFlow and other OpenAI-compatible providers reject the
`encoding_format` parameter with HTTP 400. Only send it when
explicitly set by the user, matching the existing opt-in pattern
used for `dimensions` (send_dimensions flag).

Closes #651
2026-07-20 14:45:30 +08:00
Bingxi Zhao (Frank)
b728354863 release: v1.5.2
Configurable chat attachment limits, PageIndex retrieval by reasoning
over your documents, broader Anthropic/OpenAI model support, and a
sweep of Book / Knowledge Base / chat-UI reliability fixes. Drop-in —
no migrations.

- attachments: size caps + extraction budgets editable in Settings →
  Chat → Attachments (admin), stored in system.json with CHAT_ATTACHMENT_*
  env overrides; the WebSocket frame ceiling is now derived from the
  total cap, fixing large uploads silently dropping the connection.
- pageindex: chat retrieves via an internal MCP server (agentic tool
  calls over the document tree); search() returns the outline; ingestion
  accepts PDF/Office/Markdown/text/CSV.
- llm: newer Anthropic/OpenAI models via official SDKs incl. Codex native
  tools; effort-based Claude → adaptive thinking; corrected temperature-
  rejection set; streamed usage counted once per completion.
- book/knowledge: rescue stuck GENERATING/PLANNING pages + reset on
  failure; KB status updates on upload/sync; atomic manager writes.
- web/channels: full-width chat + single scrollbar, aligned composer,
  Enter sends edited message, malformed-markdown crash fix; WeCom aligned
  with SDK 1.0.8; Mastery recency weighting restored (#618).
- release notes ver1-5-2.md (v1.5.0/v1.5.1 archived to past_releases/),
  __version__ bump to 1.5.2, README Releases row + one-week fold.
- README Settings/config prose + all 10 translations synced; docs
  settings/knowledge/chat pages updated separately in site/.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
v1.5.2
2026-07-19 17:15:36 +08:00
Bingxi Zhao (Frank)
c0037dfb58 fix chat attatchments 2026-07-19 16:56:34 +08:00
santhreal
eee0431fff fix(memory): parse update facts JSON with raw_decode
Trailing prose with braces made the greedy rfind slice invalid, so
_parse_facts silently dropped valid facts. Decode the first object.
2026-07-18 17:26:33 -07:00
santhreal
69582220ef fix(memory): parse line-edit JSON with raw_decode
Trailing prose containing braces made the greedy rfind slice invalid,
so parse_edits_payload silently dropped valid edits. Decode the first
JSON value like math_animator.
2026-07-18 17:23:57 -07:00
santhreal
b10089741a fix(partners): avoid hang in split_message when max_len <= 0
When max_len is 0 or negative, the cut pointer never advances and split_message loops forever.
Return the content unsplit, matching the nanobot helpers pattern.
2026-07-18 17:13:19 -07:00
Bingxi Zhao (Frank)
b030697df7 refactor(web): shared IME-composing hook + citation-anchor helper; symmetric scrollbar gutter
Follow-up to #615/#608/#634: the isComposingRef + composition-handler
trio duplicated across five textareas (ComposerInput,
SimpleComposerInput, ChatMessages edit, BookChatPanel, PartnerComposer)
becomes one useImeComposing() hook; the citation-anchor fallback chain
+ <details> auto-open duplicated in both markdown renderers moves to
lib/markdown-anchors.ts; and the chat scrollport reserves the
scrollbar gutter on both edges so the message column centers on the
same axis as header and composer on classic-scrollbar platforms.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:38:06 +08:00
Bingxi Zhao (Frank)
9d285f1078 fix(wecom,parsing): bound the reply-frame cache; harden img_path anchoring
Follow-up to #631/#628: wecom's _chat_frames now uses the same
LRU-bounded OrderedDict idiom as the dedup cache (cap 1000) so
long-running bots can't grow it unboundedly, frame-body extraction is
deduped into one helper, and the dead _loop attribute is gone.
_absolutize_img_paths now skips non-string entries and refuses to
anchor traversal paths ('..' components) with a warning, so a crafted
content_list cannot point the vision stage outside the cache dir.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:38:06 +08:00
Bingxi Zhao (Frank)
2407c7cc16 refactor(agentic/auth): builder table couples native adapters to the tool allowlist; cookie name constant
Follow-up to #626/#625: _build_native_provider_adapter becomes a
_NATIVE_ADAPTER_BUILDERS dispatch table with the invariant documented
(every backend in _NATIVE_TOOL_BACKENDS must have an adapter branch)
and pinned by a test; ws_require_auth reads the dt_token cookie via
_COOKIE_NAME instead of a string literal.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:38:06 +08:00
Bingxi Zhao (Frank)
1a0c316625 refactor(knowledge): atomic JSON writes everywhere; reindex shares the pre-dispatch helper
Extends the #619 follow-up to the remaining plain truncate-writes of
metadata.json (add_documents, initializer, reindex task) and replaces
progress_tracker's hand-rolled fixed-name temp+replace with the shared
atomic_write_json. _mark_kb_queued_for_processing gains a status kwarg
so the reindex endpoint's pre-dispatch write uses the same seam as
upload/sync instead of an 11-line inline block.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:37:47 +08:00
Bingxi Zhao (Frank)
294849d1e5 fix(book): rescue PLANNING pages too; contain storage I/O in the worker loop
Follow-up to #636: _mark_page_error now also resets pages stranded at
PLANNING (plan_blocks_async can throw after the status is persisted),
and the background worker's log-append and finalize check are wrapped
so a storage hiccup can neither skip the page reset nor kill the
worker task.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:37:47 +08:00
Bingxi Zhao (Frank)
3f03d4eabd refactor(agentic): one shared once-per-stream usage recorder
Follow-up to #617, which fixed the N× inflation at three call sites and
left the pattern triplicated. record_streamed_usage() +
message_content_chars() in core/agentic/usage.py now serve
run_labeled_step, chat's _call_llm, and the question summarizer; the
redundant _UsageShim (UsageTracker already unwraps .usage), the dead
before_usage_calls guard, and both private _message_content_chars
copies are gone, along with an unreachable try/except around a dict
assignment. Accounting failures are now swallowed and debug-logged at
every site — usage bookkeeping can never break a completed stream.
Adds contract tests for the shared recorder.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:37:47 +08:00
Bingxi Zhao (Frank)
6718d04540 fix(llm): route effort-based Claude families to adaptive thinking instead of budget_tokens
Follow-up to #642: _build_kwargs still emitted thinking={enabled,
budget_tokens} for any configured reasoning_effort, which the same
families that reject temperature (Opus 4.7/4.8, Sonnet 5, Fable 5)
reject with a 400 — so the exact setups #642 enabled failed on every
request once an effort level was set. Real effort levels now map to
adaptive thinking there (no budget headroom inflation), thinking-off
sentinels (none/minimal/minimum) omit the param entirely (explicit
disabled is itself rejected on Fable 5), and Opus 4.6/Sonnet 4.6 keep
the enabled+budget_tokens path unchanged. The constant is renamed to
_EFFORT_BASED_FAMILIES since it now gates both removed params.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:25:59 +08:00
Bingxi Zhao
11f8262826 Merge pull request #634 from Alanaysis/fix/chat-full-width-scroll
fix: chat page not full width, scrollbar only works in middle area
2026-07-19 01:10:03 +08:00
Bingxi Zhao (Frank)
9781583455 fix: restore composer/message column alignment and loading-view height
The full-width refactor removed the parent px-6 inset the composer used
to sit inside, leaving the composer card 48px wider than the message
column. The composer root now carries its own px-6 (with the empty-state
cap bumped 720->768 so content width is unchanged in both states), and
the session-loading wrapper passes full height through so
SessionLoadingView's absolutely-positioned cancel button stays at the
chat-area corner instead of collapsing next to the spinner.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:09:47 +08:00
Bingxi Zhao (Frank)
c2e5eaf506 Merge remote-tracking branch 'origin/dev' into fix/chat-full-width-scroll 2026-07-19 01:06:53 +08:00
Bingxi Zhao
709c859307 Merge pull request #635 from Marnie0415/fix/kb-upload-status
fix(knowledge): update KB status to processing on file upload and sync-folder
2026-07-19 01:05:49 +08:00
Bingxi Zhao (Frank)
c463ab8387 refactor: shared pre-dispatch status helper + valid live-progress stage + regression test
Rebased onto dev (the original base, multi-user, is a stale v1.3.8
ancestor). The two duplicated inline update_kb_status blocks become one
_mark_kb_queued_for_processing helper, and the progress stage changes
from 'processing' (not a member of the frontend's LIVE_PROGRESS_STAGES
set, so the UI would not render live progress) to 'starting', matching
the reindex endpoint's pre-dispatch convention. Adds a router regression
test pinning status/stage/task_id before background dispatch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:05:38 +08:00
Bingxi Zhao (Frank)
4a9db5e418 Merge remote-tracking branch 'origin/dev' into fix/kb-upload-status 2026-07-19 01:02:21 +08:00
Bingxi Zhao
28670a5b0c Merge pull request #642 from ShiGaChenTW/fix/anthropic-newer-model-support
fix: support newer Anthropic models via the official SDK
2026-07-19 01:00:28 +08:00
Bingxi Zhao (Frank)
2116ae8ca2 fix: correct temperature-rejection model set + skip tests where anthropic SDK absent
Opus 4.6 and Sonnet 4.6 still accept `temperature` — omitting it there
silently dropped the user's configured setting; and `opus-5`/`haiku-5`
matched no real model id. The set is now a documented module constant
covering exactly the effort-based families that 400 on temperature
(opus-4-7/4-8, sonnet-5, fable-5, mythos-5), with regression coverage
both ways. The new test file also gains pytest.importorskip('anthropic')
so it skips cleanly in environments without the optional [cli] SDK
(e.g. the CI python-tests job) instead of erroring on construction.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 01:00:12 +08:00
Bingxi Zhao
9c8b6b5333 Merge pull request #636 from Marnie0415/fix/book-page-stuck-generating
fix(book): reset page status on compilation failure (worker + inline)
2026-07-19 00:56:26 +08:00
Bingxi Zhao (Frank)
68aa57cff9 fix(book): harden worker-loop error reset — per-iteration page binding + shared best-effort helper
The except handler referenced `page`, which is bound only after the
loaders succeed: a loader failure on the first queue item raised
UnboundLocalError inside the handler and killed the worker task, and on
later iterations the handler could flip the previous iteration's stale
page to ERROR. `page` is now re-bound to None every iteration, both
reset paths share one _mark_page_error helper, and the save is
best-effort so a failing save cannot mask the original error or kill
the worker either. Adds regression tests for the helper's contract.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 00:56:01 +08:00
Bingxi Zhao
1d6b741270 Merge pull request #617 from mikezobern/fix/stream-usage-double-count
fix: count streamed LLM usage once per completion
2026-07-19 00:51:48 +08:00