Commit Graph
3418 Commits
Author SHA1 Message Date
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
Aleksander W. Oleszkiewicz (Alek)andXubin Ren be8ac1e484 removed duplicated code 2026-07-08 20:56:06 +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
chengyongruandXubin Ren ea7f4679f1 fix(webui): keep prompt rail at original gutter offset 2026-07-08 12:16:47 +08:00
chengyongruandXubin Ren c188e96f4e refactor(webui): use container query for prompt rail layout 2026-07-08 12:16:47 +08:00
chengyongruandXubin Ren 815f15993c test(webui): dedupe prompt rail viewport setup 2026-07-08 12:16:47 +08:00
chengyongruandXubin Ren 4333d6f103 fix(webui): keep prompt rail out of narrow chat columns 2026-07-08 12:16:47 +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
Aleksander W. Oleszkiewicz (auticon)andXubin Ren 379785d365 Fix missing aiohttp slack dependency in pyproject.toml
Added `"aiohttp>=3.9.0,<4.0.0"` to the dependencies 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 28141ce20b docs: update serve api key requirement
maintainer edit: Align OpenAI-compatible API docs and examples with the new fail-closed api.api_key requirement while keeping /health documented as unauthenticated.
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 a7b8a9ed46 fix(webui): clarify new chat command text 2026-07-07 15:42:04 +08:00
chengyongruandXubin Ren 7e135b45f3 docs(webui): document slash command lifecycles 2026-07-07 15:42:04 +08:00
chengyongruandXubin Ren fa73448f6f fix(webui): drive slash command routing from metadata 2026-07-07 15:42:04 +08:00
chengyongruandXubin Ren 8a231b6e4d fix(webui): finalize turn-ending slash commands
maintainer edit: keep /new and manually submitted /stop from leaving stale WebUI streaming state after they cancel or reset the active turn.
2026-07-07 15:42:04 +08:00
chengyongruandXubin Ren ef5318ebdc fix(webui): classify builtin slash commands without metadata
maintainer edit: keep builtin shortcut commands on the side-channel path before async command metadata loads, while preserving /goal task text as a normal agent turn.
2026-07-07 15:42:04 +08:00
chengyongruandXubin Ren 8f68040f05 fix(webui): keep slash commands out of streaming state 2026-07-07 15:42:04 +08:00
chengyongruandXubin Ren 0f88927364 fix(webui): show generic tool arguments in activity 2026-07-07 15:41:45 +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
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 d04ad1a5b4 fix(gateway): resolve runtime config path for state refresh 2026-07-06 15:55:15 +08:00
dajiaohuangandXubin Ren 67b56cba74 @
fix(gateway): self-heal state file PID on server startup

After /restart on Windows, the gateway process gets a new PID (os.execv
creates a new process on Windows), but the state file at
run/gateway.<suffix>.json still contains the old PID from the initial
background spawn.  Nothing rewrites it, leaving state inconsistent.

Add GatewayRuntime.refresh_state_pid() — a classmethod that reads the
existing state file, updates the PID and identity to the current
process, and writes atomically.  Call it early in _run_gateway() so the
state file is always correct regardless of how the process was started
(initial spawn, os.execv, or subprocess.Popen).

On POSIX os.execv preserves the PID, so this is a no-op in normal
operation there, but still beneficial after any unusual restart path.

Fixes #4511
@
2026-07-06 15:29:11 +08:00
Kenneth ZhaoandXubin Ren 105230cc34 fix(cli): print response text when streaming fails in interactive mode 2026-07-06 15:28:10 +08:00
chengyongruandXubin Ren dd014b50a7 docs(mattermost): finish channel ordering cleanup
Maintainer edit: move remaining Mattermost documentation mentions to the end of named channel lists.
2026-07-06 12:14:57 +08:00
chengyongruandXubin Ren 595d789c6f docs(mattermost): list new channel last
Maintainer edit: keep Mattermost at the end of documented channel lists so existing channel order remains first-come-first-served.
2026-07-06 12:14:57 +08:00
chengyongruandXubin Ren cf35238834 fix(mattermost): harden channel lifecycle and streaming
Maintainer edit: keep the Mattermost adapter running under the gateway, fail closed when team filtering cannot verify the team, isolate new thread sessions immediately, and make buffered stream finalization retry-safe.
2026-07-06 12:14:57 +08:00
Kenneth ZhaoandXubin Ren ef9780719d style: fix import ordering in mattermost tests 2026-07-06 12:14:57 +08:00
Kenneth ZhaoandXubin Ren cc70a2a79f fix(mattermost): fix file download paths and mobile streaming
- Use Mattermost file metadata/download API paths that work with current servers
- Buffer streamed content and post the final reply once for mobile clients that ignore post edits
- Keep attachment upload behavior on the first split chunk
2026-07-06 12:14:57 +08:00
Kenneth ZhaoandXubin Ren f9806cc60f fix(mattermost): address second round of review feedback
- Send pairing code response (not empty message) for denied DMs
- Resolve actual channel type in action events before permission check
- Use word-boundary regex in _is_mentioned to avoid partial matches
- Use safe_filename for download path sanitization
- Add tests: denied DM pairing, denied action event, is_mentioned boundary
2026-07-06 12:14:57 +08:00
Kenneth ZhaoandXubin Ren 76877036f7 mattermost: remove unused _BOT_MENTION_RE 2026-07-06 12:14:57 +08:00
Kenneth ZhaoandXubin Ren a710a7d6f7 fix(mattermost): address review comments
- Attachments now only attached to first chunk when message is split
- Filename sanitized with Path(name).name to prevent path traversal
- Updated streaming tests to match buffer-and-post-at-end pattern
  (iOS compatibility)
2026-07-06 12:14:57 +08:00
Kenneth ZhaoandXubin Ren fff38f11a7 feat: add Mattermost channel support 2026-07-06 12:14:57 +08:00
chengyongruandXubin Ren 5e51c5014f feat(feishu): render new session divider
maintainer edit: remove out-of-scope reasoning panel changes and keep this PR focused on the /new session divider.
2026-07-06 12:14:54 +08:00
Xubin Ren 937f04ac86 docs(config): document canonical OpenCode provider 2026-07-06 12:13:00 +08:00