Skip to content

fix: sanitize PyInstaller LD_LIBRARY_PATH for child processes - #859

Merged
qdaxb merged 1 commit into
wecode-ai:mainfrom
icycrystal4:fix/sanitize-pyinstaller-ld-library-path
Mar 26, 2026
Merged

qdaxb merged 1 commit into
wecode-ai:mainfrom
icycrystal4:fix/sanitize-pyinstaller-ld-library-path

Conversation

@icycrystal4

@icycrystal4 icycrystal4 commented Mar 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • PyInstaller's bootloader prepends /tmp/_MEIxxxxxx to LD_LIBRARY_PATH, causing child processes (Claude Code, shell commands like bash/git/curl) to load wrong shared libraries (e.g., libtinfo.so.6)
  • Extract sanitize_ld_library_path() into executor/platform_compat/ and apply it in both local_mode_strategy.py (Claude SDK subprocess) and extension_handler.py (extension script subprocess)
  • Restores original LD_LIBRARY_PATH from LD_LIBRARY_PATH_ORIG if available, otherwise clears it
  • Only affects PyInstaller frozen builds (Linux); macOS is unaffected per PyInstaller docs

Before

/bin/bash: /tmp/_MEIxxxxxx/libtinfo.so.6: no version information available (required by /bin/bash)

After

Clean output, no library warnings.

Test plan

  • Verified on cloud device (10.2.248.54), task 975843 — no libtinfo warning in output
  • Run existing executor unit tests

Summary by CodeRabbit

  • Bug Fixes
    • Fixed environment variable handling for child processes in PyInstaller-frozen builds on Linux, ensuring proper library path resolution for spawned subprocess execution.

PyInstaller's bootloader prepends its extraction directory (/tmp/_MEIxxxxxx)
to LD_LIBRARY_PATH, causing child processes (Claude Code, shell commands)
to load wrong shared libraries (e.g., libtinfo.so.6).

Extract `sanitize_ld_library_path()` into platform_compat and apply it in
both local_mode_strategy (Claude SDK subprocess) and extension_handler
(extension script subprocess) to restore the original library path.

See: https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html
@coderabbitai

coderabbitai Bot commented Mar 26, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The changes introduce a new utility function sanitize_ld_library_path in the platform compatibility module to normalize LD_LIBRARY_PATH environment variables for PyInstaller-frozen subprocess environments. This function is then integrated into two subprocess environment setup locations to ensure consistent library path handling.

Changes

Cohort / File(s) Summary
Platform Compatibility Utility
executor/platform_compat/__init__.py
Added new exported function sanitize_ld_library_path(env: dict) -> dict that checks sys.frozen at runtime and either restores LD_LIBRARY_PATH from LD_LIBRARY_PATH_ORIG or clears it to prevent polluted values from persisting in merged environment options.
Subprocess Environment Setup Integration
executor/agents/claude_code/local_mode_strategy.py, executor/modes/local/extension_handler.py
Integrated sanitize_ld_library_path calls into child process environment configuration, replacing conditional LD_LIBRARY_PATH_ORIG copy logic with standardized normalization function invocation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Poem

🐰 With PyInstaller's frozen delight,
We sanitize the library path just right—
LD\_LIBRARY\_PATH now clean and clear,
Spawned subprocesses have naught to fear!
🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: sanitize PyInstaller LD_LIBRARY_PATH for child processes' clearly and concisely describes the main change: fixing an issue with PyInstaller's LD_LIBRARY_PATH handling in child processes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
executor/modes/local/extension_handler.py (1)

118-124: 🛠️ Refactor suggestion | 🟠 Major

Instrument _run_script with sync tracing.

This modified sync function handles subprocess execution and error paths but is missing the required tracing decorator.

