Commit Graph
151 Commits
Author SHA1 Message Date
dd3xp 6f41da834e Merge RoundSquisheen: sync to lsdefine b365945 2026-06-06 23:06:52 +08:00
dd3xp b1352f2de1 chore: sync framework to upstream lsdefine/GenericAgent @ b365945
上次同步点是 1eb8c4c (我们 fork 上为 8f89766),lsdefine 自那以来 102 个

commit,包括飞书 IM 插件、TUI v2 修、conductor OOP 重构、L4 scheduler

mkdir 修复、checklist 系统、computer_use SOP 等。

处理分桶:

  - 45 个 lsdefine-only 文件:整文件覆盖(safe,无我方改动)

  - 17 个 ours-only 文件:完全保留(桌面前端 + bridge + plan_state)

  - 4 个双方都动:逐个 3-way 合

      * .gitignore: 取并集(lsdefine 新增 + 我们 /BUG_*.md)

      * reflect/scheduler.py: 已字节对齐 lsdefine,无操作

      * frontends/conductor.py: lsdefine OOP 重构作 base,我们 6 处

          改动(CORS / add_chat files+images / cost_tracker / token-stats

          / WS running / WS receive files+images)原样塞进新结构

      * frontends/conductor.html: lsdefine 重组作 base,我们 40 行

          输入字数限制 + toast 原样塞进 keydown 监听之后

未触动 desktop_bridge.py(memory 规则约定 exclude bridge)。

已 grep 全文件无 <<<<<< / ======= / >>>>>> 冲突标记残留。

我们改动一行未漏,全部按原代码原文落实,没有自创新代码。
2026-06-06 23:05:59 +08:00
dd3xp 82d115158c Merge main into RoundSquisheen: catch up team's commits (llm_history persist, cache rate fix) 2026-06-06 22:48:14 +08:00
dd3xp f6b594dc71 fix(reflect/scheduler): switch to lsdefine's mkdir fix (drop my variant)
lsdefine/main b365945 had independently landed the same makedirs fix

I added in ac2779d, but at module top-level and creating DONE/ instead

of dirname(_LOG).

Functionally equivalent (both unblock fresh-deploy scheduler import), but

to keep this fork aligned with upstream we adopt lsdefine's version

verbatim. After future content-overlay syncs from upstream, no diff in

this file.
2026-06-06 17:39:42 +08:00
dd3xp ccc7a0d44b fix(reflect/scheduler): switch to lsdefine's mkdir fix (drop my variant)
lsdefine/main b365945 had independently landed the same makedirs fix

I added in ac2779d, but at module top-level and creating DONE/ instead

of dirname(_LOG).

Functionally equivalent (both unblock fresh-deploy scheduler import), but

to keep this fork aligned with upstream we adopt lsdefine's version

verbatim. After future content-overlay syncs from upstream, no diff in

this file.
2026-06-06 17:39:01 +08:00
yiqi-017 554586fa82 fix: 持久化 llm_history 修复重启后模型幻觉工具调用 2026-06-06 16:09:22 +08:00
yiqi-017 7173a05b06 [FIX]:估算价格改成缓存率 2026-06-06 12:00:41 +08:00
dd3xp 4db3ef9af8 Merge RoundSquisheen: scheduler.py mkdir before log open 2026-06-06 00:09:31 +08:00
dd3xp 44e533121a fix(reflect/scheduler): ensure sche_tasks/ exists before opening log file
scheduler.py:23 immediately does logging.FileHandler(sche_tasks/scheduler.log)

at module load. .gitignore excludes sche_tasks/ entirely, so any fresh

deploy (clone + run) crashes with FileNotFoundError before scheduler

even gets to its main loop.

The author's intent (line 76: 'if not os.path.isdir(TASKS): return None')

is that sche_tasks/ should be optional — scheduler gracefully no-ops

when it's missing. The top-level FileHandler call violates that.

Fix: makedirs before opening the log. Mirrors the makedirs already done

for DONE/ inside check() at line 78.

After this lands, any GA deployment (Tauri / Squishy / kw / launch.pyw)

can start scheduler without manual mkdir, and L4 archive cron runs from

day one.
2026-06-06 00:09:26 +08:00
dd3xp 7eaa3742c4 Merge RoundSquisheen: bridge auto-starts L4 scheduler 2026-06-05 22:37:46 +08:00
dd3xp 5ade9841d2 feat(desktop): bridge auto-starts non-IM services on boot (L4 cron)
The reflect/scheduler.py service drives the L4 archive cron every 12h,

but was only registered in the catalog and never auto-started. The UI

panel also wasn't surfacing it (WS snapshot filters to IM only), so

