12 Commits
Author SHA1 Message Date
yanghang 5aec9a75b6 fix(tui): release agent workers on close 2026-08-06 23:27:55 +08:00
Shen HaoandShen Hao 3b67919561 feat(tui v2): plan card + done annotation + /cost + /review wiring (#411)
- Plan card (📋): per-session message-scan with `plan_scan_baseline` so
  `/continue` of a finished session doesn't auto-resurrect old plan cards;
  prefers `<summary>当前步骤:` over the long plan-item echo; placeholder
  while enter_plan_mode is armed but plan.md hasn't been written yet.
- Done annotation (⠿ {Verb} for Xm Ys · ↑ N · ↓ M): post-turn elapsed
  + per-call token deltas, frozen at done so the line stays put across
  re-mounts. Spinner annotation gated on cumulative deltas past stream-start
  baselines — fixes `↓ 16` showing immediately on prompt submit.
- fold_turns regex anchored to line-start (`^` + MULTILINE) so embedded
  backticks in tool output (e.g. `N|\`\`\`\`` gutter from file_read) don't
  pair with later real fences. ~100x faster on long /continue sessions.
- /cost: per-session card + `/cost all`; `Context window` line now reads
  GA's actual char cap via `cost_tracker.context_window_chars(backend)` =
  `backend.context_win * 3` (the `trim_messages_history` trigger threshold
  in llmcore.py), so the percentage reflects real budget and respects
  `mykey.py` overrides. Unit changes from token to character. Dropped the
  model-theoretical `_CTX_LIMITS` table (never actually constrained anything).
  Subagent log scan via `cost_tracker.scan_subagent_logs` aggregates
  `temp/*/stdout.log` since TUI start.
- /review: standalone in-session reviewer; reuses `review_cmd.handle`
  to render the inline prompt and submits as a normal user task.
- llmcore: emit `[Output] tokens=N` for chat_completions / responses modes
  (already emitted for `messages` SSE) so cost_tracker scopes output
  tokens uniformly across all three API modes.
- review_inline_prompt.{txt,en.txt}: filled out the in-session review
  discipline — Three Iron Rules, Q1-Q4 framing, severity examples,
  8 false-positive rules expanded, 8 wording rules expanded, 8-item
  self-check. ZH/EN both grow ~80 lines.
- memory/review_sop.md: rewrite 52 → 191 lines, 11 sections covering
  quick-start, entry files, Three Iron Rules, 5-step workflow, severity,
  output protocol, relationship to plan_sop / verify_sop. Style mirrors
  plan_sop.md + autonomous_operation_sop.md.

Files: frontends/{tuiapp_v2,tuiapp,cost_tracker,plan_state}.py, llmcore.py,
memory/review_sop.md, memory/review_sop/review_inline_prompt.{txt,en.txt},
.gitignore (allowlist new SOP).

Co-authored-by: Shen Hao <shenhao-stu@users.noreply.github.com>
2026-05-18 08:20:52 +08:00
Liang Jiaqing 867facc58d feat: dynamic tool_result maxlen based on parallel tool count 2026-05-13 10:21:13 +08:00
Liang Jiaqing bb3179807c feat(tui): multi-line input with Enter submit, Ctrl+Enter newline, paste-safe 2026-05-11 21:12:28 +08:00
Liang Jiaqing ceec6c9d08 feat(tui): add /clear and /close commands 2026-05-09 14:56:52 +08:00
Liang Jiaqing 1f99a5553b feat: fsapp reconnect loop, tui branch/rewind, simphtml flow-child fix, sop updates 2026-05-08 15:48:16 +08:00
Liang Jiaqing c9b126c7de fix: invalidate panel cache on fold toggle 2026-05-07 22:23:48 +08:00
Liang Jiaqing e5265a03dc tuiapp: cache rendered panels; llmcore: simplify fast_ask 2026-05-07 22:18:25 +08:00
Liang Jiaqing 0a2be47c00 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 20553a05aa tuiapp: improve session nav (ctrl+arrows), CJK-aware sidebar, README restructure 2026-05-07 18:15:08 +08:00
Liang Jiaqing eb90075f6a 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 6fd7e2d7a0 feat: add Textual TUI frontend + minor fixes to agentmain/llmcore/stapp 2026-05-07 17:38:58 +08:00