As per coding guidelines, Use @trace_sync(span_name, tracer_name, extract_attributes) decorator to trace entire sync functions in OpenTelemetry.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@executor/modes/local/extension_handler.py` around lines 118 - 124, The sync
function _run_script is missing OpenTelemetry tracing; add the `@trace_sync`
decorator above its definition using a descriptive span name (e.g.,
"extension_handler._run_script"), the appropriate tracer name (e.g.,
"executor"), and an attribute extractor function (either an existing extractor
or a small new helper like _extract_extension_attributes that returns relevant
attributes from the function args such as extension_name, action, and
script_path) so the entire synchronous execution and error paths are traced.
executor/agents/claude_code/local_mode_strategy.py (1)

102-107: 🛠️ Refactor suggestion | 🟠 Major

Add sync tracing to configure_client_options.

This modified sync function should be wrapped with the required tracing decorator.

As per coding guidelines, Use @trace_sync(span_name, tracer_name, extract_attributes) decorator to trace entire sync functions in OpenTelemetry.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@executor/agents/claude_code/local_mode_strategy.py` around lines 102 - 107,
Wrap the configure_client_options method with the tracing decorator by adding
`@trace_sync`(span_name, tracer_name, extract_attributes) above its definition
(import trace_sync from your tracing utilities if not already imported); use a
descriptive span_name like "claude_code.configure_client_options", an
appropriate tracer_name such as "executor" (or existing tracer used in this
module), and pass the existing extract_attributes function (or a lambda
extracting relevant args) so the entire synchronous function is traced
end-to-end without changing its signature or behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@executor/platform_compat/__init__.py`:
- Around line 107-139: Add OpenTelemetry sync tracing to
sanitize_ld_library_path by decorating it with the trace_sync decorator: import
trace_sync if not present and add `@trace_sync`("sanitize_ld_library_path",
"executor", extract_attributes=True) immediately above the
sanitize_ld_library_path function definition so the entire function is traced
without changing its behavior or signature.
- Around line 125-137: The sanitization that reads LD_LIBRARY_PATH_ORIG and sets
env["LD_LIBRARY_PATH"] should only run on Linux frozen builds; update the guard
around the existing block (the getattr(sys, "frozen", False) check and the
ld_orig logic) to also require a Linux platform (e.g.,
sys.platform.startswith("linux")) so LD_LIBRARY_PATH is not modified on
non-Linux frozen platforms; keep the existing behavior using
os.environ.get("LD_LIBRARY_PATH_ORIG") and setting env["LD_LIBRARY_PATH"] to
ld_orig or "" as before.

---

Outside diff comments:
In `@executor/agents/claude_code/local_mode_strategy.py`:
- Around line 102-107: Wrap the configure_client_options method with the tracing
decorator by adding `@trace_sync`(span_name, tracer_name, extract_attributes)
above its definition (import trace_sync from your tracing utilities if not
already imported); use a descriptive span_name like
"claude_code.configure_client_options", an appropriate tracer_name such as
"executor" (or existing tracer used in this module), and pass the existing
extract_attributes function (or a lambda extracting relevant args) so the entire
synchronous function is traced end-to-end without changing its signature or
behavior.

In `@executor/modes/local/extension_handler.py`:
- Around line 118-124: The sync function _run_script is missing OpenTelemetry
tracing; add the `@trace_sync` decorator above its definition using a descriptive
span name (e.g., "extension_handler._run_script"), the appropriate tracer name
(e.g., "executor"), and an attribute extractor function (either an existing
extractor or a small new helper like _extract_extension_attributes that returns
relevant attributes from the function args such as extension_name, action, and
script_path) so the entire synchronous execution and error paths are traced.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 51319015-396f-4c95-aba9-c45fb848c47e

📥 Commits

Reviewing files that changed from the base of the PR and between e308b38 and 9dafaa6.

📒 Files selected for processing (3)
  • executor/agents/claude_code/local_mode_strategy.py
  • executor/modes/local/extension_handler.py
  • executor/platform_compat/__init__.py

Comment on lines +107 to +139
def sanitize_ld_library_path(env: dict) -> dict:
"""Sanitize LD_LIBRARY_PATH for subprocess environments in PyInstaller builds.

PyInstaller's bootloader prepends its extraction directory (/tmp/_MEIxxxxxx) to
LD_LIBRARY_PATH, which causes child processes to load wrong shared libraries.
This function restores the original value or clears it.

Only affects Linux. macOS is unaffected because PyInstaller rewrites library paths
in binaries directly and does not modify DYLD_LIBRARY_PATH.

See: https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html

Args:
env: Environment variables dict (will be modified in-place).

Returns:
The same env dict, for convenience.
"""
if not getattr(sys, "frozen", False):
return env

# Read original value from os.environ (set by PyInstaller's bootloader),
# not from the passed-in env dict which may be a partial options dict.
ld_orig = os.environ.get("LD_LIBRARY_PATH_ORIG")
if ld_orig is not None:
env["LD_LIBRARY_PATH"] = ld_orig
else:
# No ORIG saved — clear LD_LIBRARY_PATH by setting it to empty string.
# Using pop() would be insufficient when env is a partial options dict
# that gets merged with os.environ (the polluted value would survive).
env["LD_LIBRARY_PATH"] = ""

return env

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Add tracing to this new sync helper.

sanitize_ld_library_path is a new sync function but is not instrumented with the required sync tracing decorator.

As per coding guidelines, Use @trace_sync(span_name, tracer_name, extract_attributes) decorator to trace entire sync functions in OpenTelemetry.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@executor/platform_compat/__init__.py` around lines 107 - 139, Add
OpenTelemetry sync tracing to sanitize_ld_library_path by decorating it with the
trace_sync decorator: import trace_sync if not present and add
`@trace_sync`("sanitize_ld_library_path", "executor", extract_attributes=True)
immediately above the sanitize_ld_library_path function definition so the entire
function is traced without changing its behavior or signature.

Comment on lines +125 to +137
if not getattr(sys, "frozen", False):
return env

# Read original value from os.environ (set by PyInstaller's bootloader),
# not from the passed-in env dict which may be a partial options dict.
ld_orig = os.environ.get("LD_LIBRARY_PATH_ORIG")
if ld_orig is not None:
env["LD_LIBRARY_PATH"] = ld_orig
else:
# No ORIG saved — clear LD_LIBRARY_PATH by setting it to empty string.
# Using pop() would be insufficient when env is a partial options dict
# that gets merged with os.environ (the polluted value would survive).
env["LD_LIBRARY_PATH"] = ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Guard sanitization with Linux check to match the function contract.

On Line 125, sanitization runs for all frozen platforms. That contradicts the Linux-only behavior documented in this function and can unnecessarily overwrite LD_LIBRARY_PATH on non-Linux frozen builds.

