Commit Graph
204 Commits
Author SHA1 Message Date
chengyongruandGitHub b189a37648 fix(agent): preserve agent-owned state in project workspaces (#4945) 2026-07-22 17:25:22 +08:00
chengyongruandchengyongru 80085085d9 fix(exec): retain failed owner session cleanup 2026-07-22 15:28:34 +08:00
yorkhellenandchengyongru ebf1ef5cab test(subagent): verify cascade exec termination on /stop
- terminate_by_owner kills matching sessions, skips others, handles
  empty owner case
- cancel_by_session calls terminate_by_owner on the session key
2026-07-22 15:28:34 +08:00
amplifierplusandchengyongru cdb2df4982 fix(files): reject oversized reads before loading 2026-07-21 15:02:27 +08:00
chengyongruandXubin Ren d5658dbc91 fix: preserve background operator in allowlist segments
Maintainer edit: keep a top-level trailing '&' in the segment being matched so background execution cannot be checked as if the ampersand were absent. Redirection forms like 2>&1 and &> remain untouched.
2026-07-21 13:50:24 +08:00
chengyongruandXubin Ren 12c52c11d3 fix: treat single ampersand as shell segment
Maintainer edit: single '&' backgrounds the preceding command and starts another top-level shell segment, so allowPatterns must split it the same way as ';', '|', '&&', and '||'. Keep fd redirections such as 2>&1 and &> intact.
2026-07-21 13:50:24 +08:00
michaelxerandXubin Ren bbca32fea9 fix(security): validate each shell segment against exec.allowPatterns
Guard against shell-chain bypass where an attacker appends '&& malicious'
after an allowlisted prefix. The allowlist check now splits the command
on top-level chaining operators (&&, ||, ;, |) and requires every segment
to match at least one allowPattern independently.

Fixes #4521
2026-07-21 13:50:24 +08:00
KDBandXubin Ren 8981995474 fix(exec): clean up sessions on shutdown 2026-07-21 13:48:51 +08:00
chengyongruandGitHub 462a0dfb0f refactor(channels): make built-in channels self-contained (#4908)
* refactor(channels): own setup and instance contracts

* refactor(channels): isolate management contracts

* refactor(channels): normalize activation contracts

* fix(channels): enforce management contracts

* refactor(channels): finish setup ownership migration

* fix(channels): harden management contracts

* fix(channels): enforce lazy loading and runtime ownership

* fix(feishu): make multi-instance startup idempotent

* fix(webui): render channel setup contracts cleanly

* fix(feishu): stop websocket clients cleanly

* fix(channels): enforce persistence and activation gates

* fix(channels): preserve global feature action scope

* fix(channels): apply defaults for single plugins

* fix(channels): enforce management contract boundaries

* refactor(feishu): remove identity helper indirection

* fix(channels): preserve management setup contracts

* refactor(channels): generalize instance settings UI

* refactor(channels): package channel plugins with web UI metadata

* refactor(channels): make built-ins self-contained packages

* test(channels): colocate tests with channel packages

* fix(dingtalk): use official brand icon

* feat(channels): colocate webui translations

* docs(channels): clarify plugin ownership

* test(exec): remove output wait race

* refactor(channels): unify plugin descriptors

* fix(channels): enforce descriptor-owned contracts

* refactor(channels): finish package-owned plugin setup

* refactor(channels): use repository-owned packages only

* fix(channels): self-describe dependencies and runtime state

* fix(channels): warn about legacy entry points
2026-07-19 23:30:49 +08:00
adabarbulescuandXubin Ren d4f5abe004 fix: preserve real cancellation in MCP paths 2026-07-18 17:36:35 +08:00
yu-xin-candXubin Ren 07ad0bafa8 test(exec): relax wait-for timing on Windows 2026-07-18 17:35:56 +08:00
yu-xin-candXubin Ren 995cc44e89 fix(exec): isolate exec session managers 2026-07-18 17:35:56 +08:00
chengyongruandchengyongru 681edfa6f3 fix(providers): honor Codex proxy config consistently 2026-07-15 20:01:48 +08:00
chengyongruandchengyongru 2116e32013 test: speed up CI and harden the suite 2026-07-15 00:18:37 +08:00
chengyongruandchengyongru 1643aa7ef5 fix(shell): narrow PowerShell UTF-8 configuration
Avoid changing native pipeline input encoding and consolidate real PowerShell checks to reduce Windows runner startup flakiness.
2026-07-14 13:50:02 +08:00
chengyongruandchengyongru 9f8c2cb1bf test(shell): wait for Windows PowerShell sessions 2026-07-14 13:50:02 +08:00
chengyongruandchengyongru 61afbffc89 fix(shell): configure PowerShell UTF-8 output 2026-07-14 13:50:02 +08:00
adabarbulescuandchengyongru 9cdf17f5d5 Fix Windows exec UTF-16 output decoding 2026-07-14 13:50:02 +08:00
Xubin RenandGitHub fe0717b385 feat(webui): add guided setup flows
* feat(channels): add guided setup flows

* test(channels): preserve setup config values

* fix(channels): reflect saved setup state

* refactor(channels): simplify setup state metadata

* fix(channels): harden setup lifecycle

* refactor(channels): centralize setup contracts

* fix(channels): route setup actions through webui shim

* fix(channels): adapt settings for compact screens

* fix(models): preserve default preset display

* feat(models): add curated Codex catalog

* fix(webui): stop attached gateway on interrupt

* fix(webui): simplify apps catalog

* docs(webui): clarify apps and runtime features

* feat(settings): add guided capability setup

* fix(webui): harden setup and managed services

* test: keep managed runtime checks portable

* test: scope POSIX runtime coverage

* fix(webui): simplify file settings

* feat(files): bundle document reading

* fix(webui): harden setup request boundaries

* fix(webui): prevent channel setup status squeeze

* fix(settings): group provider compatibility aliases

* refactor(settings): remove redundant setup surfaces

* fix(webui): harden guided setup lifecycle

* fix(webui): preserve channel setup compatibility
2026-07-13 13:11:46 +08:00
chengyongruandXubin Ren 7f8c3453e1 refactor(agent): gate sustained goals behind explicit /goal
Replace the legacy long-goal skill contract with command-scoped goal tools and runtime guidance. Keep goal state durable across continuations while restricting create and replace mutations to explicit user /goal turns.
2026-07-12 00:35:17 +08:00
chengyongruandXubin Ren 7675364eae fix(tools): enforce edit_file line hints 2026-07-11 01:14:50 +08:00
chengyongruandXubin Ren 052fdc132d feat(tools): guard edit_file target lines 2026-07-11 01:14:50 +08:00
Eric YangandXubin Ren 9a1d1e64c7 fix(shell): harden kill path and add zombie reap tests
Skip process.kill() when returncode is already set so generic exception
handlers after a successful communicate() cannot raise ProcessLookupError.
Suppress race kill failures and still run the safety-net reap.

Add unit and integration coverage for owned-PID reaping on normal exit,
timeout, exception, and exec-session kill/poll paths.
2026-07-10 20:19:44 +08:00
chengyongruandXubin Ren af85c356b8 refactor(agent): capture subagent runtime before spawn 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren 198fd9f869 refactor(agent): capture runtime at turn admission 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren 42d7ad34a4 refactor(agent): unify request context routing 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren c5e053f83b fix: pin validated DNS for SSRF-safe fetches
maintainer edit: keep MCP HTTP SSRF checks strict, pin validated DNS for direct web_fetch and HTTP/SSE MCP requests, preserve explicit and environment proxy compatibility, and cover the proxy/redirect/rebinding cases with tests.
2026-07-07 15:40:53 +08:00
hamb1yandXubin Ren b68ae4f9bc fix: reject proxied pinned web fetches 2026-07-07 15:40:53 +08:00
hamb1yandXubin Ren 97e3b360c2 fix: serialize pinned dns web fetches 2026-07-07 15:40:53 +08:00
hamb1yandXubin Ren 4353f4680b fix: allow local mcp urls with pinned dns 2026-07-07 15:40:53 +08:00
hamb1yandXubin Ren 73bf299a59 fix: pin validated dns for ssrf checks 2026-07-07 15:40:53 +08:00
Xubin Ren b1d29ede7d test(mcp): cover limited enabledTools names 2026-07-06 12:11:37 +08:00
ThomasZP YangandXubin Ren 800d51ecac fix: align MCP tool matching with limited names 2026-07-06 12:11:37 +08:00
ThomasZP YangandXubin Ren 3f9fb63d4c fix: limit long MCP-derived tool names 2026-07-06 12:11:37 +08:00
Xubin Ren 1cfa48ad4a fix(web-search): return structured Serper errors 2026-07-06 12:11:31 +08:00
franciscomaestreandXubin Ren 8a42a9c73a feat(web-search): add Serper.dev (Google Search API) provider
Add 'serper' as a web search backend, following the existing provider
pattern (keenable/exa): POST to https://google.serper.dev/search with the
X-API-KEY header, map the 'organic' results into the shared result format,
and fall back to DuckDuckGo when no key is configured.

- key resolved from config.api_key or SERPER_API_KEY env var
- 429 handled with a rate-limit message; other HTTP errors surfaced
- tests cover success, env-key, no-key fallback, HTTP error and rate limit
- docs: add Serper config example and list it in tools.web.search providers
2026-07-06 12:11:31 +08:00
chengyongruandXubin Ren 122cf4213b fix: harden Windows exec shell edge cases
Maintainer edit: preserve raw cmd.exe quoting for shell='cmd', propagate native exit codes through the default PowerShell path, and keep quoted Windows executable paths invokable under PowerShell.
2026-07-06 12:11:25 +08:00
chengyongruandXubin Ren 8c4a74ee3c fix: honor explicit Windows cmd shell path
Maintainer edit: launch explicit cmd shells as cmd.exe /c so COMSPEC or absolute cmd.exe paths are actually used.
2026-07-06 12:11:25 +08:00
chengyongruandXubin Ren 4ec111c1a9 docs: clarify exec shell override guidance
Maintainer edit: make the shell parameter description explain defaults and when to override instead of only listing shell names.
2026-07-06 12:11:25 +08:00
chengyongruandXubin Ren 8222f3c85f docs: tailor exec shell guidance by platform
Maintainer edit: keep Windows PowerShell guidance out of Unix tool descriptions and cover the exposed schema text.
2026-07-06 12:11:25 +08:00
chengyongruandXubin Ren 220de320fb fix: harden Windows exec shell default
Maintainer edit: prefer pwsh when available so single-line commands support modern PowerShell operators, add -NonInteractive, and parse explicit cmd.exe paths with Windows path semantics for cross-platform tests.
2026-07-06 12:11:25 +08:00
dajiaohuangandXubin Ren 33b1c6f601 @
fix(exec): default Windows commands to PowerShell and allow shell parameter

Single-line commands on Windows were routed through cmd.exe
(asyncio.create_subprocess_shell) while multi-line commands used
PowerShell. This caused cross-drive cd failures, missing $VAR expansion,
and inconsistent behavior depending on whether a command contained a
newline. The shell parameter was also rejected on Windows.

- Route all Windows commands through PowerShell by default so single-line
  and multi-line commands share the same shell semantics.
- Allow the shell parameter on Windows: accepts powershell, pwsh, or cmd.
- cmd.exe remains reachable via shell="cmd" as an explicit escape hatch.
- Update tests to cover the new default and shell-parameter paths.

Fixes #4544
@
2026-07-06 12:11:25 +08:00
hamb1yandXubin Ren 10b52cfb3a fix: resolve builtin skill reads 2026-07-06 12:11:20 +08:00
chengyongruandXubin Ren 614ea86a81 test: align MCP transient reconnect coverage
maintainer edit: update the existing transient retry tests for reconnect-first behavior and keep structured retry-failure coverage in the focused MCP transient suite.
2026-07-04 21:15:18 +08:00
chengyongruandXubin Ren 6d28db3248 fix: reconnect MCP sessions on transient stream failures
maintainer edit: treat transient MCP stream failures as dead sessions so the existing reconnect handler can refresh the session before retrying. Also cover retry failure as a structured tool error.
2026-07-04 21:15:18 +08:00
Yuxin LouandXubin Ren 0d1221bece fix(mcp): contain malformed tool results 2026-07-04 21:15:18 +08:00
chengyongruandXubin Ren 54bcdb5a62 fix(exec): return early when session command exits 2026-07-02 14:36:06 +08:00
chengyongruandXubin Ren 21aa900d64 fix: honor MCP tool error results 2026-07-01 13:03:47 +08:00
chengyongruandXubin Ren 8493560976 refactor(tools): use structured tool error results 2026-07-01 13:03:47 +08:00
Xubin Ren f9b02496c8 fix(mcp): redact URL paths in logs 2026-06-30 22:43:12 +08:00