there was effectively no user-facing way to turn L4 archiving on.

Net effect: every GA deployment (local Tauri, Squishy, kw, etc.) had

L4_raw_sessions/ permanently empty. compress_session.py never ran.

Fix: on bridge startup, autostart everything in _catalog that isn't an

IM service. Currently that's just reflect/scheduler.py. IM services stay

manual because they need mykey.py config + explicit user opt-in.

After this lands:

  - bridge boots -> scheduler subprocess spawned

  - ~2 min later -> first L4 archive runs (since _l4_t starts at 0)

  - every 12h thereafter -> next L4 archive cycle

  - users get L4 with zero config
2026-06-05 22:37:43 +08:00
yiqi-017 8e37028370 [update]:修改文件上传大小至500MB 2026-06-05 18:30:29 +08:00
YI QI LIM d85c780007 Merge pull request #10 from dd3xp/feat/plan_card
Feat/plan card
2026-06-05 18:18:53 +08:00
lyx 8f88506e9a 优化plan card视觉 2026-06-05 01:46:27 +08:00
lyx 9f59cf9537 fix(desktop): Plan 完成态立即用最新 items 刷新卡片 2026-06-05 01:05:18 +08:00
lyx 1b88a2eac3 fix(desktop): Plan 按会话绑定 plan_path,修复完成态与跨会话串扰 2026-06-05 00:59:56 +08:00
lyx 6942c8bdbd fix(desktop): Plan 条稳定显示,对齐 TUI grace 与按会话 cwd 解析 2026-06-05 00:48:34 +08:00
lyx 6b77d8a5e0 fix(desktop): Plan 与 TUI 对齐,按会话绑定且不因预设文案误激活 2026-06-05 00:22:18 +08:00
lyx 1ccff5d406 fix: 合并后以远程流式为准,修复自动合并损坏并接 composer DOM 2026-06-05 00:10:59 +08:00
lyx 8c92ec11a8 merge: 冲突以远程为准,试远程打字机自适应 2026-06-05 00:09:32 +08:00
yiqi-017 c8e19dd13b fix(desktop): 打字机步长自适应 + 修复 details 自冻结循环
- renderDraft 步长按上次渲染耗时自适应:轻文档小步封顶 160 字/帧
  平滑打字,大块到达时数十帧内追平而非一帧瞬跳一大坨;重文档加大
  步长用更少次昂贵渲染排空积压,避免单帧卡死数百 ms。
- rewriteDraftBubble 程序化恢复 details open 态会异步触发 toggle,
  置 _suppressToggleFreeze 标记让 guard 忽略,setTimeout(0) 在已排队
  的 toggle 任务后清除,消除自冻结循环。
- bump app.js?v=102→103 刷新缓存。
2026-06-05 00:02:50 +08:00
lyx 8aab1fa49f 1. 聊天框和Conductor对齐
2. 尝试修复聊天渲染卡顿问题
2026-06-05 00:01:31 +08:00
lyx 03979feda3 feat(desktop): Conductor 呼吸灯与进度 rail/drawer 状态优化
顶栏/Conductor 运行态改为绿色呼吸灯(含 connecting/offline 分态);
进度侧栏 rail 增加失败计数徽章,卡片与统计区统一使用呼吸标记。
2026-06-04 19:58:09 +08:00
lyx c62bcc5f9d feat(desktop): Plan 模式 todo 卡片初版
poll 响应附带 plan 事实数据(plan_state + bridge 两行接入),composer 上方渲染进度与任务行;完成/读空 grace 在前端处理。plan_state 原 API 与 TUI 完全兼容,Desktop 仅新增 *_for_desktop 辅助函数。
2026-06-04 15:14:00 +08:00
lyx 975fc43e42 流式未收口的工具块先折进「输出中」折叠不再乱闪,并修稳工具假围栏误截、工具结果误拆成多个空折叠、刷新重播打字机、滚代码块弹回和难点展开。 2026-06-04 14:29:49 +08:00
lyx 9e131377fc style(desktop): lighten dark appearance one step on GitHub Primer scale
Shift existing dark palette tokens up one tier for less harsh contrast while keeping the same color system; sync settings preview swatches and accent-on colors.
2026-06-04 13:00:22 +08:00
dd3xp a0053d9e7f Merge RoundSquisheen: pollSession backoff retry 2026-06-04 04:04:22 +08:00
dd3xp cace868fc9 fix(desktop): pollSession retries with backoff before giving up
When the phone goes to background, JS is paused and HTTP keepalive

connections die. On return, the first poll's fetch can hit "Failed to

fetch" because of a stale connection / DNS / TLS state. The original

