Commit Graph
869 Commits
Author SHA1 Message Date
Shen HaoandShen Hao 1bcfeeca1b fix(slash_cmds): /update reconciles working tree, not just git history (#624)
Co-authored-by: Shen Hao <shenhao-stu@users.noreply.github.com>
2026-06-18 01:02:30 +08:00
Octopusandocto-patch 1ccfccda46 feat(wizard): bump MiniMax default to M3, drop M2.5 (#555)
Co-authored-by: octo-patch <octo-patch@github.com>
2026-06-17 20:16:19 +08:00
weijia b006a84b7c fix(macljqCtrl): add CropToScreen helper + crop-origin coord hints (#614)
On macOS the screenshot path lacked a counterpart to win32's
ClientToScreen. Detecting a target inside a cropped GrabScreen(bbox)
image and feeding the in-image (px,py) straight to Click silently
mis-clicks because the crop-origin offset is dropped.

- add CropToScreen(bbox, x, y): in-crop coords -> absolute physical
  coords (pure crop-origin add, no scaling)
- GrabScreen docstring: warn about the crop-origin trap and not to
  hand-roll screencapture -R (it takes logical points)
- Click 0%-pixel-change warning now names the common causes
- ljqCtrl_sop.md: add macOS subsection mirroring the win32 trap note
2026-06-17 20:15:16 +08:00
nianyucatfish 1f2e38c6e3 fix(continue): preserve session workspace on in-place restore (#621)
In-place /continue retargets agent.log_path to the restored file, so the
reset bind `_bind_workspace(None)` ran during restore was persisting
session_ws_set(path, "") — erasing that session's own workspace mapping to
"" (read back as "explicitly off") before we read it, which also short-
circuited the log-scan fallback. The continued session never re-entered its
workspace.

Add a `persist` flag to `_bind_workspace`; the restore-time reset passes
persist=False so it only refreshes in-memory state. The session→workspace
map is now written solely by explicit /workspace, /workspace off, and a
successful restore.
2026-06-16 21:38:01 +08:00
Liang Jiaqing 33f486d08b Add codex metadata for responses requests 2026-06-16 21:16:30 +08:00
Liang Jiaqing 21158fff43 Update agent docs and task help 2026-06-16 11:27:31 +08:00
AspasZhangandAspasZhang 5b45a18dd6 update wechat group 21 QR code (#620)
Update WeChat group 21 QR code image.

Co-authored-by: AspasZhang <AspasZhang@users.noreply.github.com>
2026-06-16 09:44:11 +08:00
Liang Jiaqing b267ce8dd3 Update supervisor SOP and execution reminders 2026-06-15 21:35:28 +08:00
nianyucatfish 6aecec1431 feat(continue): default in-place restore + per-session lock (copy-on-conflict) (#617)
/continue N 默认改为「原地续」:接管原会话日志、后续轮次写回同一文件,取代旧的
镜像复制(supersedes b4356c7 的 mirror 方案),不再每次续接都 fork 新会话、日志增殖。

- 空闲会话 → 直接原地接管;被活进程占用 → 弹窗确认后才复制一份续。
- 每会话出生持锁(temp/model_responses/.locks/<logid>.lock),整进程共用一个心跳
  线程每 5s touch mtime、30s 无心跳判死可接管;atexit 干净释放,崩溃/强杀靠超时兜底。
- 切走/新对话不再「快照+清空」(原 _snapshot_current_log 因 logid≠pid 实为死代码,
  从未生成过快照),旧日志原样留作空闲会话,新对话铸新 logid。
- list_sessions 新增 exclude_log,修正 exclude_pid=getpid 失效导致当前会话出现在
  自己列表里的问题。
- continue_cmd 仅新增函数,reset_conversation/restore/handle 未改动 → 其他前端
  (IM/qt/streamlit 等)行为完全不变。
- 改动仅限 continue_cmd.py + tui_v3.py + tuiapp_v2.py;rewind/worldline 逻辑不在本 PR。
2026-06-15 21:20:20 +08:00
Liang Jiaqing 0990c10f20 Improve conductor approval workflow 2026-06-15 10:15:17 +08:00
Liang Jiaqing 63128dd5bb Fix reflect loop throttling 2026-06-15 10:01:08 +08:00
Liang Jiaqing 9405d3fe09 docs(vision): add GA bootstrap hints to vision_api template
Annotate config block to guide new GA instances: enumerate candidate
mykey.py variable names and experimentally probe which config works;
only print var/field names, model, apibase host/path, status codes and
error types (never full dict or apikey/token); include a config format
example. Also flag that apibase/endpoint may differ per provider/proxy
at the two request-building sites.
2026-06-15 10:01:08 +08:00
weijia 05d9dba08a feat(memory): enhance macOS AX control (resolve_pid fix, enabled field, AXClick)Feat/macos ax enhancements (#611)
* feat(memory): enhance macOS AX control (resolve_pid fix, enabled field, AXClick)

- _resolve_pid: fix bundle_id branch (used un-imported AppKit), 3-tier match (bundle id > app name exact > substring)
- AXElements: collect 'enabled' field (SOP: check disabled before click)
- AXClick: AXPress-first then fallback to physical-coord Click, honest success判定 via pixel diff
- AXFind: add enabled_only filter, refactor if-forest into _hit helper

* docs(ljqCtrl): tighten macOS AX guidance, drop boilerplate & app-specific detail

- collapse 5-line cross-platform import boilerplate to one line
- generalize control-identifier tip (remove app-specific identifiers)
2026-06-15 09:00:45 +08:00
nianyucatfish 1d976dd40f fix(tui-v3): /continue 恢复后镜像源日志,避免续聊丢失旧历史 (#612)
v3 的 _do_restore 此前只把历史载入内存 backend.history,不碰当前进程日志。native 后端逐轮只把新增消息 append 到 model_responses_{pid}.txt,恢复出的旧历史从不写入当前日志——续聊只追加增量,下次 /continue 扫到的本进程文件就只剩续聊部分,旧历史丢失。

对齐 v2 _do_continue_restore:恢复前 reset_conversation(快照+清空当前日志),恢复后 copyfile(源日志 → 当前日志),续聊便接在完整历史之后。
2026-06-15 08:59:37 +08:00
Liang Jiaqinganddilong888 80679c3d6b fix(desktop): clear busy flag after ESC cancel and on bridge close to prevent UI freeze
ESC cancel sent session/cancel RPC but never cleared the busy flag, leaving the UI stuck if the server-side cancelled event never arrived. Also clear busy on all sessions when the bridge closes so pending poll loops exit cleanly.

Co-authored-by: dilong888 <dilong888@users.noreply.github.com>
2026-06-14 09:43:07 +08:00
Liang Jiaqing 9ac89d4462 Remove legacy desktop_pet v1 (desktop_pet.pyw, pet.gif); v2 fully covers 2026-06-14 09:24:33 +08:00
weijia dab1b1a242 feat(memory): add macOS port of ljqCtrl with AX accessibility support (#606)
- macljqCtrl.py: macOS implementation of mouse/keyboard/screenshot/window
  enumeration mirroring ljqCtrl API, plus AX accessibility control tree
  (AXElements/AXFind/AXPress) as the macOS equivalent of UIA
- computer_use.md: add section 3 documenting the macOS platform branch
- .gitignore: whitelist memory/macljqCtrl.py
2026-06-14 09:14:06 +08:00
nianyucatfish 84254ad762 feat(tui): workspace 项目模式 + @ 文件引用补全(v2/v3) (#607)
* feat(tui): workspace 项目模式 + @ 文件引用补全(v2/v3)

- workspace: /workspace 设/off/picker、junction 复用 project_mode 记忆、
  per-session(v2)/进程级(v3)、/continue 恢复、session map 持久化绑定状态
- @ 补全(completion-only): 子序列模糊 + path-like 目录补全(~/ / ./ C:\)、
  提交期 @路径作为普通文本交 agent
- v3 filterable 焦点链 picker(输入框作焦点环对象、free_input)
- 新增共享模块 at_complete.py / workspace_cmd.py;核心零改动

* feat(tui): @ 路径绝对化 + 默认根=temp + 未绑显示完整路径

- 默认根 os.getcwd() → agent 工作目录 <GA根>/temp(与 file_read/code_run 一致、不随启动 cwd 飘)
- 提交期 @相对 → @绝对(display 保留相对短路径),让 agent file_read(相对自身 cwd)找得到
- 未绑 workspace 时候选显示完整路径(根不直观);索引忽略 model_responses 会话日志噪音
- 启动预热 temp 索引 + candidates_for 惰性兜底(任何根首次访问自动建)
2026-06-14 09:10:04 +08:00
LJQ 1d2f3597eb Merge pull request #595 from Michaelxwb/main
修复个人微信前端在 headless 容器内无法登录
2026-06-13 15:52:18 +08:00
Jahan 3bd462e3a9 Merge branch 'lsdefine:main' into main 2026-06-13 14:54:46 +08:00
Liang Jiaqing abe233b06e Fix stapp bottom input layout 2026-06-13 12:07:46 +08:00
Jahan d1121dd799 Merge branch 'lsdefine:main' into main 2026-06-12 19:39:52 +08:00
Liang Jiaqing de501f785b Fix truncation warning placement and untrack skill_search 2026-06-12 14:33:03 +08:00
陈克文 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
Jahan ae4448cfbd Merge branch 'lsdefine:main' into main 2026-06-12 11:51:48 +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
Jahan 6f3da49a34 Merge branch 'lsdefine:main' into main 2026-06-11 19:08:05 +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
Jahan 269c002996 Merge branch 'lsdefine:main' into main 2026-06-11 09:18:31 +08:00
徐文彬 e352c7a114 fix(wechat): 修复个人微信前端在 headless 容器内无法登录
容器化部署时个人微信前端无法首次扫码登录,定位并修复 4 处问题:

1. isatty 闸门顺序错误:__main__ 先把 stdout 重定向到日志文件,再判
   sys.stdout.isatty()——文件句柄恒为 false,导致无 token 时必然退出。
   改为始终走 QR 登录、二维码打到真实 stdout(docker logs 可见),
   无需 TTY 即可扫码。
2. get_bot_qrcode 无容错:被限流时响应缺 'qrcode' 字段直接 KeyError 崩溃,
   配合 restart 策略形成死亡螺旋。改为退避重试,等 qrcode + img_content
   都就绪。
3. get_qrcode_status 轮询只 catch ReadTimeout:限流返回非 JSON 时 .json()
   抛错崩溃。改为捕获所有 RequestException + ValueError 容错重试。
4. PNG 兜底依赖 PIL,缺失时 qrcode.make().save() 抛 ModuleNotFoundError,
   且 traceback 被 finally 重定向到日志文件而难以发现。改为先打 ASCII
   二维码(扫码真正所需,无依赖),PNG 保存包 try 失败不崩。

均为通用的容器化健壮性改进。
2026-06-11 09:15:55 +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