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.
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.
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.
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
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.
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.
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.
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).
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.
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.
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.
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).
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.
Closesdd3xp/GenericAgent_Desktop#7
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.
- 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