code showed an error immediately on a single failure.

Now: same polling loop tolerates up to 5 consecutive errors with

exponential backoff (1s, 2s, 4s, 8s) before surfacing showError. Any

successful poll resets the error counter. This rides through the

typical 1-3 second post-resume blip without any user-visible failure.

Pairs with the earlier WS auto-reconnect + visibilitychange handler

(both bridge channels — WS and HTTP polling — now recover cleanly).

Bump app.js?v=87 -> 88.
2026-06-04 04:04:20 +08:00
dd3xp 5a450bd890 Merge RoundSquisheen: bridge WS auto-reconnect 2026-06-04 00:00:47 +08:00
dd3xp 633e8111a8 fix(desktop): bridge WS auto-reconnect + visibilitychange handler
When mobile browser is backgrounded the OS pauses/kills WebSocket; on

return the page stays on a dead connection and the next send shows

"bridge 未连接". Conductor's WS already had reconnect+backoff; bridge

did not.

Added to bridge WS:

- close handler now schedules reconnect with exponential backoff

  (1s, 2s, 4s, ... capped at 30s)

- visibilitychange listener: when page becomes visible again and ws is

  closed, reset retry counter and reconnect immediately

- wsRetries resets on successful open

- skip retry while page is hidden (battery saver)

Bump app.js?v=86 -> 87.
2026-06-04 00:00:44 +08:00
dd3xp c66e2d1ea1 Merge RoundSquisheen: CONDUCTOR_ORIGIN follows location.protocol 2026-06-02 22:26:56 +08:00
dd3xp 39c96744d4 fix(desktop): CONDUCTOR_ORIGIN follows location.protocol (not hardcoded http)
BRIDGE_ORIGIN already used ${location.protocol}//; CONDUCTOR_ORIGIN was

hardcoded to http://, which would have broken under HTTPS deployment

with a Mixed Content block. Now both behave consistently — page over

HTTPS uses https for conductor calls and wss for the WS already (the

WS constant was already correct).

Triggered by SakuraFrp requiring HTTPS access (TCP tunnels reject

plain HTTP with 501). Tunnels now run with 自动 HTTPS enabled, so

browser hits https://...:14168 / :18900, and frontend needs to use

https in its constructed conductor URL.

Bump app.js?v=84 -> 86 (skipping 85 — that was an auth-gate-only bump).
2026-06-02 22:26:53 +08:00
dd3xp 74453b1c44 Merge RoundSquisheen: centralize bridge/conductor port constants 2026-06-02 21:27:18 +08:00
dd3xp c45d7b86fb refactor(desktop): centralize bridge/conductor port + URL into constants
Per teacher request, pull the 14168 / 8900 magic numbers and the URL

construction out of ~17 inline call sites into a single block at the top

of app.js:

  const BRIDGE_PORT = 14168;

  const CONDUCTOR_PORT = 8900;

  const BRIDGE_ORIGIN = `...`;        // http(s)://host:14168

  const BRIDGE_WS_ORIGIN = `...`;     // ws(s)://host:14168

  const CONDUCTOR_ORIGIN = `...`;     // http://host:8900

  const CONDUCTOR_WS_ORIGIN = `...`;  // ws(s)://host:8900

All fetch / WebSocket call sites now use those origins. No behavioral

change — bridge still calls 14168, conductor still calls 8900. Sets up

future fixes (same-origin bridge, bridge-proxied conductor, runtime port

swap) to be a one-line change in the constants block.

Bump app.js?v=83 -> 84.
2026-06-02 21:27:15 +08:00
dd3xp 66d69130a5 Merge RoundSquisheen: per-page top bar + annotation scaffold dropped 2026-06-02 07:52:38 +08:00
dd3xp 2e64539ec5 feat(desktop): per-page top bar with caret toggles + drop annotation scaffold
1. Removed the two floating arrow buttons (.sb-toggle / .rp-toggle) that

   used to sit at the side seams between sidebar/main/rightpanel.

2. Each page section now owns its own .page-top bar with:

   - left: .pt-sb-toggle (caretLeft, borderless icon button) — collapses

     left sidebar; svg rotates 180° when sidebar is collapsed.

   - right: .pt-rp-toggle (caretRight) — same logic for right panel.

   - chat/collab keep run-state centered between the two icons.

   - services/token use a .pt-spacer to fill the middle gap.

3. .pt-icon style is borderless / transparent / opacity-0.7 (no boxy

   bordered button look); page-top padding tightened to 4px so the

   carets hug the screen edges. Bump styles.css?v=95→97.

