Commit Graph

348 Commits

Author SHA1 Message Date
Titan f3558d6bb2 feat: implement shallow SQLite checkpoint savers and update configuration for persistence modes 2026-05-08 10:58:09 +08:00
肖应宇 46711ffec8 fix:国际化配置余额不足 2026-05-06 15:16:35 +08:00
肖应宇 9b8bc09414 feat(guardrails): 添加工具调用安全中间件,强化了调用前检查和隐私保护 2026-05-06 10:33:48 +08:00
Titan ab9555255a feat: implement provider task ID extraction with fallback paths and add unit tests 2026-04-30 19:52:12 +08:00
Titan f101d8bd3e feat: remove redundent API key header appending, enhance error handling about http error in request forwarding 2026-04-30 17:24:26 +08:00
Titan f584c3e53b feat: enhance billing integration with usage token extraction and API key handling 2026-04-30 11:24:38 +08:00
Titan 169332ab29 feat: enhance third-party proxy billing integration with multiple usage paths and update migration guide 2026-04-30 11:24:38 +08:00
肖应宇 4ef9b896e3 chore(todo): 添加中文 TODO 注释
- billing 中间件补充文案国际化 TODO

- 输入框补充 is_chatting 持久化 TODO
2026-04-29 00:24:12 +08:00
肖应宇 927edfb610 fix(clarification): 修复 options 字符串被逐字符渲染为有序列表项
- 为 ask_clarification 增加 options 归一化处理

- 支持 JSON 数组字符串解析为选项列表

