Commit Graph
842 Commits
Author SHA1 Message Date
陈克文 f43ea23ccf fix: os.startfile is Windows-only, use webbrowser.open to wake the browser (#598)
web driver init nudges the browser by opening a page when no session
appears; os.startfile raises AttributeError on Linux/macOS, killing
the retry loop on headless servers. webbrowser.open is stdlib and
cross-platform with the same effect.
2026-06-12 13:16:23 +08:00
nianyucatfish 262614cafd fix(tui-v2): restore CJK table copy alignment (#600)
The tool-cards change (#593) tightened _md_line_has_box_drawing to exempt
pure-horizontal '─' runs as markdown hr. But a SIMPLE-box Markdown table's
only box glyph is its header rule, so that exemption dropped whole tables
out of the passthrough copy path and into the wide-render aligner, which
maps selection cell-columns to character indices — misaligning copy of any
table with CJK (wide) cells.

Remove the pure-horizontal exemption so a table's header rule is detected
again and the table run stays passthrough. Card gutters (└─ / │ / └) keep
their own prefix-based exemptions, so tool cards are unaffected. The only
cost is a real markdown hr copying as a dash run — the pre-#593 behavior.
2026-06-12 13:15:34 +08:00
Liang Jiaqing 2cb4ad0d8d fix responses codex client metadata 2026-06-11 21:58:58 +08:00
nianyucatfish 5b43813814 feat(tui): plan 卡片 /continue 恢复 + 可滚动 4 行窗口 + Ctrl+S/Ctrl+C 修复 (#599)
* feat(tui): /continue 恢复 plan 卡片 + Ctrl+S/Ctrl+C 路由修复

plan-card 恢复:plan 模式判定改用日志中结构化的 enter_plan_mode
tool_use(continue_cmd.find_plan_entry),不再扫聊天文本——用户打字
伪造不出。is_active/resolve_path 新增 restored_path 信号,AgentSession
新增 restored_plan_path 字段,plan_scan_baseline 退化为仅供 current_step
的 📌 扫描用。

Ctrl+S restore 卡死:_stash_cleanup_restore 由 self.text= 改为
clear()+_insert_via_keyboard,走编辑管线避免长会话全屏 relayout,与
stash 清空路径对称。

Ctrl+C 弹回收紧:_cmd_stop 仅在该轮未被消费(agent 尚未产出回复)时
才把 user 文本弹回输入框,避免已答轮次污染输入框 / 重发导致历史重复。

* feat(tui): plan 卡片可滚动(4 行任务窗口)+ TODO 渲染为 [ ]/[x]

planbar 拆为固定表头/步骤行(#planbar-head)+ 任务滚动区
(#planbar-tasks,max-height:4)。最多露 4 个 TODO,其余滚轮/PageUp
翻看,去掉旧的 5 行预算与 ⋮ +N more 截断;表头与当前步骤行固定不滚。

任务标记 ☐/✔ → [ ]/[x],与 plan.md 源文件写法对齐。
2026-06-11 21:11:25 +08:00
Liang Jiaqing 87c4f63340 Update Codex native user agent 2026-06-11 11:05:32 +08:00
nianyucatfish 9badef879d feat(tui): 工具显示卡片 + /model 与 /effort 运行时切换 (#593)
tuiapp_v2 的两项增强,拆成两个 commit。

## 1. 工具显示卡片(file_write / file_patch / file_read / code_run)
把 agent_loop verbose 的 `🛠️ Tool` 块替换为紧凑卡片:
- **file_write / file_patch**:行号 + 上下文的主题化 diff;append/prepend 走整文件 diff 拿真实上下文。
- **file_read**:读到的内容带行号 gutter,剥离 LLM-facing 噪音(`[FILE]`/show_linenos 前言/截断提示),超长折叠;行号在不可知处(keyword 窗口 / 挖洞后)留空。
- **code_run**:参考 Claude Code / Codex 的 exec 渲染,无边框、`│` 命令 gutter + `└` 输出 gutter,输出 dim、**保尾截断**(traceback 关键在末尾);代码来自正文 ```块``` 时不重复展示。
- 三卡共用 `_CardWriter` / `_card_status_row` / `_emit_gutter`;2 格左 margin 只进显示流、不进复制源。
- capture 机制:live 走 `tool_before/after` 钩子,`/continue` 走 `iter_write_captures` 从历史 tool_result 重建,按 `hash(get_pretty_json(args))` 内容寻址。
- 双流渲染对齐(`_align_md_renders`)支持 margin 映射,鼠标复制不含视觉缩进。

## 2. /model 与 /effort 渠道内运行时切换
- **/model**:在线拉模型列表的 searchable picker;搜索框兼作自定义模型名输入(无匹配时 Enter 直设)。
- **/effort**:reasoning effort 档位切换,协议差异在 `effort_note` 单点编码——Claude(`output_config.effort`) low/med/high 原样、xhigh→max、none/minimal 忽略;OpenAI(`reasoning_effort` / `reasoning.effort`) 透传;mixin 经 `_BROADCAST_ATTRS` 广播到全部子渠道。
- 逻辑收在 `frontends/model_cmd.py`(agent 无关、可单测)。

## 测试
- 卡片:两份真实会话日志全链路重放,51 个 code_run + 23 read + 20 write 全部渲染、双流 parity、复制不含 margin。
- /model /effort:拦截真实 llmcore 请求构造验证 effort 进 payload(含 mixin 广播、各协议字段);picker 自定义输入走 Textual pilot 端到端。
2026-06-11 09:19:09 +08:00
Liang Jiaqing 0b7c6fccae docs: clarify tiered dependencies (core vs [ui] extra) 2026-06-10 23:22:06 +08:00
Liang Jiaqing 8a823c940e docs+fix: README install overhaul, self-hosted install scripts, TMWebDriver logging fix
- README (EN): clone+uv as recommended install; one-line installer demoted to convenience with script source link; drop unpolished exe section; recommend frontends/tui_v3.py (prompt_toolkit+rich, not Textual); note agent core's single dependency (requests); TMWebdriver naming
- assets: add ga_install.ps1/.sh (GLOBAL mode uses GitHub/astral-sh sources)
- TMWebDriver.py: don't let logging failure mask successful remote JS result
2026-06-10 23:18:10 +08:00
Liang Jiaqing efda2c3202 goal_mode: strengthen continuation prompt (mandatory substantive improvement, standard-upgrade report) 2026-06-10 20:25:51 +08:00
Liang Jiaqing 920f7e3f2b llmcore: fix empty-response not triggering mixin failover; distinct default UA for NativeOAISession 2026-06-10 20:25:51 +08:00
Jiaqing Liang fb69e768b3 configure: generic protocol entries (OAI chat/responses, Claude messages) with custom apibase; neutral descs 2026-06-10 16:31:11 +08:00
weijia 90d5002d1f feat(project-mode): pid-keyed anchor — auto-deactivate on GA exit, multi-instance isolation (#592)
- Anchor file becomes temp/.active_project.<host pid>: dies with the GA process,
  so closing GA auto-deactivates; re-activation requires user confirmation per SOP
- Multiple GA instances each keep their own active project, no cross-talk
- Startup sweep removes only legacy unsuffixed anchors and own-pid leftovers
  (pid reuse); anchors of other pids are never touched — deliberately no
  liveness probe, because os.kill(pid, 0) on Windows terminates the process
2026-06-10 14:57:48 +08:00
Jiaqing Liang 862fd8c375 README: drop trivial chat-commands sections (EN/CN) - ask the agent instead 2026-06-10 14:54:04 +08:00
Jiaqing Liang 79550d1175 README: platform-aware launch steps, hCaptcha real-browser demo, EN/CN section polish 2026-06-10 14:49:13 +08:00
weijia 1945b27a03 feat: project mode plugin — cross-session project memory via two-layer injection (#591)
Activate a project with a file anchor (temp/.active_project); every turn
the agent_before hook appends an L1 context (rules + memory file pointer
+ wrap-up discipline) to the latest user message, while the full project
memory (L2) stays on disk for the model to read on demand.

Zero core changes: plugin + SOP + gitignore whitelist only.
2026-06-10 13:18:38 +08:00
Liang Jiaqing 432b2a6570 memory: subagent.md 更新fork/cwd共享约定 2026-06-10 11:14:31 +08:00
Liang Jiaqing a91ed1d0e1 reflect: goal_mode prompt v2 — 创造/检验/改进交替循环+及格线/升级链 (INTERVAL 3→5) 2026-06-10 11:14:31 +08:00
Liang Jiaqing c883c02907 fix: chat bottom padding 7->10rem; disable forced max_tokens=64000 in NativeClaudeSession 2026-06-09 22:00:50 +08:00
Liang Jiaqing da398d91ee fix(llm): stream read_timeout 30s->40s, avoid reasoning-model long-thinking false timeout
fix(frontend): force chat_input pinned to bottom (iframe wrapper fallback); drop details scroll-fix JS
2026-06-09 22:00:50 +08:00
AspasZhang ec0c4b9b98 docs: add GenericAgent-Admin to community GUIs (#589) 2026-06-09 17:40:52 +08:00
Jiaqing Liang 9e20e28028 fix: widen window & collapse sidebar to work around streamlit narrow-viewport bug 2026-06-09 16:43:05 +08:00
Jiaqing Liang 3f1b683651 refactor: simplify driver init wait; clarify TMWebDriver master error msg 2026-06-09 14:23:49 +08:00
Jiaqing Liang b8a8f297c0 docs: tighten official notice and browser realness table 2026-06-09 10:06:00 +08:00
Jiaqing Liang b4e40e2478 docs: remove WeChat group from English README section 2026-06-09 10:01:54 +08:00
Jiaqing Liang bbc56a033c docs: add web tool browser realness results 2026-06-09 10:00:05 +08:00
LJQ a8b404b199 Merge pull request #586 from nianyucatfish/fix/tui-v3-cmd-expand
fix(tui-v3): expand pasted placeholders before slash-command dispatch
2026-06-09 08:39:13 +08:00
yanghang 8cda2b43a1 fix(tui-v3): expand pasted placeholders before slash-command dispatch
Slash commands returned from _on_enter before _expand ran, so a command
argument carried the literal [Pasted text #N] / [File #N] / [Image #N]
placeholder instead of the real content — e.g. `/morphling <pasted
multi-line target>` reached the agent as the marker string, not the paste.

Expand placeholders at the top of the command branch (mirroring the normal
submit path) and clear the placeholder stores afterward. No-op for commands
without placeholders.
2026-06-08 23:53:52 +08:00
AspasZhang 741872529d chore: update WeChat group QR code (group 20 → group 21) (#585) 2026-06-08 20:22:25 +08:00
Liang Jiaqing 98cf8ef9d7 docs: update mobile computer use notes 2026-06-08 19:39:11 +08:00
Jiaqing Liang 0107f6c6ce Update LLM user agent handling and incubator notes 2026-06-08 15:05:47 +08:00
nianyucatfish da6a4ba558 fix(tui-v2): copy via native clipboard, OSC 52 only over SSH (#581)
Ctrl+C / selection copy fell back to Textual's OSC 52 escape on Windows/Linux.
Some terminals (notably VSCode's integrated terminal) decode the OSC 52 base64
payload as latin-1 instead of UTF-8, so non-ASCII copied text lands in the
clipboard as mojibake (e.g. 需要 -> éè¦). Classic Windows conhost ignores
OSC 52 clipboard writes entirely, so copy was a silent no-op there (incl.
Windows Server).

Prefer the OS-native clipboard (_copy_to_clipboard: win32 CF_UNICODETEXT /
pbcopy / wl-copy / xclip), which writes real Unicode and bypasses the terminal.
Keep OSC 52 only as a fallback, and force it under SSH (SSH_CONNECTION /
SSH_TTY) where the native call would write the remote host's clipboard instead
of the user's local one.
2026-06-08 10:47:29 +08:00
Liang Jiaqing 8ec764a87e Update agent hints and UI SOP note 2026-06-08 09:28:05 +08:00
AspasZhang 52e7519c1a chore: update WeChat group 20 QR code image (#577) 2026-06-06 19:51:31 +08:00
Liang Jiaqing 04759de0ba fix(scheduler): ensure sche_tasks dir exists to avoid import crash killing L4 cron 2026-06-05 23:23:41 +08:00
Liang Jiaqing 529f3226e6 Refine computer_use window diagnostics 2026-06-05 22:21:20 +08:00
Liang Jiaqing 62bd570f47 Add computer_use SOP for UI operations 2026-06-05 22:15:54 +08:00
nianyucatfish 607cbdaf13 fix(tui v2): serialize terminal escapes via driver + scrollable sidebar (#572)
- _term_write(): route OSC/control sequences through Textual's driver writer
  queue instead of direct sys.__stdout__. A title/OSC write landing mid-frame
  during streaming used to split Textual's own escape sequences, rendering as
  flashing ANSI garbage; serializing on the same writer queue lands it cleanly.
- sidebar: wrap the session list in a VerticalScroll (#sidebar-scroll) so it
  scrolls when overflowing (scrollbar-gutter reserved to avoid row reflow);
  inner #sidebar Static keeps padding so the click hit-test math is unchanged.
  Keyboard session-switch scrolls the active session into view.
2026-06-05 18:44:01 +08:00
Jiaqing Liang 20e6237fe7 fix(conductor-ui): prevent Enter from sending during IME composition 2026-06-05 16:49:52 +08:00
Jiaqing Liang 38f8cfc037 fix(conductor): disable unconfigured IM plugins by default
Rename tracked email.py/lark.py to _email_example.py/_lark_example.py so
the poller (which skips _-prefixed files) no longer polls them on a fresh
clone. Activate by copying to email.py/lark.py (now gitignored). Also nudge
manager to reuse existing subagents on IM signals.
2026-06-05 16:18:52 +08:00
Jiaqing Liang e089ef50aa feat: 新增飞书(lark)conductor IM插件 + UI/插件体系完善
- conductor_im_plugins: 新增 lark.py(飞书收消息插件,无状态轮询)、email.py、_TEMPLATE.py
- wechat.py/config.local.json 经gitignore排除(含个人会话ID)
- conductor.html/py: UI重构(grid/可折叠卡片/console/approvals)、action与pool化重构
- stapp.py: 移除_js_scroll_fix
- ljqCtrl_sop: 补充Click点歪诊断/DPI坐标陷阱/文本输入经验
2026-06-05 15:03:41 +08:00
weijia 2667a1dee1 docs: add description for galley in friendly links (#565) 2026-06-04 17:48:50 +08:00
Liang Jiaqing 3acd58b36e core: per-instance print injection (no_print), EXIT sentinel for run loop, log name collision fix, checklist poll hard cap 2026-06-04 11:09:54 +08:00
Liang Jiaqing 4df1c70bb2 fix(ljqCtrl): GrabWindow只截客户区,与GrabWindowBg坐标系统一 2026-06-02 23:22:02 +08:00
LJQ e2f527a8e5 Merge pull request #559 from nianyucatfish/fix/continue-preview-garbage
fix(continue): robust session preview for malformed logs
2026-06-02 19:39:03 +08:00
yanghang 59128f14a3 fix(continue): robust session preview for malformed logs
/continue list previews showed JSON debris (e.g. `{`, `" } ]} === Response ===`)
for some sessions. Two causes in _preview_from_file:

1. Models sometimes emit an unclosed <summary>, so the non-greedy DOTALL regex
   pairs it with a far-away </summary> and captures === block headers / JSON
   across rounds. Now only the latest <summary> is used, and it is rejected if
   it looks like such a cross-segment capture (contains `=== `/`"role"` or
   >200 chars) — falling through instead of digging for older summaries.
2. The fallback scanned for the first non-=== line, returning JSON structure
   lines. It now uses the last real user prompt via a new _last_user(), which
   scans Prompt blocks directly (so response-less/aborted sessions still
   preview) and reuses _user_text() to skip tool_result continuations and all
   _INJECT_MARKERS (WORKING MEMORY / SYSTEM TIPS / DANGER ...).

Scanned 261 local logs: garbage previews 26 -> 0.
2026-06-02 19:19:55 +08:00
Jiaqing Liang bc09ceb4e9 goal_hive master duty: 按第一性原理/工程控制论重写为49行(探测-设计-执行-检查分形循环+J*/y/e),实验验证后增补验收线/锁边界质疑目标/遗留项如实入报告; TMWebDriver: 修mark_disconnected重复打印 2026-06-02 15:01:52 +08:00
LJQ 5157cd7856 Merge pull request #550 from desmonna/fix/plugin-hooks-init
fix: add plugins/__init__.py for proper package recognition
2026-06-02 10:10:20 +08:00
nianyucatfish c9c3dbc58e fix(tui): stdout blank lines, leaked task_dir folders, and /continue search nav (#554)
* fix(tui): stop CRLF stdout rendering as blank lines (v2)

Windows child stdout is `\r\n`; the streaming path fed it straight to
`Text.from_ansi`, which treats `\r` as a carriage return and erases each
line's text, so a `[Stdout]` block rendered as a run of blank lines until
the turn finished (the done-state Markdown render strips `\r`). Normalise
`\r\n` -> `\n` before `from_ansi`; lone `\r` is kept so progress-bar
overwrites still work.

* fix(tui): stop leaking empty per-session task_dir signal folders

Both v2 and v3 eagerly `os.makedirs` the per-session `_intervene` /
`_keyinfo` signal dir, but the only writer (`_intervene`) already creates
it lazily — so every session that never used intervene left a stale empty
`temp/_tui_v2_<pid>_<id>` / `temp/_tui_v3_<pid>` behind (85+ accumulated).
`consume_file` tolerates a missing dir, so the eager create is redundant.

- Set only the task_dir *path*; let the writer create it on first inject.
- Remove empty dirs on session close (v2 `_cmd_close`), on graceful exit
  (v2 `on_unmount`, v3 `_cleanup`), and sweep stale ones left by crashes
  at startup (v2 `on_mount`, v3 `main`). `os.rmdir` only removes empty
  dirs, so a still-pending `_intervene` is never clobbered.

* fix(tui): repair /continue search box cursor & up-nav loop (v2)

The SearchablePicker swallowed Right while the search Input had focus
(always treating it as "select"), so the caret could never move right in
the query. And Up could leave the list but never return: from the search
box Down entered the list, yet Up at the top row was stuck.

- Right commits the highlight only when the caret is already at end of the
  query; otherwise it moves the caret within the search text.
- Up on the first list row returns focus to the search box (scoped to
  /continue — no-op for ChoiceLists outside a SearchablePicker), clearing
  the highlight so the next Down re-enters at the first row, not the second.
- Up from the search box wraps around to the bottom of the list.
2026-06-01 23:07:28 +08:00
Liang Jiaqing 1f3fdde49a fix checklist master coordination and startup dedupe 2026-06-01 22:32:16 +08:00
desmonna 211f814624 fix: add plugins/__init__.py for proper package recognition 2026-06-01 14:20:36 +08:00