Commit Graph
3514 Commits
Author SHA1 Message Date
chengyongruandXubin Ren 1ee4349a08 feat(webui): highlight file previews and diffs 2026-07-11 00:57:37 +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
Eric YangandXubin Ren a1fbfd9f7b fix(shell): drop gateway-wide waitpid(-1) zombie reaper
A global reaper can race asyncio's child watcher for just-exited
create_subprocess_exec children, causing Process returncode 255 instead
of the real command status. Keep only owned-PID reaps after wait/communicate
/kill paths in shell and exec_session.

Addresses review feedback on #4840.
2026-07-10 20:19:44 +08:00
Eric YangandXubin Ren bda0c099ab fix(shell): guard _reap_pid on os.waitpid availability
Windows CI runs Unix-path unit tests by patching _IS_WINDOWS=False while
still on win32, where os.WNOHANG/os.waitpid do not exist. Use capability
checks so reaping is a no-op on platforms without waitpid rather than
trusting the (mockable) platform flag.
2026-07-10 20:19:44 +08:00
Eric YangandXubin Ren ef14d1ea92 fix(shell): remove unused os import in exec_session
Ruff F401 failed CI on the zombie-reap PR; reaping uses shell._reap_pid
so os is not needed in this module.
2026-07-10 20:19:44 +08:00
Eric YangandXubin Ren c9e014fdea fix(shell): reap zombie processes on all subprocess exit paths
The previous fix (dbcc7cb5) only added os.waitpid() to _kill_process(),
covering the timeout/cancel path of one-shot exec. Zombies continued to
accumulate because several other exit paths never reaped children:

- _ExecSession.kill(): sent SIGKILL + process.wait(5s) but had no
  os.waitpid() fallback if the wait timed out
- ExecTool.execute() generic exception handler: leaked the subprocess
  if communicate() raised an unexpected error
- Normal completion paths: relied entirely on asyncio's child-watcher,
  which can miss exits inside Docker containers (pidfd/SIGCHLD gaps)

Changes:
- Extract _reap_pid() helper for consistent, safe os.waitpid(WNOHANG)
- Add _reap_pid() fallback to _ExecSession.kill() via try/finally
- Add _reap_pid() safety-net after normal process exit in both
  ExecTool.execute() and _ExecSession.poll()
- Kill + reap subprocess in the generic except Exception handler
- Add periodic zombie reaper background task (every 30s) in the
  gateway as a last line of defense
2026-07-10 20:19:44 +08:00
sidandXubin Ren d32f8961b1 fix(webui): bind landing first message to created chat 2026-07-10 20:19:10 +08:00
chengyongruandXubin Ren 45a6466c2c style: trim CSI-u shortcut comments
Maintainer edit: simplify the explanatory comments for the CSI-u shortcut while preserving the existing behavior and regression coverage.
2026-07-10 19:32:47 +08:00
99e04c2da2 fix(cli): handle CSI-u Shift+Enter instead of dumping raw escapes
Terminals speaking the CSI-u (kitty / fixterms) keyboard protocol -- kitty,
Ghostty, WezTerm, and terminal panes that default to it -- encode Shift+Enter
as the escape sequence "\x1b[13;2u". prompt_toolkit 3.0 has no support for
that protocol and no default mapping for the sequence, so its Vt100Parser
fails to recognise it and dumps the raw bytes ("^[[13;2u") straight into the
prompt buffer. The multiline-input work kept only Alt+Enter, so on these
terminals Shift+Enter now leaks visible escape garbage into the input.

Register "\x1b[13;2u" (absent from prompt_toolkit's default ANSI_SEQUENCES,
so setdefault() overrides nothing) and bind it to insert a newline, matching
the Alt+Enter behaviour. This is best-effort: prompt_toolkit cannot negotiate
the protocol, so we only react to a CSI-u sequence a terminal already emits;
terminals that collapse Shift+Enter into plain Enter fall back to Alt+Enter,
which stays the primary shortcut.

