Commit Graph
129 Commits
Author SHA1 Message Date
Liang Jiaqing 3be6ed35ba feat: add Tauri desktop shell + desktop_bridge (url mode, no-console) 2026-05-15 18:29:00 +08:00
nianyucatfish fe47bb29cb feat(tui): click-to-expand folds, streaming spinner, layout polish (#390)
- Per-fold click-to-expand: assistant messages render as a sequence of
  text/fold-header/fold-body widgets; FoldHeader is a clickable Static
  that toggles m._toggled_folds and remounts just that message
- Ctrl+O is authoritative: clears all per-fold overrides so the state
  is uniformly all-collapsed or all-expanded
- Streaming spinner: dedicated tiny Static (`m._spinner_widget`) after
  segment widgets, driven by an independent 100ms timer. Bypasses
  Markdown completely so unclosed code fences / paragraph whitespace
  trimming can't eat it
- Hide `**LLM Running (Turn N) ...**` markers at render time only;
  fold_turns still uses them for splitting
- Ctrl+B sidebar toggle: invalidate width-keyed cache and reuse the
  resize debounce path so the chat reflows reliably after toggling
- #input min-width: 10 — guards Textual TextArea.render_lines against
  `range() arg 3 must not be zero` when sidebar is shown on a very
  narrow window and #main collapses to ≤ 0 cols
2026-05-15 18:19:29 +08:00
nianyucatfish 90a3dff557 fix(tui): file paste, block-delete, ctrl+c copy, per-session input (#389)
- Pasting non-image files (.docx/.pdf/.py …) was folded as `[Image #N]`
  because clipboard helper returned any file path. Split into image vs
  file by extension; non-images now fold as `[File #N]` and expand to
  the path on submit, same flow as images.
- Backspace/Delete used to nibble placeholders one char at a time.
  Override `action_delete_left/right`: when the caret sits flush against
  a `[Pasted text #N +X lines]` / `[Image #N]` / `[File #N]` placeholder
  on the matching side, remove the whole span and drop its dict entry.
- Ctrl+C inside the input was clearing the whole field. Root cause:
  `screen.get_selected_text()` doesn't see TextArea's internal selection,
  so the handler fell through to the input-reset branch. Fixed by
  preferring the focused InputArea's `selected_text` before screen-level
  drag selection.
- Input text/history/pastes were globally shared across agent sessions
  (single InputArea widget). Moved the four state slots
  (text/history/pastes/paste_counter) onto `AgentSession`, with a
  `_swap_input_for_session` snapshot/restore on session switch.
2026-05-15 15:38:53 +08:00
Liang Jiaqing fc6b5ad309 refactor: parameterize compress/trim intervals, add stop/kill subagent actions, remove web/pet CLI commands 2026-05-15 12:18:33 +08:00
LJQ ffb268554e Merge pull request #380 from desmonna/main
refactor(langfuse/chatapp):
2026-05-14 23:15:01 +08:00
Liang Jiaqing 1d30b98280 conductor: cleanup style, filter aborted agents, add auto-cleanup thread; llmcore: conditional _drop_unsigned_thinking for non-claude models; task_planning: minor edit 2026-05-14 22:55:50 +08:00
nianyucatfish dce09f8fdd feat&fix(tui): paste/scroll polish, /continue & /export pickers, mac aliases (#379)
* fix(tui): compat _select_state for textual 8.2.6 (was _select_start)

* feat(tui): right-click paste, sticky scroll, /continue & /export pickers, mac aliases

- InputArea 右键粘贴:复用 _insert_paste_text 多行折叠,统一文本/图片/Ctrl+V 三条粘贴路径
- action_paste 兜底通过 tkinter 读 OS 剪贴板,修复 Ctrl+V 在非 bracketed-paste 终端拿不到外部内容
- 消息区 sticky-bottom 跟随:用户上滚自动取消跟随;提交消息或斜杠命令完成后强制 scroll_end
- /continue 无参打开 ChoiceList(上限 20 项,超出标注 [仅显示最近 N/M]);恢复操作通过 call_after_refresh 推迟,避免折叠 widget 引用失效
- /export 选 "file" 改为预填可编辑文件名:/export <timestamp>.md,可改名/改后缀后回车
- macOS 防御性 Cmd 别名:cmd+c / cmd+v / cmd+n / cmd+/ 镜像对应 Ctrl 绑定;on_key disarm 兼容
- 顺手清理:_handlers dict 取代手写 if-elif 链;注释精简;修复 /branch deepcopy crash、/clear+/rewind DOM 未清的 bug;sidebar 末次提问解耦 sess.messages,改读 LLM 端 history 以保持 /clear 后预览不变
2026-05-14 22:48:10 +08:00
desmonna ce11952daf refactor(langfuse/chatapp):
- Fix 1: _patched_log function signature mismatch
  - Location: plugins-langfuse_tracing.py
  - Problem: monkey-patch function only accepts 2 parameters, but the original function has 3 parameters (including the default parameter log_path)
  - Fix: add log_path=None parameter and pass it to the original function
- Fix 2: Agentmain module import failure
  - Location: frontends-chatapp_common.py
  - Problem: frontends directory cannot be imported into the agentmain of the upper directory
  - Fix: Add the parent directory to sys.path at the beginning of the file
2026-05-14 22:46:06 +08:00
nianyucatfish 508d5692c5 Feat/v2 keybindings (#365)
* fix(tui): debounce v2 layout reflow on resize

Same-size resize events are deduped, layout reflow is debounced to 80ms,
and message remount is deferred to the next frame so #messages.content_region
reports the post-resize width instead of the pre-resize one.

* feat(tui): rebind v2 keys (Ctrl+C dual, Ctrl+↑↓ sessions, Ctrl+O fold) + help overlay

- Ctrl+C is the single stop/quit key: stops a running task; otherwise
  clears non-empty input; otherwise arms quit (press again within 2s to
  exit). Removes Ctrl+S, Ctrl+Q, and InputArea's prior Ctrl+C
  copy-or-clear binding. Any non-Ctrl+C key disarms the pending quit.
- Ctrl+O toggles turn fold (was Ctrl+F, which collides with terminal
  app search shortcuts on macOS). Topbar gains a small "▾ fold"
  indicator when fold mode is on.
- Ctrl+Up / Ctrl+Down switches sessions (was Ctrl+Left / Ctrl+Right)
  to match the vertical session-list mental model.
- Esc is the single one-press cancel for ChoiceList — drops the prior
  two-step "Left to leave, Left to cancel" flow. Esc also continues to
  close the command palette and now closes the help overlay.
- Adds a Ctrl+? help overlay listing every keybinding. Bound on both
  ctrl+? and ctrl+question_mark to survive terminal reporting quirks.
- Newline keeps Ctrl+J / Ctrl+Enter / Shift+Enter as cross-terminal
  fallbacks (Ctrl+J is the portable one for macOS Terminal.app); drops
  Alt+Enter.
- Bottom bar simplifies to four essentials + Ctrl+? and / hints, and
  shows a transient "再按 Ctrl+C 退出" while quit is armed.

* fix(tui): switch help shortcut from Ctrl+? to Ctrl+/

Ctrl+? (= Ctrl+Shift+/) is unreliable across terminals — many emulators
either swallow it or report it as something Textual can't parse. Ctrl+/
is the conventional VS Code / command-line help shortcut and ships with
the legacy Ctrl+_ fallback (ASCII 0x1F is what older terminals send for
Ctrl+/). All three forms are bound (ctrl+slash, ctrl+/, ctrl+underscore)
so the binding survives terminal-reporting differences.

Bottom hint bar collapses to a single left-aligned line carrying the
command-palette and help hints alongside the action keys, since the
prior right column repeated information the left column already had room
for. The help overlay header reads "快捷键帮助" instead of "快捷键".

* fix(tui): ctrl+c dual-press with non-empty input, centered help modal

- Ctrl+C with non-empty input now clears AND arms quit; a second Ctrl+C
  within 2s exits. Previously typing in the input let one Ctrl+C exit
  silently after the clear, which was easy to trigger by accident.
- Help is now a ModalScreen pushed over the main screen so opening it
  no longer shifts the input box. Centered with a lighter background
  (#21262d on #30363d border) to read as a lifted panel.
- Esc-cancelling a ChoiceList removes the prompt cleanly with no
  "已取消" output — the canceled prompt simply disappears from the
  chat, matching expectations for in-flight tool prompts.

* fix(tui): keep Ctrl+C copy semantics and update choice hints

When there is selected text, Ctrl+C now copies the selection and returns
without triggering stop, input clear, or quit-arming. This preserves the
TUI selection/copy path after Ctrl+C became the global stop/quit key.

Choice prompts now advertise the current Esc-cancel behavior instead of
the removed Left-arrow flow, and stale comments/docs mentioning the old
left-arrow return path were cleaned up.
2026-05-13 23:04:23 +08:00
Liang Jiaqing 05c6b427c6 feat: add conductor system, code_review_principles; update llmcore, supervisor_sop, goal_mode constraints, gitignore whitelist 2026-05-13 23:02:52 +08:00
ozy 006d44c4f4 fix(tui): 仅在输入框真正边界时触发历史回溯 (#362)
* fix: tighten tui input history edge navigation

* 回退一些注释的修改
2026-05-13 19:26:27 +08:00
nianyucatfish 0accd0e319 fix(tui): restore wheel scroll on macOS in tuiapp_v2 (#361)
PR #360 disabled Textual mouse support on darwin (run(mouse=False)) to
keep terminal-native selection working. Side effect: ?1006 SGR mouse was
never enabled, while macOS Terminal.app / iTerm2 default ?1007 (alternate
scroll mode) translated wheel events into Up/Down keys — which then
triggered the newly added input-history navigation.

Re-enable mouse globally and explicitly disable ?1007 on mount so wheel
events flow through the SGR channel without spawning duplicate arrow
keys. Keyboard Up/Down history navigation is unaffected. The ?1007
disable is a no-op on Linux / Windows Terminal where it defaults off.
2026-05-13 18:58:58 +08:00
Shen HaoandAI Agent Review 95d858ade8 feat(tui): v2 image paste folding, history nav, /llm & /export choice (#360)
Co-authored-by: AI Agent Review
2026-05-13 16:04:58 +08:00
nianyucatfish 6bb31046cc fix(tui): keep v2 output scrolled during stream updates (#356)
When an assistant message already has a mounted body widget, streaming updates only refreshed the widget content. Scroll the messages container after those in-place updates so both streaming chunks and final responses remain visible at the bottom.
2026-05-13 10:56:26 +08:00
nianyucatfish 09cd8577e0 fix(tui): avoid duplicate paste in tuiapp_v2 (#352)
Handle paste events directly for both short and multi-line input instead of mixing TextArea's default paste path with the custom placeholder path. This keeps single-line paste from being inserted twice while preserving the existing multi-line placeholder behavior.
2026-05-13 10:34:32 +08:00
Liang Jiaqing 3205f4a017 feat: dynamic tool_result maxlen based on parallel tool count 2026-05-13 10:21:13 +08:00
nianyucatfish 2468801050 feat(tui): add tuiapp_v2.py — refined Textual frontend (#350)
新版 TUI 与 tuiapp.py 并存,共享 GenericAgent 调度/队列/线程协议,
重做视觉与交互:
- 多行 InputArea:≤3 行自适应、>3 行三行滑动窗口、粘贴占位符
- 命令面板(OptionList + 模糊匹配 + Tab 补全)
- /llm、command 选择走 ChoiceList,选完区域收缩
- Markdown HardBreak 渲染 + ANSI 缓存
- 响应式布局(窄屏隐藏侧栏 / 宽屏按比例放大)
- selection-aware 自动滚动(选文本时不抢滚动)
- 新增 /btw、/continue、/export、/restore

不改 cli / hub / README / tuiapp.py 入口。
2026-05-12 22:26:35 +08:00
Liang Jiaqing 736f88a00a feat(tui): multi-line input with Enter submit, Ctrl+Enter newline, paste-safe 2026-05-11 21:12:28 +08:00
YooooEX 1b9fe1f539 feat(tgapp): add /btw command handling (#335) 2026-05-11 20:06:04 +08:00
manaskarra ee02e7eba5 fix(tgapp): preserve streaming overflow segments (#330)
Keep Telegram streaming overflow messages tied to the primary live message, reuse them across edits, and delete stale overflow replies when streamed content shrinks.
2026-05-11 09:40:18 +08:00
nianyucatfish 9024af7499 feat(stapp): add /export command (clip/file/all) (#322) 2026-05-09 23:08:20 +08:00
Liang Jiaqing 3c5c99fd6d chore: replace alarming warning with neutral "(无文本输出)" in feishu display 2026-05-09 19:51:35 +08:00
Liang Jiaqing a2f0f0d46a fix(stapp): restore finally abort guard in agent_backend_stream 2026-05-09 18:12:09 +08:00
Shen HaoandClaude Opus 4.7 03d19c9821 feat: add /btw side-question subagent (#317)
Mirrors Claude Code's /btw: ask the agent a quick question without
interrupting the in-flight main task.

- frontends/btw_cmd.py: snapshot backend.history under lock + deepcopy →
  background-thread backend.raw_ask single-turn answer; never writes
  backend.history; never touches task_queue. Reuses backend.raw_ask +
  make_messages, no new LLM instance.
- frontends/chatapp_common.py: register /btw in HELP_COMMANDS; handle
  /btw in AgentChatMixin (sync via asyncio.to_thread); install() at
  module bottom so the slash hook is wired for any frontend that
  imports chatapp_common.
- frontends/stapp.py: persist display_queue + partial_response in
  st.session_state so the streaming bubble survives Streamlit reruns;
  new render_main_stream() helper covers both new tasks and resume;
  /btw branch uses plain st.rerun() (preserves dq) so the main task's
  remaining output renders in a follow-up bubble; non-/btw prompts
  explicitly call agent.abort() to keep the original "submit cancels"
  UX. Strip <summary> meta tags from text segments and drop dangling
  "LLM Running (Turn N) ..." markers in resumed partials to clean up
  the rendered chat.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 15:26:05 +08:00
Liang Jiaqing ca79699492 feat(tui): add /clear and /close commands 2026-05-09 14:56:52 +08:00
Liang Jiaqing 639da67916 feat: fsapp reconnect loop, tui branch/rewind, simphtml flow-child fix, sop updates 2026-05-08 15:48:16 +08:00
solopole 2fdbb289ed feat(discord): improve channel activation and progress display (#292) 2026-05-08 11:56:55 +08:00
Liang Jiaqing c7cef56cb2 fix: invalidate panel cache on fold toggle 2026-05-07 22:23:48 +08:00
Liang Jiaqing cc6b3fbee1 tuiapp: cache rendered panels; llmcore: simplify fast_ask 2026-05-07 22:18:25 +08:00
Liang Jiaqing 379b69e0ec refactor: simplify LLM client init with resolve_client; add fast_ask; auto-fold old tasks in TUI 2026-05-07 21:06:14 +08:00
Liang Jiaqing 98e2e3f483 tuiapp: improve session nav (ctrl+arrows), CJK-aware sidebar, README restructure 2026-05-07 18:15:08 +08:00
Liang Jiaqing a9450b1f18 fix(tui): shorten sidebar Q/S to prevent wrapping, add Ctrl+1~9 session switch 2026-05-07 17:41:12 +08:00
Liang Jiaqing d4ab909144 feat: add Textual TUI frontend + minor fixes to agentmain/llmcore/stapp 2026-05-07 17:38:58 +08:00
succ985andsucc985 0148446fab feat(wechat): add persistent typing indicator (#278)
The previous implementation called send_typing once with an empty
typing_ticket, which had no effect. The iLink API requires a valid
typing_ticket obtained from getconfig first.

Changes:
- Add get_typing_ticket() method to fetch ticket via getconfig API
- Replace single send_typing call with continuous typing loop
- Typing refreshes every 2 seconds until agent finishes processing
- Stops cleanly via threading.Event when message handling completes

Co-authored-by: succ985 <succ985@users.noreply.github.com>
2026-05-07 13:11:15 +08:00
Tianye Song fd7bfcd9d3 fix(qqapp): exponential reconnect backoff
Replace fixed 5s sleep with the same backoff pattern already used in
dcapp.py: 5 -> 10 -> 20 -> ... -> 300s, resetting to 5s when a session
survived >=60s. Uses time.monotonic() to avoid clock-jump skew.
2026-05-07 10:29:37 +08:00
LJQ e08d7c7370 Merge pull request #266 from wellsoren/qt-ui-redesign
QT界面持续优化和bug修复
2026-05-06 13:33:36 +08:00
LJQ 04f7158aa7 Merge pull request #274 from yiqi-017/feat/acp-bridge
fix: ACP bridge streaming overlap and truncation
2026-05-06 13:33:07 +08:00
Jiaqing Liang 2d0b8e9648 Improve English UI defaults and task timeout 2026-05-06 13:23:33 +08:00
yiqi-017andClaude Opus 4.6 a7a1487004 fix: use incremental streaming in ACP bridge to prevent text overlap
Switch to inc_out=True mode so queue items are incremental deltas
instead of cumulative text. The old cumulative approach broke when
agentmain's post-processing (</summary>\n\n insertion) shifted offsets,
causing the bridge's delta calculation to produce overlapping or
truncated content.

Now "next" items are forwarded directly, and "done" is only used as
content when no streaming occurred (error fallback).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-06 03:54:09 +08:00
LJQ a0e0cc66d8 Merge pull request #272 from yiqi-017/feat/acp-bridge
feat: add ACP bridge for codeg integration
2026-05-05 18:10:33 +08:00
yiqi-017andClaude Opus 4.6 dfe6bf0709 refactor: move acp bridge to frontends/
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-05 14:28:13 +08:00
Liang Jiaqing f0ff7ee49e remove newtab, add terminal QR, refine task_planning sop 2026-05-04 12:39:41 +08:00
wellsoren 3f712aeb66 Merge branch 'main' of github.com:lsdefine/GenericAgent 2026-05-03 22:25:44 +08:00
Liang Jiaqing 9f3ddec78f /resume prompt优化(v5) + wechatapp去or空占位 + summary截断80 2026-05-03 16:36:48 +08:00
wellsoren 4bbdf8cb26 chore: sync with upstream and update qtapp 2026-05-03 15:35:53 +08:00
wellsoren 5bd947b958 chore: sync with upstream and update qtapp 2026-05-03 14:31:13 +08:00
Liang Jiaqing 2afe4c3e39 feat: auto-inject summary text block when model outputs thinking+tool_use without text; stapp fallback uses content preview 2026-05-03 12:22:05 +08:00
hanshou101 dece612853 fix(fsapp): rollover oversized Feishu task cards (#209) 2026-05-02 14:54:46 +08:00
KailigithubandKailigithub e22bdae74d fix: add Linux CJK font paths for desktop pet bubble text rendering (#248)
Co-authored-by: Kailigithub <Kailigithub@users.noreply.github.com>
2026-05-02 12:32:16 +08:00
tqjason 8bea96614e Fix pet reference in rightMouseDown_ method (#239) 2026-05-01 08:45:51 +08:00