Commit Graph
1542 Commits
Author SHA1 Message Date
Xubin Ren c111aaa7ee fix(dream): gate periodic commits on content changes 2026-07-11 11:16:59 +08:00
Aleksander W. Oleszkiewicz (Alek)andXubin Ren 9adcd3d923 adding tests to prevent regression 2026-07-11 11:16:59 +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 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
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
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 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
Aleksander W. Oleszkiewicz (Alek)andXubin Ren f074aa7d80 feat: add --refresh flag to onboard command for non-interactive config updates 2026-07-08 20:56:06 +08:00
Aleksander W. Oleszkiewicz (auticon)andXubin Ren 65d32ffd6c Fix dependency assertions in tests
Added a new `aiohttp` dependency for Slack
2026-07-08 12:16:30 +08:00
chengyongruandXubin Ren 883776358e fix: keep local api serve unauthenticated
maintainer edit: Align OpenAI-compatible API auth with the WebSocket channel boundary: loopback serve remains usable without a key, while wildcard binds still fail before agent initialization unless api.api_key is configured.
2026-07-08 12:16:12 +08:00
chengyongruandXubin Ren 460c62c0b0 fix: validate api key before serve setup
maintainer edit: Check api.api_key before template sync and AgentLoop construction so missing-key startup errors are not hidden by provider or workspace initialization failures.
2026-07-08 12:16:12 +08:00
hamb1yandXubin Ren e86133c434 fix: require api auth in server factory 2026-07-08 12:16:12 +08:00
hamb1yandXubin Ren 6c59332a8a fix: require api key for serve 2026-07-08 12:16:12 +08:00
chengyongruandXubin Ren fa73448f6f fix(webui): drive slash command routing from metadata 2026-07-07 15:42:04 +08:00
chengyongruandXubin Ren 3f33ff3143 chore: remove unused dead code 2026-07-07 15:41:27 +08:00
chengyongruandXubin Ren 29e99d3742 docs: document Alt+Enter multiline input
maintainer edit: document the supported interactive CLI multiline shortcut and trim comments left after removing Shift+Enter support.
2026-07-07 15:41:08 +08:00
chengyongruandXubin Ren 01a0f5aaf3 fix: remove unreliable Shift+Enter shortcut
maintainer edit: keep Alt+Enter as the supported multiline input path and remove the terminal-dependent Shift+Enter ANSI sequence patch.
2026-07-07 15:41:08 +08:00
77a6003255 fix(cli): make Alt+Enter insert a newline on LF-as-Enter terminals
On terminals that send a bare LF for plain Enter (WSL is the case
prompt_toolkit itself calls out), Alt+Enter arrives as ESC + LF
("\x1b\x0a" = Escape + ControlJ), not the ESC + CR the existing
"escape","enter" binding matches. The Escape was swallowed and the bare
LF hit prompt_toolkit's default submit, so the documented "universally
supported" Alt+Enter newline fallback failed on exactly the terminal path
plain Enter is preserved for.

Bind ESC + ControlJ to insert a newline too, and add a real-PromptSession
regression test covering the WSL Alt+Enter path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 15:41:08 +08:00
25a477050d fix(cli): make the xterm modifyOtherKeys Shift+Enter encoding insert a newline
"\x1b[27;2;13~" (the older xterm modifyOtherKeys / rxvt encoding of
Shift+Enter) is already registered by prompt_toolkit by default -- as
Keys.ControlM, i.e. plain Enter/submit. The previous `setdefault()` call was
therefore a silent no-op against it: this Shift+Enter variant kept behaving
like a submit instead of inserting a newline, even after the ControlJ/WSL
fix, since setdefault only sets missing keys.

Assign directly to override that default for both known Shift+Enter
sequences, since inserting a newline is the whole point of the binding.
Add a regression test driving a real PromptSession/parser with this exact
sequence, since a mocked-buffer test can't observe prompt_toolkit's default
ANSI_SEQUENCES entries taking priority.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 15:41:08 +08:00
ea0516e655 fix(cli): stop hijacking ControlJ for Shift+Enter, it breaks Enter on WSL
Keys.ControlJ is also the literal LF byte ("\x0a") that some terminals send
for a plain Enter keypress -- prompt_toolkit's own default bindings handle
this by re-feeding it as ControlM/submit, and calls out WSL by name as the
case that needs it. Binding our Shift+Enter handler to ControlJ shadowed
that default, so on any terminal sending LF for Enter, pressing Enter only
ever inserted a newline and the prompt could never be submitted.

Register the CSI-u Shift+Enter sequences against Keys.ControlF3 instead: an
enum member prompt_toolkit declares but never wires to a default ANSI
sequence or key binding, so it's only reachable through our own mapping.

Also add a regression test that drives a real PromptSession/Vt100Parser
with a raw LF byte -- the existing key-binding test invoked handlers
directly against a mocked buffer, which exercises the handler logic but not
prompt_toolkit's key-resolution precedence, so it couldn't have caught this.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-07 15:41:08 +08:00
wangjunweiandXubin Ren 18a230de75 feat(cli): support multiline input via Shift+Enter / Alt+Enter
The interactive prompt used a single-line buffer (multiline=False), so
there was no way to compose a multi-line message before submitting.

Switch to a multiline-capable buffer with custom key bindings: Enter still
submits (unchanged feel), Alt+Enter always inserts a newline, and
Shift+Enter inserts a newline on terminals that emit a distinguishable
CSI-u sequence for it (kitty, iTerm2 with the fixterms protocol) by mapping
those sequences onto the otherwise-unused ControlJ key.
2026-07-07 15:41:08 +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