Add a real-PromptSession regression test asserting the sequence inserts a
newline rather than leaking raw escape bytes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-10 19:32:47 +08:00
NOKIAOandXubin Ren 87602a74ea narrower cert path 2026-07-10 19:32:23 +08:00
NOKIAOandXubin Ren ad55f3ce37 添加红帽系Linux的证书路径支持 2026-07-10 19:32:23 +08:00
Siddhant LondheandXubin Ren e284592649 fix(webui): sync package-lock.json to resolve docker build failure 2026-07-10 19:31:58 +08:00
chengyongruandXubin Ren 2154dc51d0 docs: add automation guide 2026-07-10 19:31:33 +08:00
chengyongruandXubin Ren fe7d94359b fix(agent): preserve runtime compatibility contracts 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren 10930f3902 Revert "test(agent): probe runtime change amplification"
This reverts commit 85c73779f9cb6c4cd707fb51f80cb4e363861861.
2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren 6b7470646f test(agent): probe runtime change amplification 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren 21f58cbabf refactor(agent): make resolver sole runtime owner 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren c9d3e74342 refactor(agent): require runtime for consolidation 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren 5bd3d1e0af refactor(agent): centralize runtime default mutations 2026-07-10 17:54:34 +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 45ace23580 test(agent): assert subagent runtime generation 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren b4f069800e refactor(agent): make runner consume required runtime 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren 3f8170e835 test(agent): characterize active runner provider drift 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren cb03d2c748 refactor(agent): snapshot generation without provider mutation 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren bd94fefd1a refactor(agent): introduce immutable model runtime resolver 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 bb3b449e09 refactor(agent): capture original user text per turn 2026-07-10 17:54:34 +08:00
chengyongruandXubin Ren 55317094b6 test(agent): characterize request context isolation 2026-07-10 17:54:34 +08:00
David JimenezandXubin Ren 6313ae9f4f add Dockerfile arg to override optional Python dependencies to install at build time 2026-07-09 23:58:59 +08:00
chengyongruandXubin Ren 4137be62a1 fix(matrix): preserve mxc markdown image sources 2026-07-09 23:58:26 +08:00
chengyongruandXubin Ren 0b9ca744c2 docs(webui): mention file edit previews in guide 2026-07-09 10:42:43 +08:00
chengyongruandXubin Ren 7685a89dcc docs(webui): describe file edit diffs 2026-07-09 10:42:43 +08:00
chengyongruandXubin Ren bbd4f4054b fix(webui): respect full access in file preview 2026-07-09 10:42:43 +08:00
chengyongruandXubin Ren 0ae28571e7 fix(agent): close file edit activity on cancellation 2026-07-09 10:42:43 +08:00
chengyongruandXubin Ren 6851a6ebd4 fix(webui): sync file edit display preference 2026-07-09 10:42:43 +08:00
chengyongruandXubin Ren 7768672c5b feat: add file edit diff progress view
Capture file edit snapshots through runner tool lifecycle hooks and render unified diffs in the WebUI with folding and truncation controls.
2026-07-09 10:42:43 +08:00
chengyongruandXubin Ren 207813d3b5 fix(webui): tighten localhost bootstrap check 2026-07-09 10:42:00 +08:00
chengyongruandXubin Ren e0c2d28f90 fix(webui): issue localhost bootstrap api tokens 2026-07-09 10:42:00 +08:00
chengyongruandXubin Ren 8559458258 refactor(agent): add turn hook factories 2026-07-08 21:02:12 +08:00
chengyongruandXubin Ren 04dbf17426 test(agent): cover turn hook ordering 2026-07-08 21:02:12 +08:00
chengyongruandXubin Ren a52a88455b refactor(agent): extract turn hook assembly 2026-07-08 21:02:12 +08:00
Xubin Ren 3ab09075c5 test(webui): tolerate wrapped bootstrap CLI output 2026-07-08 21:01:48 +08:00
chengyongruandXubin Ren 4ddd639e67 fix(webui): route missing API bootstrap tokens to auth
maintainer edit: handle review feedback by treating bootstrap responses without api_token as auth-required, and remove the obsolete issue_token(api_token=...) compatibility path now that API tokens are issued separately.
2026-07-08 21:01:48 +08:00
chengyongruandXubin Ren 444f488563 fix(webui): repair bootstrap secret launch paths 2026-07-08 21:01:48 +08:00
chengyongruandXubin Ren 88143a8bf0 fix(webui): gate bootstrap API token issuance 2026-07-08 21:01:48 +08:00
chengyongruandXubin Ren 7204d88a4c docs: add high-usage chat app guides 2026-07-08 20:56:27 +08:00
chengyongruandXubin Ren 1a21542d11 docs: address search entry review feedback 2026-07-08 20:56:27 +08:00
chengyongruandXubin Ren f531f1ce38 docs: improve search entry pages 2026-07-08 20:56:27 +08:00
chengyongruandXubin Ren 941a2541eb docs: document onboard refresh flag
maintainer edit: add CLI, quick start, and troubleshooting docs for the non-interactive config refresh flow introduced by this PR.
2026-07-08 20:56:06 +08:00