4. Wiring: app.js queries .pt-sb-toggle/.pt-rp-toggle by class (4 of

   each, one per page) and binds them to the existing

   .body.classList.toggle('sb-collapsed') / .toggle('rp-collapsed')

   handlers. Behavior identical to the old single buttons.

5. Dropped the DEV annotation scaffold: removed annot.css link in head,

   annot.js script at end of body, and deleted both files.
2026-06-02 07:52:36 +08:00
dd3xp 2d003d7210 Merge main into RoundSquisheen: catch up with PR#7 services tabs + 3 visual changes + cache buster bumps 2026-06-02 07:40:43 +08:00
dd3xp 94477092b4 chore(desktop): bump styles.css?v=93→94 to flush stale CSS cache
Previous commit changed .tok-tabs/.tok-tab/.tok-chart CSS but did not bump the styles.css version, so the browser kept serving the cached v=93 file and the visual changes (underline tabs, taller chart) did not appear in the page.
2026-06-02 07:27:53 +08:00
dd3xp c27be25cc7 feat(desktop): nav reorder + taller trend chart + token tabs use svc style
1. Sidebar nav: move 后台服务 (services) to AFTER 指挥家 (collab).

   New order: 聊天 → 指挥家 → 后台服务 → Token 统计.

2. Token trend chart: was flat (container 160px tall, viewBox 600×140).

   Now container 280px + max-width 760px to stop it stretching on wide

   screens; viewBox bumped to 600×260 with a bit more padding so text

   does not get distorted under preserveAspectRatio="none".

3. Token stats tabs (聊天 / Conductor) reuse the .svc-tabs underline

   look from the services page — same visual language. CSS-only;

   .tok-tabs/.tok-tab classes and the JS click handler are unchanged.

4. Bump app.js?v=81→82 (app.js really changed this time, and the bump

   also flushes stale i18n cache for previously-untranslated keys).
2026-06-02 07:25:25 +08:00
dd3xp 65a54a3f09 Merge PR #7: feat: merge channels and status into one services page
Resolved one conflict in app.js: kept the new token trend chart code from

main and adopted PR's services-tab nav handler (replaces the old

channels/status separate handlers, which the PR consolidates anyway).

index.html and styles.css auto-merged cleanly.

Closes dd3xp/GenericAgent_Desktop#7
2026-06-02 06:50:01 +08:00
yiqi-017 21231c653b feat(desktop): add collapsible daily cost trend chart to token stats
Pure SVG line chart showing daily spending (¥) over time. Respects
date filter, fills zero-cost gaps, uses local timezone for grouping.
Hidden on Conductor tab.
2026-06-02 04:23:00 +08:00
yiqi-017 243645e5e6 i18n(desktop): localize conductor token stats and pricing disclaimer 2026-06-02 03:58:13 +08:00
weaselkkk fa8daff383 feat: merge channels and status into one services page 2026-06-01 22:06:14 +08:00
yiqi-017 0c45c86a42 feat(desktop): token stats tab bar separating chat and conductor
- Two tabs: 聊天 (chat sessions) and Conductor (cumulative/current)
- Conductor tab hides date filter and stat-row summary
- Remove green background and expand triangle from conductor rows
- Bump app.js and styles.css cache versions
2026-06-01 19:31:41 +08:00
dd3xp bd6f0d7be5 chore(desktop): remove preset entry from conductor + menu (preset is chat-only) 2026-06-01 17:12:31 +08:00
yiqi-017 d66f84e0d3 style(desktop): use conductor SVG icon in token stats rows 2026-05-30 22:13:41 +08:00
China Nikocado Avocado d5dbdf6984 Merge pull request #6 from dd3xp/Conductor前端优化
Conductor美化
2026-05-30 19:45:29 +08:00
lyx a6f3e9c7e9 Conductor美化
Conductor 页 UI 重构:对齐主聊天布局,复用消息/composer 样式,独立 cdb-composer 与 progress rail/drawer。
2026-05-30 19:09:37 +08:00
yiqi-017 febd3d86fc fix(desktop): conductor token accumulation loop on refresh
Always overwrite last snapshot with current values (even zero) so
restart detection only triggers once instead of every refresh.
2026-05-30 00:06:54 +08:00
yiqi-017 7223a0d2ec fix(desktop): update model pricing + add pricing disclaimer
- o4-mini: .10/.40 -> /usr/bin/bash.55/.20 (price drop)
- deepseek-v4-pro: /usr/bin/bash.55/.19 -> /usr/bin/bash.435//usr/bin/bash.87 (permanent 75% cut)
- Add claude-opus-4-8 at /5
- Add disclaimer: pricing may vary by API provider
2026-05-29 23:46:58 +08:00