- 非 JSON 字符串降级为单个选项,避免逐字编号
2026-04-29 00:05:56 +08:00
肖应宇 1fd7a5d4f7 fix(backend): 修复 replace 标记泄漏到展示层 2026-04-24 18:37:30 +08:00
肖应宇 299d819026 feat(references): 统一引用来源并过滤 uploads/skill 2026-04-24 18:37:30 +08:00
肖应宇 256a2d36ec feat(backend): 增加摘要标题与产物状态对账 2026-04-24 18:37:30 +08:00
Titan dabe529cc7 feat(proxy): add third-party proxy module with billing integration
- Introduced a new third-party proxy package for handling async task APIs.
- Implemented billing client with reserve and finalize functionalities.
- Created an in-memory ledger to track call states and ensure idempotency.
- Added route classification for submit and query requests.
- Configured third-party provider settings and routes in the application config.
- Updated local backend to support Docker networking for sandbox containers.
2026-04-23 17:29:27 +08:00
Titan 8d5b01a59b fix(billing_middleware): update model configuration retrieval to use 'model' instead of 'display_name' 2026-04-23 17:29:27 +08:00
Titan 77801c03ff feat(aio_sandbox): add extra_env parameter for thread_id injection in sandbox creation 2026-04-23 17:29:27 +08:00
肖应宇 57d68bccce feat: 后端消息中记上对话的UTC+8的时间 2026-04-22 11:14:08 +08:00
肖应宇 f0d93ab342 feat(backend): 生成PPT时预处理用户提示词 2026-04-20 14:55:19 +08:00
肖应宇 33705637ea fix(artifacts): 修复文件名差异导致 Artifact not found 2026-04-17 13:50:44 +08:00
肖应宇 e3063d94c4 fix(uploads): 对当前回合提及的文件优先处理指代 2026-04-16 14:57:02 +08:00
肖应宇 c73f12f044 fix(backend): 强化敏感信息与工作流标识脱敏规则 2026-04-16 11:41:36 +08:00
肖应宇 e5f89c3d37 feat(backend): 统一"发送附件"语义为上传+提及 2026-04-16 11:40:55 +08:00
肖应宇 dae911af70 feat(phase-07): archive post-acceptance mention/upload patchset 2026-04-16 11:15:20 +08:00
肖应宇 3d472761c8 fix(uploads): ignore mention references in new upload detection 2026-04-16 11:15:20 +08:00
Titan 17a8104384 feat(billing): refactor run_id extraction and enhance logging in middleware 2026-04-14 18:39:40 +08:00
Titan 14cb4b3c33 feat(billing): add question extraction and include in reserve payload 2026-04-14 18:39:40 +08:00
肖应宇 deac1537d0 fix(backend): 禁止显示指明环境变量的方式使用命令 2026-04-14 11:33:38 +08:00
肖应宇 c0f4fa64c6 feat(backend):禁止skill输出所有的apikey文件的内容 2026-04-14 09:49:17 +08:00
肖应宇 3d38501cd5 fix(backend): 修复二进制产物误判文本导致 PDF 返回异常 2026-04-14 09:49:17 +08:00
肖应宇 99f6f8dac2 chore(backend): 强化输出文件的 present_files 交付约束 2026-04-14 09:49:17 +08:00
肖应宇 863ea39a47 feat(backend): 提示词把present_files,写成了present_file,可能是不展示html文件的原因 2026-04-14 09:49:17 +08:00
Titan a5cf6c87e5 feat: add billing reservation and finalization middleware with configuration (pre + call_id) 2026-04-12 15:33:37 +08:00
Titan bef1fd049f chore(prompt): update agent name in prompt template from 'DeerFlow 2.0' to 'XClaw' 2026-04-08 15:28:59 +08:00
Titan 3bfe2e0203 feat(token-usage): Rewrite middleware to support external billing API reporting 2026-04-08 15:19:32 +08:00
Titan 6b900ccb60 feat(logging): enhance logging configuration to support environment variable override for log level 2026-04-07 10:04:17 +08:00
Titan b412b5193b feat(skills): support batch skill bootstrap via content_ids; clear parent dir once before per-skill write 2026-04-05 18:37:55 +08:00
Titan 5aa38ee108 feat(skills): include uploads directory in skill scanning 2026-04-05 18:20:03 +08:00
Titan 66bdc951f8 feat(skills): add remote YAML bootstrap and materialization APIs 2026-04-05 18:16:05 +08:00
Chris Z 117fa9b05d
fix(channels): normalize slack allowed user ids (#1802)
* fix(channels): normalize slack allowed user ids

* style(channels): apply backend formatter

---------

Co-authored-by: haimingZZ <15558128926@qq.com>
Co-authored-by: suyua9 <1521777066@qq.com>
2026-04-05 18:04:21 +08:00
thefoolgy 8049785de6
fix(memory): case-insensitive fact deduplication and positive reinforcement detection (#1804)
* fix(memory): case-insensitive fact deduplication and positive reinforcement detection

Two fixes to the memory system:

1. _fact_content_key() now lowercases content before comparison, preventing
   semantically duplicate facts like "User prefers Python" and "user prefers
   python" from being stored separately.

2. Adds detect_reinforcement() to MemoryMiddleware (closes #1719), mirroring
   detect_correction(). When users signal approval ("yes exactly", "perfect",
   "完全正确", etc.), the memory updater now receives reinforcement_detected=True
   and injects a hint prompting the LLM to record confirmed preferences and
   behaviors with high confidence.

   Changes across the full signal path:
   - memory_middleware.py: _REINFORCEMENT_PATTERNS + detect_reinforcement()
   - queue.py: reinforcement_detected field in ConversationContext and add()
   - updater.py: reinforcement_detected param in update_memory() and
     update_memory_from_conversation(); builds reinforcement_hint alongside
     the existing correction_hint

Tests: 11 new tests covering deduplication, hint injection, and signal
detection (Chinese + English patterns, window boundary, conflict with correction).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(memory): address Copilot review comments on reinforcement detection

- Tighten _REINFORCEMENT_PATTERNS: remove 很好, require punctuation/end-of-string boundaries on remaining patterns, split this-is-good into stricter variants
- Suppress reinforcement_detected when correction_detected is true to avoid mixed-signal noise
- Use casefold() instead of lower() for Unicode-aware fact deduplication
- Add missing test coverage for reinforcement_detected OR merge and forwarding in queue

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-05 16:23:00 +08:00
Evan Wu 9ca68ffaaa
fix: preserve virtual path separator style (#1828)
* fix: preserve virtual path separator style

* Apply suggestions from code review

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

---------

Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-05 15:52:22 +08:00
Markus Corazzione 0ffe5a73c1
chroe(config):Increase subagent max-turn limits (#1852) 2026-04-05 15:41:00 +08:00
Echo-Nie d3b59a7931
docs: fix some broken links (#1864)
* Rename BACKEND_TODO.md to TODO.md in documentation

* Update MCP Setup Guide link in CONTRIBUTING.md

* Update reference to config.yaml path in documentation

* Fix config file path in TITLE_GENERATION_IMPLEMENTATION.md

Updated the path to the example config file in the documentation.
2026-04-05 15:35:42 +08:00
yangzheli e5416b539a
fix(docker): use multi-stage build to remove build-essential from runtime image (#1846)
* fix(docker): use multi-stage build to remove build-essential from runtime image

The build-essential toolchain (~200 MB) was only needed for compiling
native Python extensions during `uv sync` but remained in the final
image, increasing size and attack surface. Split the Dockerfile into
a builder stage (with build-essential) and a clean runtime stage that
copies only the compiled artifacts, Node.js, Docker CLI, and uv.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(docker): add dev stage and pin docker:cli per review feedback

Address Copilot review comments:
- Add a `dev` build stage (FROM builder) that retains build-essential
  so startup-time `uv sync` in dev containers can compile from source
- Update docker-compose-dev.yaml to use `target: dev` for gateway and
  langgraph services
- Keep the clean runtime stage (no build-essential) as the default
  final stage for production builds

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-05 15:30:34 +08:00
SHIYAO ZHANG 72d4347adb
fix(sandbox): guard against None runtime.context in sandbox tool helpers (#1853)
sandbox_from_runtime() and ensure_sandbox_initialized() write
sandbox_id into runtime.context after acquiring a sandbox. When
lazy_init=True and no context is supplied to the graph run,
runtime.context is None (the LangGraph default), causing a TypeError
on the assignment.

Add `if runtime.context is not None` guards at all three write sites.
Reads already had equivalent guards (e.g. `runtime.context.get(...) if
runtime.context else None`); this brings writes into line.
2026-04-05 10:58:38 +08:00
Octopus a283d4a02d
fix: include soul field in GET /api/agents list response (fixes #1819) (#1863)
Previously, the list endpoint always returned soul=null because
_agent_config_to_response() was called without include_soul=True.
This caused confusion since PUT /api/agents/{name} and GET /api/agents/{name}
both returned the soul content, but the list endpoint silently omitted it.

Co-authored-by: octo-patch <octo-patch@users.noreply.github.com>
2026-04-05 10:49:58 +08:00
yangzheli 5f8dac66e6
chore(deps): update uv.lock (#1848)
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-04-05 10:22:14 +08:00
DanielWalnut 2a150f5d4a
fix: unblock concurrent threads and workspace hydration (#1839)
* fix: unblock concurrent threads and workspace hydration

* fix: restore async title generation

* fix: address PR review feedback

* style: format lead agent prompt
2026-04-04 21:19:35 +08:00
SHIYAO ZHANG 163121d327
fix(uploads): handle split-bold headings and ** ** artefacts in extract_outline (#1838)
* feat(uploads): guide agent to use grep/glob/read_file for uploaded documents

Add workflow guidance to the <uploaded_files> context block so the agent
knows to use grep and glob (added in #1784) alongside read_file when
working with uploaded documents, rather than falling back to web search.

This is the final piece of the three-PR PDF agentic search pipeline:
- PR1 (#1727): pymupdf4llm converter produces structured Markdown with headings
- PR2 (#1738): document outline injected into agent context with line numbers
- PR3 (this):  agent guided to use outline + grep + read_file workflow

* feat(uploads): add file-first priority and fallback guidance to uploaded_files context

* fix(uploads): handle split-bold headings and ** ** artefacts in extract_outline

- Add _clean_bold_title() to merge adjacent bold spans (** **) produced
  by pymupdf4llm when bold text crosses span boundaries
- Add _SPLIT_BOLD_HEADING_RE (Style 3) to recognise **<num>** **<title>**
  headings common in academic papers; excludes pure-number table headers
  and rows with more than 4 bold blocks
- When outline is empty, read first 5 non-empty lines of the .md as a
  content preview and surface a grep hint in the agent context
- Update _format_file_entry to render the preview + grep hint instead of
  silently omitting the outline section
- Add 3 new extract_outline tests and 2 new middleware tests (65 total)

* fix(uploads): address Copilot review comments on extract_outline regex

- Replace ASCII [A-Za-z] guard with negative lookahead to support non-ASCII
  titles (e.g. **1** **概述**); pure-numeric/punctuation blocks still excluded
- Replace .+ with [^*]+ and cap repetition at {0,2} (four blocks total) to
  keep _SPLIT_BOLD_HEADING_RE linear and avoid ReDoS on malformed input
- Remove now-redundant len(blocks) <= 4 code-level check (enforced by regex)
- Log debug message with exc_info when preview extraction fails
2026-04-04 14:25:08 +08:00
fengxsong 19809800f1
feat: support wecom channel (#1390)
* feat: support wecom channel

* fix: sending file to client

Signed-off-by: fengxusong <7008971+fengxsong@users.noreply.github.com>

* test: add unit tests for wecom channel

Signed-off-by: fengxusong <7008971+fengxsong@users.noreply.github.com>

* docs: add example configs and setup docs

Signed-off-by: fengxusong <7008971+fengxsong@users.noreply.github.com>

* revert pypi default index setting

Signed-off-by: fengxusong <7008971+fengxsong@users.noreply.github.com>

* revert: keeping codes in harness untouched

Signed-off-by: fengxusong <7008971+fengxsong@users.noreply.github.com>

* fix: format issue

Signed-off-by: fengxusong <7008971+fengxsong@users.noreply.github.com>

* fix: resolve Copilot comments

Signed-off-by: fengxusong <7008971+fengxsong@users.noreply.github.com>

---------

Signed-off-by: fengxusong <7008971+fengxsong@users.noreply.github.com>
Co-authored-by: Willem Jiang <willem.jiang@gmail.com>
2026-04-04 11:28:35 +08:00
SHIYAO ZHANG bbd0866374
feat(uploads): guide agent using agentic search for uploaded documents (#1816)
* feat(uploads): guide agent to use grep/glob/read_file for uploaded documents

Add workflow guidance to the <uploaded_files> context block so the agent
knows to use grep and glob (added in #1784) alongside read_file when
working with uploaded documents, rather than falling back to web search.

This is the final piece of the three-PR PDF agentic search pipeline:
- PR1 (#1727): pymupdf4llm converter produces structured Markdown with headings
- PR2 (#1738): document outline injected into agent context with line numbers
- PR3 (this):  agent guided to use outline + grep + read_file workflow

* feat(uploads): add file-first priority and fallback guidance to uploaded_files context
2026-04-04 11:08:31 +08:00