Commit Graph

997 Commits

Author SHA1 Message Date
Stream 5d5a6ce26c Merge branch 'fix/ignore-missing-env' into deploy/dev 2026-03-10 14:32:38 +08:00
Stream e0557109ae Merge branch 'main' into deploy/dev 2026-03-10 14:30:20 +08:00
Stream ed66cb7a17 fix: don't panic on env loading error 2026-03-10 14:26:26 +08:00
wangxiaolei 550346ed81 fix: fix instanceLocker repeat unlock (#620) 2026-03-09 14:01:33 +08:00
Yansong Zhang ecc5df571a add source for plugin task query api 2026-03-09 10:44:14 +08:00
wangxiaolei d9fe93f1f9 feat: plugin package clean command line (#584) 2026-03-08 10:20:13 +08:00
wangxiaolei c100de8665 feat: add uv sync offline flag (#624) 2026-03-05 15:26:47 +08:00
wangxiaolei 4314b8f1ee fix: synchronize remote debugging plugins across cluster nodes (#589)
Remote debugging plugins were not being synchronized across cluster nodes,
causing "no plugin available nodes found" errors when trying to invoke
plugins from different nodes.

1. **Remote debugging plugins not registered to cluster** - The
   `ClusterTunnel` notifier was not being added to ControlPanel
2. **Plugin ID inconsistency** - Remote plugins used different plugin_id
   formats during installation vs. querying
3. **Non-idempotent registration** - `RegisterPlugin` failed on reconnection
   with "plugin has been registered" error

- **internal/types/models/curd/atomic.go**:
  - Unify plugin_id calculation for remote plugins (author/name without version)
  - Remove plugin_id from plugin query conditions
  - Clear old cache when plugin_id is updated

- **internal/cluster/plugin.go**:
  - Make `RegisterPlugin` idempotent by updating existing plugin instead
    of returning error

- **internal/core/control_panel/daemon.go**:
  - Add cluster field to ControlPanel
  - Add SetCluster() method for lazy cluster initialization

- **internal/core/control_panel/server_debugger.go**:
  - Register remote debugging plugins to cluster on connection
  - Unregister from cluster on disconnection

- **internal/core/plugin_manager/manager.go**:
  - Add SetCluster() method to set cluster after initialization

- **internal/server/server.go**:
  - Call SetCluster() instead of AddClusterTunnel()

Only remote debugging plugins are synchronized across cluster nodes.
Local plugins run only on the node where they are installed and are
not registered to the cluster.

- Error handling improvements using `errors.Is()` instead of `==`
- Handle 404 for missing plugin assets gracefully
- Handle already-installed debugging plugins gracefully

- Remote debugging plugin can be invoked from any node in the cluster
- Plugin reconnection works without errors
- Cache invalidation works correctly when plugin_id changes
2026-03-05 14:46:13 +08:00
Stream 752cfbdf6a fix: align index with SaaS (#617) 2026-03-04 18:13:36 +08:00
wangxiaolei 07815fd34c fix: fix lru miss init (#622)
* fix: fix lru miss init

* fix: gemini review

---------

Co-authored-by: Stream <Stream_2@qq.com>
2026-03-04 12:30:25 +08:00
Byron.wang f96a0f1961 bump otel package from 1.39.0 to 1.41.0 (#618) 2026-03-04 10:25:25 +08:00
wangxiaolei c8c48a1697 fix: fix install context is not right (#613) 2026-03-02 01:06:53 +08:00
wangxiaolei 72288c38e8 fix: ZIP files always use forward slashes / regardless of the operating system (#616) 2026-02-27 16:53:07 +08:00
Stream da9b7ae7ce chore: add logging for session and redis (#614) 2026-02-14 15:52:45 +08:00
wangxiaolei 5fe1c8fe0e fix: write correct error structure (#611) 2026-02-14 10:17:37 +08:00
Byron.wang 0917707477 bump alpine and golang version in dockerfile (#605)
* bump alpine and golang version in docker file

* update golang base image
2026-02-09 11:45:58 +08:00
wangxiaolei f272e6c3fc feat: install plugin should be idempotent (#576)
* feat: install plugin should be idempotent

* chore: add new test
2026-01-27 16:28:23 +08:00
wangxiaolei 35825a7925 feat: support opentelemetry (#583) 2026-01-27 13:36:13 +08:00
wangxiaolei 777abb7826 fix: fix missing .venv can not self healing (#579) 2026-01-23 22:19:11 +08:00
Yeuoly 23a4662e65 feat: add retry mechanism for serverless invocation on 502 errors (#569)
* feat: add retry mechanism for serverless invocation on 502 errors

- Add MAX_SERVERLESS_RETRY_TIMES config (default: 3) for configurable retry attempts
- Implement exponential backoff retry logic (500ms, 1s, 2s, ...) for 502 Bad Gateway errors
- Only retry on 502 status code as it indicates transient AWS Lambda gateway issues
- Add comprehensive test suite with 11 test cases covering all retry scenarios
- Ensure proper HTTP response body cleanup on retries to prevent resource leaks

* refactor: simplify retry logic and error handling in serverless invocation

* fix: max time

* fix: test
0.5.3
2026-01-20 16:46:39 +08:00
wangxiaolei e8f8f17f1a feat: add redis distribute lock (#564)
* feat: add redis distribute lock

* refactor: use structured logging for python env

---------

Co-authored-by: Yeuoly <admin@srmxy.cn>
2026-01-15 17:06:02 +08:00
Oscaner Miao 2be1f651a9 feat(#450): add Redis SSL/TLS configuration support (#558)
* feat(#450): add Redis SSL/TLS configuration support

Add comprehensive SSL/TLS support for Redis connections with configurable certificate verification modes. Introduces new environment variables for SSL configuration including REDIS_USE_SSL, REDIS_SSL_CERT_REQS (supporting CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED), and REDIS_SSL_CA_CERTS for custom CA certificates.

Changes:
- Add Redis SSL configuration options to .env.example
- Implement RedisTLSConfig() method to build tls.Config based on environment settings
- Pass TLS config to both standard Redis and Sentinel mode initializers
- Support custom CA certificate loading and verification modes
- Set minimum TLS version to 1.2 for security
- Minor whitespace cleanup in existing config comments

This enables secure Redis connections in production environments with flexible certificate verification options.

* fix(#450): prevent reference cycle in TLS config and simplify SSL setup

- Capture only RootCAs in VerifyConnection closure to avoid retaining
  entire tlsConf and potential reference cycles
- Remove redundant nil checks for tlsConf in Redis client initialization
  since tlsConf is guaranteed to be non-nil when useSsl is true
- Update comments to reflect actual behavior and constraints

* fix(#450): improve Redis TLS certificate verification logic for optional certificates

* fix(#450): simplify Redis TLS certificate verification logic for optional and required certificates

* docs(#450): add note for CA certificate file path in Redis SSL configuration

* test(#450): add comprehensive tests for Redis TLS configuration

* fix(#450): enhance Redis SSL configuration documentation and enforce CA cert requirement

* fix(#450): add nil TLS parameter to InitRedisClient calls in tests

Update all InitRedisClient function calls across test files to include the new nil parameter for TLS configuration. This change maintains backward compatibility by explicitly passing nil for TLS settings in non-TLS test scenarios.

* fix(#450): add default TLS configuration for Redis client when no tlsConf is provided
2026-01-13 16:27:16 +08:00
Stream 91c5db64b5 feat: prioritize pyproject.toml when installing plugin dependencies (#557)
* feat: prioritize `pyproject.toml` when installing plugin dependencies

* refactor: rename variable for clarity in SDK version extraction logic

* refactor: use local_runtime.ConstructPluginRuntime

* refactor: use local_runtime.ConstructPluginRuntime

* refactor: fail when uv not found

* refactor: use more realistic test plugin data

* refactor: don't accept dependencyFileType other than pyprojectTomlFile and requirementsTxtFile

* refactor: use type-safe constant to replace hard-coded string

* refactor: use factory function of LocalPluginRuntime
2026-01-13 12:52:41 +08:00
wangxiaolei d58d6cb5e2 fix: add server_host force listen to ipv4 (#566) 2026-01-12 19:00:58 +08:00
Yeuoly 0d1c3abb58 fix: update busybox installation in Dockerfile for improved security (#555) 2026-01-02 18:54:13 +08:00
Yeuoly 25f20f8692 fix: update redis dependency to v9.6.3 for security improvements (#554) 2026-01-02 18:54:01 +08:00
Byron.wang ca3d00229e Feat/Implement structured logging and Trace ID propagation (#552)
* use slog instead of log package and format to new log schema

* update the environment name to LOG_OUTPUT_FORMAT

* add the env to .env.example

* fix log reference error

* change the order of milldlewares

* delete unused code

* fix the concurrently session potential race condition

* fix the log format in tests

* update the duplicate code

* refactor: convert log functions to slog structured format

- Change log.Error/Info/Warn/Debug/Panic to accept msg + key-value pairs
- Remove printf-style formatting from log functions
- Update log calls in internal/cluster, internal/db, internal/core/session_manager
- Remove unused 'initialized' variable from log package
- Remaining files will be updated in follow-up commits

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* refactor: update all log call sites to use slog structured format

Convert all log.Error, log.Info, log.Warn, log.Debug, and log.Panic
calls from printf-style formatting to slog key-value pairs.

Before: log.Error("failed to do something: %s", err.Error())
After:  log.Error("failed to do something", "error", err)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* refactor: update cmd/ log calls to use slog structured format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

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

* feat: implement GnetLogger for structured logging in gnet

* refactor: remove deprecated log visibility functions and related calls

* feat: enhance session management with trace and identity context propagation

* feat: implement serverless transaction handler and writer for plugin runtime

* refactor: rename context field to traceCtx in RealBackwardsInvocation

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Yeuoly <admin@srmxy.cn>
2025-12-30 11:00:48 +08:00
wangxiaolei bf9e6e9b9b chore: init listener first avoid panic error (#548) 0.5.2 2025-12-22 18:41:13 +08:00
Yippee Song 1773b1a340 fix PluginDaemonInternalServerError: no available node, plugin runtime not found (#549)
* fix PluginDaemonInternalServerError: no available node, plugin runtime not found

Fix the bug where after a plugin is successfully upgraded, new requests result in the plugin daemon service responding with "no available node, plugin runtime not found".

The root cause is that when the plugin is upgraded successfully, the corresponding value in Redis is not updated. Consequently, when a new request arrives, it reads the outdated plugin version from Redis and fails to locate the correct runtime.

* raise error if failed
2025-12-22 18:40:57 +08:00
Yeuoly 66fa57e415 fix: enhance process management to prevent zombie processes and clarify instance state handling (#544) 2025-12-19 15:47:36 +08:00
Xin Zhang 4f48fdbc3c Align plugin manifest validation error messages with regex length limits (#547) 2025-12-19 15:33:21 +08:00
Yeuoly 38ec23dabf fix: add default database for pg bouncer support (#545) 2025-12-19 15:29:44 +08:00
Yeuoly 4b75eed6b7 refactor: separate CI tests, and support pg bouncer (#529)
* feat: add support for PgBouncer in database initialization

* refactor: consolidate gorm configuration for database connection

* Add MySQL and multi-driver DB integration tests (#535)

* feat: streamline integration tests by using a centralized docker-compose file

* fix: add timeout

* refactor: replace inline service definitions with docker-compose action for integration tests

* fix: update pgbouncer image and environment variable names for consistency
2025-12-17 22:08:47 +08:00
Michael.Y.Ma 8ff1c2c9f2 Feat: Add OSS-specific parameters for HW and ALI private deployment (#539)
* Update internal/types/app/config.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* Update internal/server/server.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2025-12-17 16:36:56 +08:00
非法操作 72e9a7bc21 fix: plugin log not display after refactor (#537)
* fix: plugin log not display after refactor

* Update internal/core/local_runtime/notifier_logger.go

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* feat: add logging support for local runtime instance events

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Yeuoly <admin@srmxy.cn>
2025-12-16 14:14:19 +08:00
Yeuoly 11e00ea026 refactor: remove uuid-ossp dependency and update ID generation logic (#536)
* refactor: remove uuid-ossp dependency and update ID generation logic

* fix: condition error
2025-12-13 16:25:15 +08:00
Yeuoly 0eb2cbe284 Fix/remove tenant id reference in readme service (#530)
* fix: remove tenant ID reference from plugin readme service

* fix: rename PluginReadme to PluginReadmeRecord to remove tenant ID reference

* fix: handle error when saving plugin readme map to database

* fix: remove TenantId from FetchPluginReadme request binding

* fix: standardize error message casing for plugin unique identifier validation
2025-12-12 15:35:06 +08:00
dependabot[bot] 9cdcdb492e chore(deps): bump golang.org/x/crypto from 0.40.0 to 0.45.0 (#531) 2025-12-12 12:06:57 +08:00
Maries 96b51115cb fix: add unique index for plugin installation to prevent duplicate entries (#528) 0.5.1 2025-12-10 18:54:25 +08:00
Maries 8e5743aef6 feat: implement locking mechanism for concurrent plugin installation and upgrade (#526)
* add locking to prevent simultaneous installations of the same plugin
* ensure proper unlocking of keys in case of errors during installation and upgrade
* handle database not found error in DeletePluginInstallationItemFromTask
2025-12-10 17:27:43 +08:00
Yeuoly 0d282de6a1 feat: support multimodal rerank and embedding (#503)
* fix: align multimodal permission mapping

* fix: implement mock interface for multimodal embeddings

* fix: support multimodal embedding

* fix: incorrect reference
0.5.0
2025-12-09 14:56:11 +08:00
longbingljw ad7d3a1ab7 update config after mysql adaptation (#514)
* update config after mysql adaptation

* fix

* fix
2025-12-08 16:38:26 +08:00
非法操作 89ebb77188 feat: to support tool multi-select input (#523) 2025-12-08 12:32:57 +08:00
Yunlu Wen 77637afbc5 fix: handle connection close on the connector side (#522) 2025-12-07 18:02:44 +08:00
wangxiaolei 68db8475c9 fix: fix ReadCloser is not closed (#518) 2025-12-03 18:18:30 +08:00
Yunlu Wen f954688930 enterprise related adjustment (#510)
* remove enterprise logics

* release lock if runtime already installed

* support setting serverless endpoint by api

* remove global tenant id totally

* scan timeout tasks

* adding comments

* use index in loop

* add log
2025-12-03 18:13:54 +08:00
Boris Polonsky d3d1a652e6 Rename InstallToLocalFromPkg to InstallToLocal (#511) 2025-12-02 20:19:44 +08:00
非法操作 4b25ad67ba fix: tool and trigger not response icon_dark (#517) 2025-12-02 16:12:51 +08:00
非法操作 e10b48fccd fix: remote debug not work (#515) 2025-12-02 16:12:17 +08:00
Yunlu Wen c1ff2515ae fix: remove restriction of orphan plugins in local mode (#509) 2025-11-24 17:34:32 +08:00