Commit Graph
3 Commits
Author SHA1 Message Date
Alessandro cc098d3e98 Speed up chat restoration and bound embedding warm-up
Reuse Git version metadata within each chat-load operation and pass saved
message token counts into reconstruction. Preserve per-agent settings and
credential reads, initialization hooks, profiles and legacy token behavior.

Give the existing deferred embedding preload up to 10 extra seconds after
chat restoration, within extensible init_a0. Continue startup on timeout or
task failure while allowing unfinished model loading to complete.

Across five trials per version with the same chat workload and a cached
embedding model, median HTTP readiness after the restart command returned
fell from 38.1 to 27.8 seconds: 10.3 seconds saved, or 27% less waiting.
Boot-to-first-token fell from 42.7 to 33.4 seconds. Post-send first-token
latency did not improve in this sample (4.709 to 5.108 seconds).

Validation: 146 focused framework tests passed, followed by 20 preload tests
including seven new edge cases. Real ten-second stalled-loading/inference
checks and offline missing/cached-model checks passed. Five DeferredTask
lifecycle tests passed separately; an existing test-order failure when
combined with preload imports also reproduces without the new cases.

Fresh-install performance was not measured; the full repository suite was
not run.
2026-10-11 19:27:39 +02:00
Alessandro a776cad000 Speed up settings saves by reusing the Git version
Reuse the resolved Git version while refreshing active agents, and clear
its task-local cache on success or failure, including inherited contexts.
Preserve per-agent normalization, credential reads, initialization hooks,
and the final settings reload.

On the live instance with 214 loaded contexts, median save-request time
fell from 10.12 s to 1.56 s, approximately 6.5x faster.

Verification: 34 focused tests passed, plus live browser checks for save,
reload, preference change and restore, and dialog close.
2026-09-18 17:16:45 +02:00
Alessandro d1a9bfa13e Scope settings snapshots to prompt builds
Reuse one normalized settings snapshot only while Agent.prepare_prompt builds a prompt, then restore normalize-on-read behavior immediately.

Keep the canonical get_settings function unchanged while prompt-building callers explicitly avoid repeated Git and default resolution.
2026-08-23 06:08:41 +02:00