Commit Graph
352 Commits
Author SHA1 Message Date
chengyongru 3f65a8f86c fix(models): route image input by preset capability (#6651)
* fix(providers): preserve images across retries and recovery

Remove destructive text-only retries and validate tool image media at the boundary. Keep image identity across native transport preparation and compaction, and stop incomplete fallback or continuation without replaying tools.

Resolves NAN-442

* fix(models): route image input by preset capability

Replace the expanded image recovery and tool-format changes with an explicit supportsImages preset setting, capability-aware fallback selection, and an Image input switch in model settings. Keep original messages on retry and fail on actual non-transient image errors.

* docs(models): introduce image input settings positively

* test(agent): align image request fixtures with preset routing

Cover successful image requests and direct validation errors when attributing model responses. Configure the image-capability check for the existing text-only provider mocks so governance and override-reuse tests exercise their scripted primary/fallback paths.
2026-11-13 18:16:58 +08:00
Xubin Ren 0f5e56edd4 refactor(execution): share bounded HTTP redirects (#6637) 2026-11-13 14:55:07 +08:00
chengyongruandxiong-wei1 8cce73465b fix(tools): validate arguments with jsonschema without coercion (#6648)
Co-authored-by: xiong-wei1 <2318942410@qq.com>
2026-11-13 13:32:12 +08:00
Xubin Renandchengyongru 5c1083df7f refactor(config)!: retire the old OpenAI API selector (#6615)
Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-11-11 17:07:18 +08:00
chengyongru 1a89a25abd perf: reduce memory copies across files, sessions, and model requests (#6581) 2026-11-06 17:50:25 +08:00
c8dba74fc5 fix(codex): fail closed on TLS certificate errors
Keep certificate and hostname verification enabled for HTTP and WebSocket requests. Honor explicit CA trust without changing configured proxy routing.

Co-authored-by: Wu Shuwen <mikewushuwen@outlook.com>
Co-authored-by: Xubin Ren <52506698+Re-bin@users.noreply.github.com>
2026-11-04 23:33:49 +08:00
chengyongru 34bab234b5 fix(compaction): retain native state across retry and recovery (#6558)
* fix(compaction): retain native state across retry and recovery

Accept successful native compaction before generation, checkpoint its durable continuation, and reuse it across provider retry and fallback scopes. Preserve pending tool pairs and temporary-session ownership boundaries.

Resolves NAN-404

* test: fix native compaction regression imports
2026-11-04 16:28:45 +08:00
chengyongru 3545539128 fix(providers): update compaction retries in place (#6549)
* fix(providers): keep compaction retries in one status lifecycle

* refactor(providers): avoid redundant lifecycle copy on state reset
2026-11-03 18:17:45 +08:00
chengyongruandKDB 58a05ea3e0 fix(providers): prevent image retries from bypassing required compaction (#6548)
Co-authored-by: KDB <937925477@qq.com>
2026-11-03 15:36:36 +08:00
chengyongruandXubin Ren 8b37976d36 fix(providers): tighten tool calls and compatibility fallbacks
Require structured tool calls and explicit unsupported-feature errors.
Preserve supported SDK compaction requests and add compatibility coverage.

Co-authored-by: Xubin Ren <52506698+Re-bin@users.noreply.github.com>
2026-10-31 11:55:13 +08:00
chengyongru a4d2430140 refactor: remove redundant comments and docstrings (#6527)
* refactor: remove redundant comments and docstrings

* fix(signal): annotate async context manager as a generator
2026-10-30 13:07:03 +08:00
chengyongru 4e77d9c3f2 fix(retry): prevent replay amplification and isolate backoff (NAN-313) 2026-10-29 11:13:44 +08:00
chengyongru f23a6d1485 refactor: remove verified unused internals (#6460)
* refactor: remove verified unused internals

* test(linear): synchronize webhook shutdown with writer join
2026-10-26 21:45:36 +08:00
chengyongru 67f6a0d26e perf(sdk): reuse consecutive effective model overrides (#6434)
* perf(sdk): reuse consecutive effective model overrides

* fix(runtime): preserve lazy fallback validation during override reuse
2026-10-24 20:57:06 +08:00
chengyongru 03e9b5430b fix(providers): support Kimi K3.1 Pro request parameters
Extend the existing K3 parameter contract to K3.1 Pro and its high-speed variant, including the WebUI reasoning choices.

Refs NAN-347
2026-10-24 02:21:28 +08:00
DDTandDDT a88c333466 fix(providers): use reasoning_text for DeepSeek Responses reasoning replay
DeepSeek's Responses API documents reasoning content blocks as
reasoning_text. Full-history replay of assistant reasoning_content was
emitting output_text inside the reasoning item. Assistant message
content stays output_text.

Fixes #6411

Co-authored-by: DDT <1786035110@qq.com>
2026-10-23 22:14:56 +08:00
SaladDayandchengyongru 0254bf1217 feat(providers): add MiniMax-M3.1-Flash and avoid reasoning_split=false (#6360)
Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-10-23 14:15:12 +08:00
chengyongru 254f94b068 feat(attachments): support local files and video attachments (#6321)
* feat(attachments): support local files and video attachments

Share gateway inspection and send validation for borrowed local paths while preserving binary uploads, original-file ownership, and existing limits.

Related to NAN-284. Native provider video input remains outside this change.

* test: make cross-platform verification fixtures self-contained

* test(webui): align typed fixtures with runtime contracts

* fix(webui): preserve uploaded video playback during history sync

* test(tui): preserve local attachment drafts across resizes

* perf(attachments): preserve upload caches and release video previews

* docs(webui): keep attachment guidance user-focused

* chore: remove redundant dependency comment

* test(providers): make stream idle renewal timing deterministic

* fix(attachments): keep upload byte limits out of local references

Validate common format/count rules separately from upload byte budgets. Keep local inspection and send-time checks metadata-only, and exclude local references from composer and pending-upload totals. Explain upload size rejections with actual size and maximum in all ten locales. Related to NAN-284.

* fix(attachments): retain image references and draft order

* fix(attachments): close local reference UX and authorization gaps

* fix(attachments): preserve focus during asynchronous path confirmation
2026-10-22 18:32:18 +08:00
chengyongru abfe510ce1 test: remove unreachable cases and strengthen weak assertions 2026-10-22 17:19:20 +08:00
chengyongru bc5c58d239 feat(webui): distinguish context compaction reasons (NAN-324) (#6389)
* feat(webui): distinguish context compaction reasons (NAN-324)

* fix(webui): describe idle compaction cancellation as interruption

* docs: omit compaction notice details from configuration guide

* fix(i18n): make compaction notices read naturally

* fix(i18n): keep CJK compaction notices concise

* fix(i18n): describe idle compaction as unfinished
2026-10-22 16:13:25 +08:00
chengyongru 084b6bb394 feat(network): centralize proxy settings and add MCP routing (NAN-315) (#6372)
* feat(network): share proxy settings across features and MCP (NAN-315)

* fix(network): address shared proxy review regressions

* test(network): align rebased OAuth fixtures with runtime admission

* fix(webui): configure shared proxy without leaving connection drafts

* feat(webui): add optional shared proxy authentication editor

* fix(webui): align proxy save tests and loading skeleton
2026-10-22 15:49:27 +08:00
chengyongru be43d2a5f8 fix(compaction): align native lifecycle and reconcile replay notices
Refs: NAN-326, NAN-327
2026-10-22 14:39:30 +08:00
Xubin Renandchengyongru fbb61a373f feat(update): integrate managed installs and recoverable in-app updates (#6168)
Add owner-aware Stable and Preview updates with explicit consent, verified release plans, protected process handoff and bounded service recovery. Keep configuration and conversations separate from program rollback.

Include the compact About controls, Windows long-path support, native package recovery checks and optional macOS Dock lifecycle integration. Preserve documented guidance for installations owned by other managers.

This code integration does not publish packages, enable signing or advance the public update channel.

Co-authored-by: chengyongru <61816729+chengyongru@users.noreply.github.com>
2026-10-21 19:16:56 +08:00
chengyongru f284749d2f ci: reduce Python test overhead and Windows latency (#6357)
* test: merge overlapping semantic contract coverage

Consolidate the six confirmed NAN-310 overlap groups while preserving replay, usage, generation kwargs, archive metadata, inspect fields, and subagent crash/redelivery assertions.

* test: lighten history seeds and layer runner progress rules

* ci: defer test storage setup and record phase timings

Close each listener-owned binary bridge before waiting for its TCP server; retain active upload and undecided-connection regressions. Avoid consuming readiness twice and run the repository import scan once in its static gate. NAN-310.

* test: scope filesystem mocks and observe consumed socket prefixes

* test: publish subprocess readiness files atomically

* ci: isolate external tool discovery and use three Windows workers
2026-10-21 14:47:55 +08:00
Xubin Ren 28f6c26946 fix(webui): recover model failures and align chat controls 2026-10-21 02:34:09 +08:00
pei711 5fd79c25fa fix(providers): preserve first SSE event after UTF-8 BOM 2026-10-18 20:10:51 +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
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 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
chengyongru e4fc8788c4 refactor(providers): remove duplicate chat response parsers 2026-10-16 15:05:56 +08:00
akinolurandchengyongru 9d2762a4f1 feat(provider): langfuse tracing for codex (#5520)
* feat: trace Codex requests via Langfuse native SDK

Codex has no OpenAI SDK client for Langfuse's usual swap trick, so
log one generation per request through langfuse's native SDK
instead. Tracing failures never affect the returned Codex response.

* docs: note Codex Langfuse tracing support

* fix: trace every Codex request, close every generation

- Move the Langfuse generation inside _send so the compaction
  sub-request gets its own trace too, not just the main request.
- Derive traced model/input from the wire body (post extra_body
  override, post response-item-ID stripping) instead of the
  pre-normalized one.
- Wrap package detection in the same try/except as the SDK call, so
  a broken find_spec() can't turn a valid Codex request into an error.
- Make generation finalization idempotent and cancellation-safe via
  try/except/else/finally, so update() failures or a cancelled
  request no longer leave a generation open.
- Add tests for compaction tracing, update() failures, and
  cancellation.

* docs: fix cli-reference.md langfuse plugin row

* fix: don't trace a rejected compaction as success

- Add a validate hook to _send so a transport-successful compaction
  reply with no usable item traces as an error, not a success.
- Add regression tests for a find_spec() failure, for the traced
  model/input matching the actual wire body (extra_body override,
  ID-stripped replayed items), and for the rejected-compaction case.

* fix: convert LLMUsage to dict for Langfuse usage_details

LLMResponse.usage is now the LLMUsage dataclass upstream, not a
plain dict - Langfuse's usage_details param needs the latter.

* fix: satisfy basedpyright strict on compaction items

* fix(providers): normalize Codex Langfuse cache usage

* fix(providers): migrate Langfuse tracing to SDK 4

---------

Co-authored-by: chengyongru <chengyongru.ai@gmail.com>
2026-10-16 00:44:17 +08:00
chengyongru 7177ca05e3 perf(providers): estimate missing usage outside the event loop 2026-10-15 11:48:13 +08:00
Kail Tian 3881ed7dd1 fix(providers): preserve supported Kimi K3 reasoning efforts 2026-10-14 18:00:21 +08:00
chengyongru 47f600afc6 refactor(transcription): share JSON request retries 2026-10-14 14:35:08 +08:00
Xubin Ren a5e6952cf9 fix: compare request scopes at their actual routing boundary 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 bdfc8f7bd4 fix(image): use standalone Codex Images API (#6177)
* fix(image): use standalone Codex Images API

* docs(image): keep Codex setup focused on user actions
2026-10-12 17:05:38 +08:00
chengyongru ae186cb18d test(providers): separate EOF checks from stream timing 2026-10-12 15:02:58 +08:00
Kail Tian dc6db6ffbb fix(providers): preserve disabled reasoning for MiMo Responses 2026-10-12 13:53:39 +08:00
Kail Tian 8c8fbc7a05 fix(providers): honor disabled thinking for supported GLM models 2026-10-12 13:51:36 +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
ZedingZhang ff339e592e fix(deepseek): map minimal reasoning effort to low 2026-10-10 13:08:04 +08:00
chengyongru f04ed1c2eb test: align test names with current assertions (#6130)
* test: align test names with current assertions

* test: align suite names and explicit configuration cases
2026-10-10 11:49:32 +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
chengyongru f49fe0ef66 fix(providers): preserve DeepSeek Flash proxy routing 2026-10-10 01:33:02 +08:00
chengyongru 359bfeb6c3 fix(providers): route current DeepSeek Flash alias to Responses 2026-10-10 01:33:02 +08:00
chengyongru 2790521af8 test(config): use UTF-8 for migration fixtures on Windows 2026-10-10 01:33:02 +08:00
chengyongru 7e2e804b5c refactor(providers): migrate legacy API selector at input boundary 2026-10-10 01:33:02 +08:00
chengyongru 34fd4ed75a feat(providers): declare supported APIs for custom connections 2026-10-10 01:33:02 +08:00