Commit Graph
638 Commits
Author SHA1 Message Date
Liang Jiaqing cd9764719c fix: multi-session tab switch live rendering + move SETUP_FEISHU to docs/ 2026-05-16 22:59:14 +08:00
Shen Hao d0e44d2307 feat(cli): one-line startup banner showing model name (#400)
Display a concise startup banner with model name when running in interactive TTY mode.
2026-05-16 20:30:49 +08:00
Shen Hao 7dc240412c docs(tui): rephrase cost_tracker docstring to use API-mode wording (#399)
Rephrased docstring in cost_tracker.py to clarify API-mode tracking semantics.
2026-05-16 20:30:46 +08:00
LJQ 2566bb82d4 feat(tui): /rename, /cost, /continue, ask_user picker, runtime (#397)
feat(tui): /rename, /cost, /continue <name>, ask_user picker, runtime…
2026-05-16 19:39:25 +08:00
Shen Hao 46029f1d89 feat(tui): /rename, /cost, /continue <name>, ask_user picker, runtime tips
Adds to frontends/tuiapp_v2.py:
- /rename <name>: rename current session; collision-checked across in-memory
  sessions and the persistent registry. Topbar and sidebar refresh in place.
- /continue <name>: resume by stored name in addition to the existing index
  form (/continue 1). The picker (/continue with no arg) labels each entry
  with its stored name when available.
- /cost [all]: per-session token usage (input / output / cache_create /
  cache_read), elapsed time, request count, and context-window %-left. The
  "all" form lists every tracked thread, including ended sessions.
- ask_user picker upgrades: free-text escape hatch on every list, Esc-back
  navigation, single/multi-select switch from a [多选]/[multi] question hint,
  candidate sanitizer that handles JSON-envelope debris.
- Runtime tip footer (`└ Tip: ...`) that rotates short usage hints.
- Topbar status chip showing the active model + idle/busy state.
- Cross-platform launcher hardening: auto-install of rich/textual on first
  run, and a hint when running under git-bash/mintty.

New modules:
- frontends/session_names.py: JSON sidecar at temp/model_responses/
  session_names.json keyed by log-file basename; touched only by /rename and
  /continue <name>. continue_cmd is not modified.
- frontends/cost_tracker.py: per-thread TokenStats, captured via
  monkey-patches on llmcore._record_usage and llmcore.print (Anthropic SSE's
  final output count only arrives via the latter). Idempotent install().

No core files touched.
2026-05-16 19:24:35 +08:00
Liang Jiaqing 915dad9ff4 fix(bridge): stop/cancel now works - add timeout to queue.get + cancel check in loop 2026-05-16 18:57:52 +08:00
Liang Jiaqing 413e48bbad fix: cancel→abort, cancel_requested guard, wechatapp use turn/outputs instead of _turn_parts 2026-05-16 18:03:51 +08:00
Liang Jiaqing 0efd4bd173 agentloop yield turn dict marker; agentmain intercepts and tracks per-turn outputs 2026-05-16 17:13:42 +08:00
Liang Jiaqing 4f8f81e016 desktop: add --no-autostart/--dev flags, auto-start bridge, disable devtools by default 2026-05-16 16:46:13 +08:00
Liang Jiaqing 6ddf60a023 feat(desktop): auto-discover python/project paths, add fallback.html, merge PR #395 2026-05-16 16:09:00 +08:00
Liang Jiaqing 7f6d9c7caf Merge branch 'pr395'
# Conflicts:
#	frontends/desktop/src-tauri/Cargo.lock
#	frontends/desktop/src-tauri/src/lib.rs
2026-05-16 16:06:48 +08:00
AspasZhang 13bbd4a5ed fix(desktop): IME composition fix, single-instance guard, macOS bundle support
- app.js: triple-guard for CJK IME composition (compositionstart/end + keyCode 229)
- lib.rs + Cargo.toml: add tauri-plugin-single-instance to prevent zombie processes
- tauri.conf.json: add "dmg" target and png icons for macOS bundling
2026-05-16 12:28:13 +08:00
Liang Jiaqing 8f6dbf09c3 feat(desktop): rename crate to ga-desktop, add single-instance plugin 2026-05-16 12:14:05 +08:00
Liang Jiaqing ef8d86a3ca deps: add aiohttp for desktop bridge 2026-05-16 11:44:45 +08:00
Liang Jiaqing fa2f2cd809 style: tidy desktop bridge imports 2026-05-16 11:27:08 +08:00
Liang Jiaqing 352c0ed194 docs: move installation guides into docs directory 2026-05-16 11:21:10 +08:00
Liang Jiaqing b95175d87e update README and add installation docs (#393)
Squashed PR #393: update README.md and add installation docs.
2026-05-16 11:12:52 +08:00
nianyucatfish 76614ee38d feat(tui): improve message scrolling and rewind picker (#392)
* feat(tui): improve message scrolling and rewind picker

* feat(tui): add double-escape rewind shortcut
2026-05-16 08:10:09 +08:00
Liang Jiaqing 794d969369 bridge: reuse existing instance; smart scroll; remove /continue command 2026-05-15 20:11:51 +08:00
Liang Jiaqing 80918f3d97 feat: preserve scroll position on session switch + remove redundant Done prefix from fold headers 2026-05-15 19:19:26 +08:00
Liang Jiaqing 675a5a1873 refactor: i18n-free UI text, portable python lookup, README rewrite 2026-05-15 19:03:09 +08:00
Liang Jiaqing 3be6ed35ba feat: add Tauri desktop shell + desktop_bridge (url mode, no-console) v0.1.0 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
Liang Jiaqing c7edd749a9 chore: remove unused tgapp stream segment tests 2026-05-15 17:59:23 +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
AspasZhang 2cb1314b6b docs: update WeChat group 18 QR code (#370) 2026-05-14 12:13:43 +08:00
a60c938e89 refactor(configure): 重构配置向导 — 16 家厂商、启动流程优化、粘贴修复、新增微信平台 (#364)
* feat: add cross-platform GA command entry system

* fix: hide code runner console window

* 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.

* refactor: rename command/ to ga_cli/ to avoid namespace collision

* feat(tgapp): add /btw command handling (#335)

* fix(launch): skip paste interception when clipboard contains text

PPT/Word copies include both image/png and text/plain items.
Only intercept paste when no text item is present (pure screenshot/image).

* docs: update WeChat group 17 QR code (#338)

* feat(tui): multi-line input with Enter submit, Ctrl+Enter newline, paste-safe

* feat(reflect): add init() for runtime args with fallback to env/config

* 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 入口。

* docs: add Evaluation — Five Dimensions section (EN & CN) (#339)

* feat: dynamic tool_result maxlen based on parallel tool count

* feat(configure): major rewrite — 16 providers, new startup flow, paste fix

- Expand model providers from 12 to 16 (add Qwen, Stepfun, Tencent,
  Volcengine, Baidu Qianfan, Xiaomi MiMo, Zhipu Coding Plan, GMI)
- Merge duplicate entries (MiniMax/Kimi/Qwen/CRS) with protocol choice
- Add WeChat to messaging platforms (frontends/wechatapp.py existed but
  was not discoverable via configure.py)
- Add coding plan / token plan endpoint selection for applicable providers
- Rework startup flow: no mykey.py → suggest both; has mykey.py → modify/new
- Fix paste race condition in masked_input (batch read + deferred repaint)
- Fix _configure_advanced using provider['type'] instead of cfg['type']
- Fix backup filename containing '/' (invalid on Windows paths)
- Simplify Python version check to recommend 3.12 only
- Add manual model name input option regardless of probe result
- Remove dead code (_read_char, import time)

---------

Co-authored-by: Liang Jiaqing <l.j.q.light@gmail.com>
Co-authored-by: manaskarra <106862611+manaskarra@users.noreply.github.com>
Co-authored-by: YooooEX <me@yooooex.com>
Co-authored-by: AspasZhang <24210980075@m.fudan.edu.cn>
Co-authored-by: nianyucatfish <156216359+nianyucatfish@users.noreply.github.com>
Co-authored-by: Jinyi Han <15224975562@163.com>
2026-05-13 23:10:28 +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
Jiaqing Liang a06a9ad20a feat: tighten context budget - maxlen 15k, trim refactor with staged compress 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
Jinyi Han d2840ae0b3 docs: add Evaluation — Five Dimensions section (EN & CN) (#339) 2026-05-13 08:47:05 +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
Jiaqing Liang cf6551516f feat(reflect): add init() for runtime args with fallback to env/config 2026-05-12 12:59:30 +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
AspasZhang c247abb78a docs: update WeChat group 17 QR code (#338) 2026-05-11 20:38:38 +08:00
Liang Jiaqing f3f5b76d68 fix(launch): skip paste interception when clipboard contains text
PPT/Word copies include both image/png and text/plain items.
Only intercept paste when no text item is present (pure screenshot/image).
2026-05-11 20:27:26 +08:00
YooooEX 1b9fe1f539 feat(tgapp): add /btw command handling (#335) 2026-05-11 20:06:04 +08:00
Liang Jiaqing 2381d48a56 refactor: rename command/ to ga_cli/ to avoid namespace collision 2026-05-11 10:01:03 +08:00
WindCat e248aa8c02 feat: 添加跨平台 GA 命令行入口系统 (#329)
新增 command/ 包和 ga.cmd/ga 入口脚本,用户可通过 `ga <command>` 启动各前端。
2026-05-11 09:57:51 +08:00