Proposed fix
-    if not getattr(sys, "frozen", False):
+    if not getattr(sys, "frozen", False) or not IS_LINUX:
         return env
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@executor/platform_compat/__init__.py` around lines 125 - 137, The
sanitization that reads LD_LIBRARY_PATH_ORIG and sets env["LD_LIBRARY_PATH"]
should only run on Linux frozen builds; update the guard around the existing
block (the getattr(sys, "frozen", False) check and the ld_orig logic) to also
require a Linux platform (e.g., sys.platform.startswith("linux")) so
LD_LIBRARY_PATH is not modified on non-Linux frozen platforms; keep the existing
behavior using os.environ.get("LD_LIBRARY_PATH_ORIG") and setting
env["LD_LIBRARY_PATH"] to ld_orig or "" as before.

@qdaxb
qdaxb merged commit 7d49242 into wecode-ai:main Mar 26, 2026
20 checks passed
FicoHu pushed a commit to FicoHu/Wegent that referenced this pull request Apr 1, 2026
…-ai#859)

PyInstaller's bootloader prepends its extraction directory (/tmp/_MEIxxxxxx)
to LD_LIBRARY_PATH, causing child processes (Claude Code, shell commands)
to load wrong shared libraries (e.g., libtinfo.so.6).

Extract `sanitize_ld_library_path()` into platform_compat and apply it in
both local_mode_strategy (Claude SDK subprocess) and extension_handler
(extension script subprocess) to restore the original library path.

See: https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html

Co-authored-by: sifang <sifang@staff.weibo.com>
FicoHu pushed a commit to FicoHu/Wegent that referenced this pull request Apr 1, 2026
…-ai#859)

PyInstaller's bootloader prepends its extraction directory (/tmp/_MEIxxxxxx)
to LD_LIBRARY_PATH, causing child processes (Claude Code, shell commands)
to load wrong shared libraries (e.g., libtinfo.so.6).

Extract `sanitize_ld_library_path()` into platform_compat and apply it in
both local_mode_strategy (Claude SDK subprocess) and extension_handler
(extension script subprocess) to restore the original library path.

See: https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html

Co-authored-by: sifang <sifang@staff.weibo.com>
qdaxb added a commit that referenced this pull request Apr 1, 2026
* feat: add workspace archive and recovery for Pod deletion

Implement Pod recovery feature that allows users to continue conversations
after executor Pods are deleted:

- Add ArchiveInfo schema to store archive metadata in Task.status.archive
- Add workspace_archive service for MinIO presigned URL generation
- Add archive/restore endpoints in executor and executor_manager
- Add ExecutorRecoveryService for Pod recreation with workspace restoration
- Add skip_git_clone support to prevent git clone conflicts during restore
- Add Celery Beat scheduled task for expired archive cleanup (30-day retention)
- Integrate archive workflow in executor_job before Pod deletion

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

* fix(backend): add missing minio dependency

Add minio package to backend dependencies for workspace archive storage.

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

* feat(admin): add created_at field to device monitor list (#846)

- Add created_at field to AdminDeviceInfo schema in backend
- Add created_at to AdminDeviceInfo TypeScript interface
- Display creation time in device list UI
- Add i18n translations for created_at column (zh-CN and en)

Co-authored-by: yunpeng7 <yunpeng7@staff.weibo.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* perf: use async heartbeat (#849)

* fix(chat_shell): prevent orphaned tool call IDs in group chat history (#852)

* fix(chat_shell): prevent tool call group splitting in group chat history truncation

_truncate_history blindly sliced the flat message list, which could
split assistant+tool_calls and their tool response messages across the
truncation boundary. This produced orphaned function_call_output items
without matching function_call entries in the OpenAI Responses API
format, causing 'No tool call found for function call output' errors.

Add _group_messages() to treat assistant+tool_calls+tool responses as
atomic units, and modify _truncate_history() to truncate by groups
instead of individual messages.

* fix(chat_shell): ensure tool call group integrity across all compression paths

Extract group_tool_call_messages() into shared messages/utils.py and
apply atomic group handling to:
- HistoryTruncationStrategy.compress(): adjust first/last boundaries
  to avoid splitting tool call groups, add post-removal orphan cleanup
- _force_compression_to_target(): Step 2 removes middle groups instead
  of individual messages, Step 5 keeps first/last groups
- Refactor loader.py to import shared utility instead of inline helper

All 95 related tests pass. Comprehensive audit confirms no other code
paths in chat_shell break tool call group integrity.

* test(chat_shell): add tool-call group truncation regressions

Add regression coverage for preserving assistant tool calls with their matching tool results across group-chat history truncation, history compression boundaries, and forced compression fallback paths.

* fix: 在里面智能体的创建人和机器人的创建人不是一个人时会报错 (#853)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 在里面智能体的创建人和机器人的创建人不是一个人时会报错

* fix: 迁移其他的sql到kindReader

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix: fail fast on invalid tool call IDs across chat protocols (#854)

* fix: 订阅任务执行间隔调整 & trace http接口的匹配规则调整 (#855)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: telemetry的匹配规则调整

* fix: 订阅任务执行间隔调整

* fix: 调整逻辑

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix: sanitize PyInstaller LD_LIBRARY_PATH for child processes (#859)

PyInstaller's bootloader prepends its extraction directory (/tmp/_MEIxxxxxx)
to LD_LIBRARY_PATH, causing child processes (Claude Code, shell commands)
to load wrong shared libraries (e.g., libtinfo.so.6).

Extract `sanitize_ld_library_path()` into platform_compat and apply it in
both local_mode_strategy (Claude SDK subprocess) and extension_handler
(extension script subprocess) to restore the original library path.

See: https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html

Co-authored-by: sifang <sifang@staff.weibo.com>

* refactor(rag): move internal retrieve routing into backend (#847)

* refactor(rag): move internal retrieve routing into backend

* refactor(rag): move retrieve persistence into backend

* refactor(rag): move kb head persistence into backend

* fix(rag): tighten backend retrieve routing

* refactor(rag): simplify token estimation fallback

* refactor(rag): batch route token estimation

* fix(rag): token estimator decimal

* fix(rag): harden kb read persistence

* frontend: show 'indexing' status for documents pending indexing (#858)

* fix(frontend): show 'indexing' status for documents pending indexing

When a document is uploaded, is_active is false while indexing is in progress.
Previously, this showed 'index unavailable' which was misleading.

Now documents with status='enabled' but is_active=false will show 'indexing'
instead of 'index unavailable', matching the existing translation key.

Changes:
- Updated compact mode status indicator (line 247)
- Updated normal mode status badge (line 461)

Fixes: knowledge base document shows 'index unavailable' during indexing

* fix(i18n): update Developer role description in Chinese locale

* fix: 修复订阅器中脏数据导致的无法展示的问题 (#860)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 修复订阅器中脏数据导致的无法展示的问题

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* feat(backend): add knowledge base RAG support to /v1/responses API (#844)

* feat(backend): add knowledge base RAG support to /v1/responses API

Implement knowledge base Q&A functionality for the OpenAI-compatible
/v1/responses endpoint with the following changes:

Schema Changes:
- Add knowledge_base_names field to WegentTool schema
- Support namespace#name format for KB specification

New Services:
- KnowledgeBaseNameResolver: resolves KB display names to IDs with
  permission checking via TaskKnowledgeBaseService
- KnowledgeBaseContextCreator: creates SubtaskContext records for
  API-specified KBs to integrate with existing RAG pipeline

Integration:
- Extend parse_wegent_tools() to handle knowledge_base tool type
- Add parse_knowledge_base_name() for namespace#name parsing
- Modify build_execution_request() to accept knowledge_base_names
- Add _create_kb_contexts_from_api_request() for KB context injection
- Update openapi_responses.py endpoints to pass KB names parameter

Testing:
- Add comprehensive unit tests for KB name resolution
- Add tests for KB context creation
- Add tests for helper functions with KB support
- All 32 new tests passing

The implementation reuses the existing RAG flow through
prepare_contexts_for_chat() and KnowledgeBaseTool, ensuring
consistency with the web UI behavior.

* refactor(kb_resolver): optimize database query complexity from O(n) to O(m)

- Add batch_get_knowledge_base_by_names() to TaskKnowledgeBaseService for efficient batch queries
- Extract _check_kb_access_permission() for unified permission checking logic
- Update kb_resolver to use service methods instead of direct queries
- Reduce DB queries from O(n) to O(m) where m is unique namespace count
- Update tests to mock service methods instead of internal functions

All 15 tests pass.

* refactor(backend): optimize KB permission check in kb_resolver

Simplify permission checking by using get_all_knowledge_bases_grouped()
which already returns all KBs accessible to the user.

Changes:
- Replace _batch_query_kbs() and _check_kb_access_permission() with
  _get_accessible_kb_lookup() that builds a lookup dict from grouped results
- Remove unused resolve_single() method and batch_get_knowledge_base_by_names()
- Update tests to mock KnowledgeService.get_all_knowledge_bases_grouped()

This reduces database queries and simplifies the permission check logic.

* feat(backend): integrate knowledge base context creation into unified AI trigger

- Add knowledge_base_names parameter to build_execution_request for OpenAPI v1/responses
- Create _create_kb_contexts_from_api_request helper to process KB names from API requests
- Integrate KB context processing into unified trigger flow
- Add KnowledgeBaseContextCreator class for creating SubtaskContext records
- Add comprehensive unit tests for KnowledgeBaseContextCreator

This enables RAG functionality for OpenAPI v1/responses endpoint by creating
SubtaskContext records that are processed by the existing context pipeline.

* fix(chat): propagate HTTPException from KnowledgeBaseNameResolver in unified trigger

- Add HTTPException import from fastapi
- Catch and re-raise HTTPException explicitly in _create_kb_contexts_from_api_request
- Keep generic exception handling for non-HTTP exceptions to preserve best-effort behavior
- This ensures 403/404 errors from KB resolution are properly propagated to callers
  instead of being swallowed and logged as warnings

* fix(chat_shell): use model_type for provider detection instead of model_id (#861)

- Extract shared detect_provider() into models/providers.py with
  PROVIDER_ALIASES as single source of truth
- model_type (env.model) is authoritative; raise ValueError on unknown
- Remove _PROVIDER_ID_PATTERNS model_id prefix fallback (same model_id
  can serve multiple protocols)
- Unify truncation notice logic for all providers (no system-role notice
  in middle of messages, preventing Anthropic non-consecutive system
  message errors)
- Pass model_type from model_config through MessageCompressor to
  TokenCounter for accurate provider detection
- Remove duplicate provider constants from factory.py and token_counter.py

Co-authored-by: wenbo17 <wenbo17@staff.weibo.com>

* ix: claude的子代理模式不可用修复 (#862)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: claude的子代理模式不可用修复

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* feat(inbox): implement work queue and message forwarding system (#851)

* feat(inbox): implement work queue and message forwarding system

Add a comprehensive message forwarding and work queue system that enables
users to forward conversation messages to other users. Recipients can
manage received messages through work queues and optionally configure
AI agents for automatic processing.

Backend changes:
- Add QueueMessage and RecentContact database models
- Add WorkQueue CRD schema stored in kinds table
- Implement work queue services for CRUD operations
- Implement message forwarding service with queue selection
- Add WebSocket events for real-time notifications
- Add API endpoints for work queue management
- Add ForbiddenException to core exceptions

Frontend changes:
- Add inbox page with queue sidebar and message list
- Implement ForwardMessageDialog for recipient selection
- Add queue edit/create dialog with auto-processing config
- Add message detail dialog with content preview
- Add i18n translations (zh-CN and en)
- Register inbox route and navigation

* fix: resolve lint errors in inbox feature

- Remove unused imports (RefreshCw, Settings, Menu, Button, Input, Clock)
- Format Python files with Black

* fix: resolve TypeScript errors in inbox feature

- Add 'flow' and 'inbox' to TopNavigation activePage type
- Replace Badge variant 'outline' with 'info' (outline not supported)

* fix: address CodeRabbit review comments for work queue feature

- Fix status parameter shadowing fastapi status module in work_queue.py
- Fix NamespaceMember.namespace to use group_name column reference
- Replace func.json_set with Python-level update for PostgreSQL compatibility
- Fix refreshQueues dependency loop using functional state update
- Remove Chinese text from inbox page comment
- Add NaN validation for schedule interval input
- Replace clickable Badge with accessible button for recent contacts

---------

Co-authored-by: qdaxb <4157870+qdaxb@users.noreply.github.com>

* Wegent/work queue and message forwarding (#863)

* feat(inbox): implement work queue and message forwarding system

Add a comprehensive message forwarding and work queue system that enables
users to forward conversation messages to other users. Recipients can
manage received messages through work queues and optionally configure
AI agents for automatic processing.

Backend changes:
- Add QueueMessage and RecentContact database models
- Add WorkQueue CRD schema stored in kinds table
- Implement work queue services for CRUD operations
- Implement message forwarding service with queue selection
- Add WebSocket events for real-time notifications
- Add API endpoints for work queue management
- Add ForbiddenException to core exceptions

Frontend changes:
- Add inbox page with queue sidebar and message list
- Implement ForwardMessageDialog for recipient selection
- Add queue edit/create dialog with auto-processing config
- Add message detail dialog with content preview
- Add i18n translations (zh-CN and en)
- Register inbox route and navigation

* fix: resolve lint errors in inbox feature

- Remove unused imports (RefreshCw, Settings, Menu, Button, Input, Clock)
- Format Python files with Black

* fix: resolve TypeScript errors in inbox feature

- Add 'flow' and 'inbox' to TopNavigation activePage type
- Replace Badge variant 'outline' with 'info' (outline not supported)

* fix: address CodeRabbit review comments for work queue feature

- Fix status parameter shadowing fastapi status module in work_queue.py
- Fix NamespaceMember.namespace to use group_name column reference
- Replace func.json_set with Python-level update for PostgreSQL compatibility
- Fix refreshQueues dependency loop using functional state update
- Remove Chinese text from inbox page comment
- Add NaN validation for schedule interval input
- Replace clickable Badge with accessible button for recent contacts

* feat: update work queue

---------

Co-authored-by: qdaxb <4157870+qdaxb@users.noreply.github.com>

* fix: fix column default value

* fix: fix forward message click

* feat: remove unused area

* feat: add inbox default message

* fix: 修复脏数据导致的订阅任务无法执行的问题 (#865)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 修复脏数据导致的订阅任务无法执行的问题

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix(browser): harden browser-tool linux recovery (#867)

Co-authored-by: sifang <sifang@staff.weibo.com>

* fix: 修复无法使用自定义镜像以及自定义镜像无法校验的问题 (#866)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 修复无法使用自定义镜像

* fix: 修复无法使用自定义镜像以及自定义镜像无法校验的问题

* fix: 修复可能的bug

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix: fix welcome timezone (#868)

* docs: update inbox docs (#869)

* fix: 修复单测 (#870)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 修复单测

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix: fix page error (#871)

* fix: data-roleid="api-key-create-button" not in html attr (#873)

* fix: 修复停止按钮偶发变成发送的问题 & 修复失败的消息会丢失的问题 (#876)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 修复停止按钮偶发变成发送的问题

* fix: 修复失败的消息会丢失的问题

* fix: 修复类型报错

* fix: 修复前端复制按钮内容错误的问题

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix: 修复“skill not found” (#877)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 技能错乱

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* chore(executor): upgrade claude-agent-sdk from 0.1.31 to 0.1.51 (#880)

Co-authored-by: sifang <sifang@staff.weibo.com>

* feat(frontend): add HTML attachment preview and share link generation (#872)

- Add HtmlPreview component for previewing HTML files with iframe and source view modes
- Update FilePreview to support HTML file type detection and rendering
- Add createAttachmentShareLink API for generating public share links
- Add share button to FilePreviewDialog and FilePreviewPage (visible for owners only)
- Add Web Page type label and icon for HTML attachments in AttachmentCard
- Fix preview page height to fill viewport using h-screen and h-full
- Update AttachmentPreview to support HTML file preview button

Fixes share link browsing and download for table-type attachments

* fix(knowledge): harden document indexing state (#875)

* fix(knowledge): harden document indexing state

* fix(knowledge): harden indexing state transitions

* fix(knowledge): tighten reindex review followups

* fix(rag): KNOWLEDGE_INDEX_LOCK_MAX_RETRIES=1

* fix(knowledge): store index status without db enum

* fix(alembic): correct migration revision metadata

* docs: update contributors list (zh) (#879)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs: update contributors list (#878)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: 支持skill认证 (#882)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: add skill http identity design and plan

* feat(skill): add http identity token flow

* feat: 修改样式

* feat: 修改样式

* feat: 移除计划

* feat: 调整为带有认证的接口

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>
# Conflicts:
#	executor_manager/services/sandbox/manager.py

* Feature/knowledge document read (#888)

* docs(backend): add knowledge document read spec and plan

* feat(backend): add orchestrated knowledge document reads

* fix(backend): tighten knowledge document read handling

* refactor(web-scraper): add configuration for specific sites that require special handling (#884)

* refactor(web-scraper): extract site-specific config to scraper_config.py

- Add scraper_config.py for site-specific crawling configurations

* fix(web_scraper): load WEB_SCRAPER_SITE_CONFIG from Pydantic settings instead of os.environ

- Add WEB_SCRAPER_SITE_CONFIG to Settings class in config.py
- Refactor scraper_config.py to use settings.WEB_SCRAPER_SITE_CONFIG with proper logging
- Replace module-level config loading with cached get_site_config() function
- Update scraper_service.py to use new get_site_config() function
- Add detailed logging for site config matching and application
- Fix remove_overlay_elements duplicate key in CrawlerRunConfig

This ensures the configuration is properly loaded from .env file via Pydantic settings."

* refactor(backend): improve scraper_config security and type safety

- Remove sensitive config value from INFO level logging
- Add return type annotations to _load_site_config and get_site_config
- Replace broad Exception catch with specific exception types (AttributeError, KeyError, TypeError, ValueError)
- Import Dict and Any from typing module

* refactor(backend): replace auto-cleanup with archive expiration check

Remove automatic MinIO archive cleanup (Celery Beat task) and instead
block task execution when workspace archive has expired (>30 days).
Users will receive a clear error message and must create a new task.

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

* feat: 添加恢复行为测试和脚本路径修正

* fix: 使用 timezone.utc 替换 UTC 以确保时区正确

* test(backend): fix workspace recovery test patches

---------

Co-authored-by: yunpeng7 <yunpeng7@staff.weibo.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: axb <qindi@staff.weibo.com>
Co-authored-by: moqimoqidea <39821951+moqimoqidea@users.noreply.github.com>
Co-authored-by: MicroLee <yudexiaozhou@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>
Co-authored-by: icycrystal4 <icycrystal4@gmail.com>
Co-authored-by: sifang <sifang@staff.weibo.com>
Co-authored-by: Yanhe <yanhe1@staff.weibo.com>
Co-authored-by: parabala <chenyong1@staff.weibo.com>
Co-authored-by: wenbo17 <wenbo17@staff.weibo.com>
Co-authored-by: qdaxb <4157870+qdaxb@users.noreply.github.com>
Co-authored-by: 李枨煊 <chengxuan@staff.weibo.com>
Co-authored-by: johnny0120 <jiangyang7@staff.weibo.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
qdaxb added a commit that referenced this pull request Apr 3, 2026
* feat: add workspace archive and recovery for Pod deletion

Implement Pod recovery feature that allows users to continue conversations
after executor Pods are deleted:

- Add ArchiveInfo schema to store archive metadata in Task.status.archive
- Add workspace_archive service for MinIO presigned URL generation
- Add archive/restore endpoints in executor and executor_manager
- Add ExecutorRecoveryService for Pod recreation with workspace restoration
- Add skip_git_clone support to prevent git clone conflicts during restore
- Add Celery Beat scheduled task for expired archive cleanup (30-day retention)
- Integrate archive workflow in executor_job before Pod deletion

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

* fix(backend): add missing minio dependency

Add minio package to backend dependencies for workspace archive storage.

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

* feat(admin): add created_at field to device monitor list (#846)

- Add created_at field to AdminDeviceInfo schema in backend
- Add created_at to AdminDeviceInfo TypeScript interface
- Display creation time in device list UI
- Add i18n translations for created_at column (zh-CN and en)

Co-authored-by: yunpeng7 <yunpeng7@staff.weibo.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

* perf: use async heartbeat (#849)

* fix(chat_shell): prevent orphaned tool call IDs in group chat history (#852)

* fix(chat_shell): prevent tool call group splitting in group chat history truncation

_truncate_history blindly sliced the flat message list, which could
split assistant+tool_calls and their tool response messages across the
truncation boundary. This produced orphaned function_call_output items
without matching function_call entries in the OpenAI Responses API
format, causing 'No tool call found for function call output' errors.

Add _group_messages() to treat assistant+tool_calls+tool responses as
atomic units, and modify _truncate_history() to truncate by groups
instead of individual messages.

* fix(chat_shell): ensure tool call group integrity across all compression paths

Extract group_tool_call_messages() into shared messages/utils.py and
apply atomic group handling to:
- HistoryTruncationStrategy.compress(): adjust first/last boundaries
  to avoid splitting tool call groups, add post-removal orphan cleanup
- _force_compression_to_target(): Step 2 removes middle groups instead
  of individual messages, Step 5 keeps first/last groups
- Refactor loader.py to import shared utility instead of inline helper

All 95 related tests pass. Comprehensive audit confirms no other code
paths in chat_shell break tool call group integrity.

* test(chat_shell): add tool-call group truncation regressions

Add regression coverage for preserving assistant tool calls with their matching tool results across group-chat history truncation, history compression boundaries, and forced compression fallback paths.

* fix: 在里面智能体的创建人和机器人的创建人不是一个人时会报错 (#853)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 在里面智能体的创建人和机器人的创建人不是一个人时会报错

* fix: 迁移其他的sql到kindReader

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix: fail fast on invalid tool call IDs across chat protocols (#854)

* fix: 订阅任务执行间隔调整 & trace http接口的匹配规则调整 (#855)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: telemetry的匹配规则调整

* fix: 订阅任务执行间隔调整

* fix: 调整逻辑

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix: sanitize PyInstaller LD_LIBRARY_PATH for child processes (#859)

PyInstaller's bootloader prepends its extraction directory (/tmp/_MEIxxxxxx)
to LD_LIBRARY_PATH, causing child processes (Claude Code, shell commands)
to load wrong shared libraries (e.g., libtinfo.so.6).

Extract `sanitize_ld_library_path()` into platform_compat and apply it in
both local_mode_strategy (Claude SDK subprocess) and extension_handler
(extension script subprocess) to restore the original library path.

See: https://pyinstaller.org/en/stable/common-issues-and-pitfalls.html

Co-authored-by: sifang <sifang@staff.weibo.com>

* refactor(rag): move internal retrieve routing into backend (#847)

* refactor(rag): move internal retrieve routing into backend

* refactor(rag): move retrieve persistence into backend

* refactor(rag): move kb head persistence into backend

* fix(rag): tighten backend retrieve routing

* refactor(rag): simplify token estimation fallback

* refactor(rag): batch route token estimation

* fix(rag): token estimator decimal

* fix(rag): harden kb read persistence

* frontend: show 'indexing' status for documents pending indexing (#858)

* fix(frontend): show 'indexing' status for documents pending indexing

When a document is uploaded, is_active is false while indexing is in progress.
Previously, this showed 'index unavailable' which was misleading.

Now documents with status='enabled' but is_active=false will show 'indexing'
instead of 'index unavailable', matching the existing translation key.

Changes:
- Updated compact mode status indicator (line 247)
- Updated normal mode status badge (line 461)

Fixes: knowledge base document shows 'index unavailable' during indexing

* fix(i18n): update Developer role description in Chinese locale

* fix: 修复订阅器中脏数据导致的无法展示的问题 (#860)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 修复订阅器中脏数据导致的无法展示的问题

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* feat(backend): add knowledge base RAG support to /v1/responses API (#844)

* feat(backend): add knowledge base RAG support to /v1/responses API

Implement knowledge base Q&A functionality for the OpenAI-compatible
/v1/responses endpoint with the following changes:

Schema Changes:
- Add knowledge_base_names field to WegentTool schema
- Support namespace#name format for KB specification

New Services:
- KnowledgeBaseNameResolver: resolves KB display names to IDs with
  permission checking via TaskKnowledgeBaseService
- KnowledgeBaseContextCreator: creates SubtaskContext records for
  API-specified KBs to integrate with existing RAG pipeline

Integration:
- Extend parse_wegent_tools() to handle knowledge_base tool type
- Add parse_knowledge_base_name() for namespace#name parsing
- Modify build_execution_request() to accept knowledge_base_names
- Add _create_kb_contexts_from_api_request() for KB context injection
- Update openapi_responses.py endpoints to pass KB names parameter

Testing:
- Add comprehensive unit tests for KB name resolution
- Add tests for KB context creation
- Add tests for helper functions with KB support
- All 32 new tests passing

The implementation reuses the existing RAG flow through
prepare_contexts_for_chat() and KnowledgeBaseTool, ensuring
consistency with the web UI behavior.

* refactor(kb_resolver): optimize database query complexity from O(n) to O(m)

- Add batch_get_knowledge_base_by_names() to TaskKnowledgeBaseService for efficient batch queries
- Extract _check_kb_access_permission() for unified permission checking logic
- Update kb_resolver to use service methods instead of direct queries
- Reduce DB queries from O(n) to O(m) where m is unique namespace count
- Update tests to mock service methods instead of internal functions

All 15 tests pass.

* refactor(backend): optimize KB permission check in kb_resolver

Simplify permission checking by using get_all_knowledge_bases_grouped()
which already returns all KBs accessible to the user.

Changes:
- Replace _batch_query_kbs() and _check_kb_access_permission() with
  _get_accessible_kb_lookup() that builds a lookup dict from grouped results
- Remove unused resolve_single() method and batch_get_knowledge_base_by_names()
- Update tests to mock KnowledgeService.get_all_knowledge_bases_grouped()

This reduces database queries and simplifies the permission check logic.

* feat(backend): integrate knowledge base context creation into unified AI trigger

- Add knowledge_base_names parameter to build_execution_request for OpenAPI v1/responses
- Create _create_kb_contexts_from_api_request helper to process KB names from API requests
- Integrate KB context processing into unified trigger flow
- Add KnowledgeBaseContextCreator class for creating SubtaskContext records
- Add comprehensive unit tests for KnowledgeBaseContextCreator

This enables RAG functionality for OpenAPI v1/responses endpoint by creating
SubtaskContext records that are processed by the existing context pipeline.

* fix(chat): propagate HTTPException from KnowledgeBaseNameResolver in unified trigger

- Add HTTPException import from fastapi
- Catch and re-raise HTTPException explicitly in _create_kb_contexts_from_api_request
- Keep generic exception handling for non-HTTP exceptions to preserve best-effort behavior
- This ensures 403/404 errors from KB resolution are properly propagated to callers
  instead of being swallowed and logged as warnings

* fix(chat_shell): use model_type for provider detection instead of model_id (#861)

- Extract shared detect_provider() into models/providers.py with
  PROVIDER_ALIASES as single source of truth
- model_type (env.model) is authoritative; raise ValueError on unknown
- Remove _PROVIDER_ID_PATTERNS model_id prefix fallback (same model_id
  can serve multiple protocols)
- Unify truncation notice logic for all providers (no system-role notice
  in middle of messages, preventing Anthropic non-consecutive system
  message errors)
- Pass model_type from model_config through MessageCompressor to
  TokenCounter for accurate provider detection
- Remove duplicate provider constants from factory.py and token_counter.py

Co-authored-by: wenbo17 <wenbo17@staff.weibo.com>

* ix: claude的子代理模式不可用修复 (#862)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: claude的子代理模式不可用修复

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* feat(inbox): implement work queue and message forwarding system (#851)

* feat(inbox): implement work queue and message forwarding system

Add a comprehensive message forwarding and work queue system that enables
users to forward conversation messages to other users. Recipients can
manage received messages through work queues and optionally configure
AI agents for automatic processing.

Backend changes:
- Add QueueMessage and RecentContact database models
- Add WorkQueue CRD schema stored in kinds table
- Implement work queue services for CRUD operations
- Implement message forwarding service with queue selection
- Add WebSocket events for real-time notifications
- Add API endpoints for work queue management
- Add ForbiddenException to core exceptions

Frontend changes:
- Add inbox page with queue sidebar and message list
- Implement ForwardMessageDialog for recipient selection
- Add queue edit/create dialog with auto-processing config
- Add message detail dialog with content preview
- Add i18n translations (zh-CN and en)
- Register inbox route and navigation

* fix: resolve lint errors in inbox feature

- Remove unused imports (RefreshCw, Settings, Menu, Button, Input, Clock)
- Format Python files with Black

* fix: resolve TypeScript errors in inbox feature

- Add 'flow' and 'inbox' to TopNavigation activePage type
- Replace Badge variant 'outline' with 'info' (outline not supported)

* fix: address CodeRabbit review comments for work queue feature

- Fix status parameter shadowing fastapi status module in work_queue.py
- Fix NamespaceMember.namespace to use group_name column reference
- Replace func.json_set with Python-level update for PostgreSQL compatibility
- Fix refreshQueues dependency loop using functional state update
- Remove Chinese text from inbox page comment
- Add NaN validation for schedule interval input
- Replace clickable Badge with accessible button for recent contacts

---------

Co-authored-by: qdaxb <4157870+qdaxb@users.noreply.github.com>

* Wegent/work queue and message forwarding (#863)

* feat(inbox): implement work queue and message forwarding system

Add a comprehensive message forwarding and work queue system that enables
users to forward conversation messages to other users. Recipients can
manage received messages through work queues and optionally configure
AI agents for automatic processing.

Backend changes:
- Add QueueMessage and RecentContact database models
- Add WorkQueue CRD schema stored in kinds table
- Implement work queue services for CRUD operations
- Implement message forwarding service with queue selection
- Add WebSocket events for real-time notifications
- Add API endpoints for work queue management
- Add ForbiddenException to core exceptions

Frontend changes:
- Add inbox page with queue sidebar and message list
- Implement ForwardMessageDialog for recipient selection
- Add queue edit/create dialog with auto-processing config
- Add message detail dialog with content preview
- Add i18n translations (zh-CN and en)
- Register inbox route and navigation

* fix: resolve lint errors in inbox feature

- Remove unused imports (RefreshCw, Settings, Menu, Button, Input, Clock)
- Format Python files with Black

* fix: resolve TypeScript errors in inbox feature

- Add 'flow' and 'inbox' to TopNavigation activePage type
- Replace Badge variant 'outline' with 'info' (outline not supported)

* fix: address CodeRabbit review comments for work queue feature

- Fix status parameter shadowing fastapi status module in work_queue.py
- Fix NamespaceMember.namespace to use group_name column reference
- Replace func.json_set with Python-level update for PostgreSQL compatibility
- Fix refreshQueues dependency loop using functional state update
- Remove Chinese text from inbox page comment
- Add NaN validation for schedule interval input
- Replace clickable Badge with accessible button for recent contacts

* feat: update work queue

---------

Co-authored-by: qdaxb <4157870+qdaxb@users.noreply.github.com>

* fix: fix column default value

* fix: fix forward message click

* feat: remove unused area

* feat: add inbox default message

* fix: 修复脏数据导致的订阅任务无法执行的问题 (#865)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 修复脏数据导致的订阅任务无法执行的问题

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix(browser): harden browser-tool linux recovery (#867)

Co-authored-by: sifang <sifang@staff.weibo.com>

* fix: 修复无法使用自定义镜像以及自定义镜像无法校验的问题 (#866)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 修复无法使用自定义镜像

* fix: 修复无法使用自定义镜像以及自定义镜像无法校验的问题

* fix: 修复可能的bug

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix: fix welcome timezone (#868)

* docs: update inbox docs (#869)

* fix: 修复单测 (#870)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 修复单测

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix: fix page error (#871)

* fix: data-roleid="api-key-create-button" not in html attr (#873)

* fix: 修复停止按钮偶发变成发送的问题 & 修复失败的消息会丢失的问题 (#876)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 修复停止按钮偶发变成发送的问题

* fix: 修复失败的消息会丢失的问题

* fix: 修复类型报错

* fix: 修复前端复制按钮内容错误的问题

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* fix: 修复“skill not found” (#877)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* fix: 技能错乱

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>

* chore(executor): upgrade claude-agent-sdk from 0.1.31 to 0.1.51 (#880)

Co-authored-by: sifang <sifang@staff.weibo.com>

* feat(frontend): add HTML attachment preview and share link generation (#872)

- Add HtmlPreview component for previewing HTML files with iframe and source view modes
- Update FilePreview to support HTML file type detection and rendering
- Add createAttachmentShareLink API for generating public share links
- Add share button to FilePreviewDialog and FilePreviewPage (visible for owners only)
- Add Web Page type label and icon for HTML attachments in AttachmentCard
- Fix preview page height to fill viewport using h-screen and h-full
- Update AttachmentPreview to support HTML file preview button

Fixes share link browsing and download for table-type attachments

* fix(knowledge): harden document indexing state (#875)

* fix(knowledge): harden document indexing state

* fix(knowledge): harden indexing state transitions

* fix(knowledge): tighten reindex review followups

* fix(rag): KNOWLEDGE_INDEX_LOCK_MAX_RETRIES=1

* fix(knowledge): store index status without db enum

* fix(alembic): correct migration revision metadata

* docs: update contributors list (zh) (#879)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* docs: update contributors list (#878)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* feat: 支持skill认证 (#882)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: update contributors list

* docs: update contributors list (zh)

* docs: add skill http identity design and plan

* feat(skill): add http identity token flow

* feat: 修改样式

* feat: 修改样式

* feat: 移除计划

* feat: 调整为带有认证的接口

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>
# Conflicts:
#	executor_manager/services/sandbox/manager.py

* Feature/knowledge document read (#888)

* docs(backend): add knowledge document read spec and plan

* feat(backend): add orchestrated knowledge document reads

* fix(backend): tighten knowledge document read handling

* refactor(web-scraper): add configuration for specific sites that require special handling (#884)

* refactor(web-scraper): extract site-specific config to scraper_config.py

- Add scraper_config.py for site-specific crawling configurations

* fix(web_scraper): load WEB_SCRAPER_SITE_CONFIG from Pydantic settings instead of os.environ

- Add WEB_SCRAPER_SITE_CONFIG to Settings class in config.py
- Refactor scraper_config.py to use settings.WEB_SCRAPER_SITE_CONFIG with proper logging
- Replace module-level config loading with cached get_site_config() function
- Update scraper_service.py to use new get_site_config() function
- Add detailed logging for site config matching and application
- Fix remove_overlay_elements duplicate key in CrawlerRunConfig

This ensures the configuration is properly loaded from .env file via Pydantic settings."

* refactor(backend): improve scraper_config security and type safety

- Remove sensitive config value from INFO level logging
- Add return type annotations to _load_site_config and get_site_config
- Replace broad Exception catch with specific exception types (AttributeError, KeyError, TypeError, ValueError)
- Import Dict and Any from typing module

* refactor(backend): replace auto-cleanup with archive expiration check

Remove automatic MinIO archive cleanup (Celery Beat task) and instead
block task execution when workspace archive has expired (>30 days).
Users will receive a clear error message and must create a new task.

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

* feat: 添加恢复行为测试和脚本路径修正

* fix: 使用 timezone.utc 替换 UTC 以确保时区正确

* test(backend): fix workspace recovery test patches

* feat: 添加工作区归档配置测试与默认值

* feat: 添加工作区归档时区配置及测试

---------

Co-authored-by: yunpeng7 <yunpeng7@staff.weibo.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: axb <qindi@staff.weibo.com>
Co-authored-by: moqimoqidea <39821951+moqimoqidea@users.noreply.github.com>
Co-authored-by: MicroLee <yudexiaozhou@gmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: hongyu9 <hongyu9@staff.weibo.com>
Co-authored-by: icycrystal4 <icycrystal4@gmail.com>
Co-authored-by: sifang <sifang@staff.weibo.com>
Co-authored-by: Yanhe <yanhe1@staff.weibo.com>
Co-authored-by: parabala <chenyong1@staff.weibo.com>
Co-authored-by: wenbo17 <wenbo17@staff.weibo.com>
Co-authored-by: qdaxb <4157870+qdaxb@users.noreply.github.com>
Co-authored-by: 李枨煊 <chengxuan@staff.weibo.com>
Co-authored-by: johnny0120 <jiangyang7@staff.weibo.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
cocowh pushed a commit to cocowh/Wegent that referenced this pull request May 11, 2026
fix(frontend): fix mobile compact mode for repo and branch selectors (wecode-ai#859)

See merge request weibo_rd/common/wecode/wegent!1052
cocowh pushed a commit to cocowh/Wegent that referenced this pull request May 11, 2026
fix: sanitize PyInstaller LD_LIBRARY_PATH for child processes (wecode-ai#859)

See merge request weibo_rd/common/wecode/wegent!1833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants