Recover pending redo at startup, coordinate profile readers and writers, and publish Draft state only after persistence. Keep the Windows legacy path by default.
- Create `.github/copilot-instructions.md` as agent-specific instruction
file for GitHub Copilot
- Use "one-line-wrapper" prompt to `AGENTS.md`, like `GEMINI.md`
- Use "at annotation syntax" for instructions importing, like
`CLAUDE.md`
Assisted-by: Copilot Fusion (High), actually GPT-6.1 Sol, GPT-6.1 Terra and GPT-6 Luna
Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com>
* docs(backend): define background task ownership
* refactor(backend): give background operations single task owners
* test(backend): remove actor migration regression cases
* docs(changelog): drop backend actor migration entry
* refactor(backend): extract workspace task drivers
* fix(timer): omit profile identifier from panic log
* docs(backend): define workspace crate boundaries
* refactor(lightweight): use the task countdown driver
* refactor(lightweight): name countdown callbacks
* refactor(task): simplify driver startup and coalescing requests
* refactor(core): bind service handoff to the sidecar generation
* refactor(tun): coalesce background run state reconciliation
* refactor(core): own sidecar exit resources in one session
* refactor(core): remove automatic Windows service handoff
* refactor(task): simplify coalescing job signals
* refactor(runstate): keep operation status with service state
* refactor(dns): coalesce background override synchronization
* refactor(sysproxy): own the local guard under its operation lock
* fix(tray): read menu settings at publication
* fix(dns): retain script lock across caller cancellation
* refactor(profiles): own selected node restoration in one task
* refactor(timer): own subscription schedules in the scheduler
* test(timer): remove the added application test
* fix(service): renew provider sync retry budget on refresh
- The i18n guide told contributors to list routine command results in a PR checklist, which conflicts with the PR template's rule to keep only review-relevant evidence.
Co-authored-by: doTHTY <362276034+doTHTY@users.noreply.github.com>
The reinstall page runs the previous uninstaller, which removes the
Service, and the new installer only tried to start one. Record whether
clash_verge_service exists, with its start type and running state, in
.onInit before that uninstaller can run. When it existed, Section Install
reinstalls it with the bundled cores and their hashes through the
installer's own elevation, then restores a non-automatic start type and
the stopped state. A first install still never adds a Service.
A failed reinstall or restore is logged, shown in a warning dialog that is
auto-confirmed under /S, and sets exit code 2, so the installer does not
report success.
Validated only by compiling the macros with makensis -WX against the real
SimpleSC plugin; not run on Windows.
Refs #8553
* perf(traffic): shorten sidebar graph animation
* refactor(service)!: remove the development service channel workflow
Delete the verge-dev/dev-sidecar features, the dev.mjs script family,
and the CLASH_VERGE_DEV_SERVICE_DIR staging chain. Debug builds keep
the isolated .dev application data directory and dev sidecar IPC names
through #[cfg(debug_assertions)] instead of the removed feature.
Point clash_verge_service_ipc at tag v2.8.2.
* chore(service): track the development-channel removal draft
Point clash_verge_service_ipc at the removal branch while its PR is
open; flip to tag v2.8.2 once the service side merges.
* chore(service): track the released service 2.8.2
The removal branch merged as clash-verge-rev/clash-verge-service-ipc#105
(with the digest opt-in from clash-verge-rev/clash-verge-service-ipc#106
and the 2.8.2 release bump on top), so track the service repository's
main directly instead of the draft branch.
* perf(enhance): move tun mapping and alpn strings instead of cloning
enforce_tun deep-cloned the tun mapping two lines before overwriting
it; take_mapping now moves it instead (end state identical for absent,
non-mapping and mapping values, including key order). builtin_hy_alpn
cloned each hysteria node's alpn String only to dodge a borrow conflict
while re-inserting under the same key; take it in place via get_mut +
mem::take. The in-place guard preserves non-string alpn values that a
remove-based shape would silently drop.
Measured per enhance run on 200 hysteria nodes: hy_alpn 600 -> 200
allocations; enforce_tun 29 -> 3.
* perf(tray): hoist tooltip version string
update_tooltip re-derived the version string from CARGO_PKG_VERSION on
every tray refresh; compute it once in a LazyLock. std::string::String
is spelled out because bare String in this module resolves to the
tristr alias.
* refactor(cmd): take sidecar fallback as AsyncFnOnce(&str)
finish_service_installation's FnOnce(String) -> FallbackFuture bound
forced reason.clone() before the call. AsyncFnOnce(&str) borrows the
reason and moves it into the Sidecar outcome - one allocation instead
of two - and drops the FallbackFuture generic entirely. The
windows-only call site's closure shape is verified with standalone
rustc (edition 2024) repros; Windows CI compiles it definitively.
* refactor(tray): store the tooltip version as a static str
The only consumer reads the value as a str, so the String static
allocated even when the version carries no build metadata. Return the
env! literal directly in that case and leak the trimmed form otherwise;
the LazyLock already owns the value for the process lifetime.
* chore(enhance): drop comment on the alpn take
* perf(feat): share runtime mappings across port-save probes via Arc
Every proxy-port save deep-copied the full runtime Mapping twice (current
and candidate) so the rare post-restart re-probe could retain ownership.
Wrap both in Arc once: the first probe takes refcount clones, the re-probe
moves the same Arcs. Probe inputs are identical mappings and the
spawn_blocking Send + 'static bounds are unchanged.
Measured on a representative 200-proxy/30-group runtime config: one
Mapping clone costs 10,053 allocations / 1.02 MiB; the Arc handoff costs
0 / 0. Both copies per save are gone.
* perf(config): borrow through selected-node persistence closures
record_selected_node and persist_reconciled_selected copied the group,
node and profile strings up-front for the persist_selected_update
closure, including on the no-change early-return path. The closure bound
is FnOnce + Send without 'static (the same shape forget_selected_node
already relies on), so capture &str and &[PrfSelected] borrows instead
and construct owned strings only at the storage points. as_deref
comparisons keep content semantics.
* chore(feat): drop a narration comment on the Arc handoff
* perf(core): remove redundant copies on service IPC paths
Allocation and copy trims on the service IPC hot paths; the wire format
is untouched:
- store the owner session proof as Arc: active_service_session()
retrieval becomes a refcount clone instead of a 64-char string copy
per call (~12 call sites, including the frontend-polled log path).
The one external caller takes Proof: Borrow<OwnerSessionProof> so its
four test closures stay unchanged.
- build the session token hex with one allocation instead of 32
format! allocations plus Vec growth (35 -> 1 allocations measured),
mirroring owner_identity::encode_token.
- reuse one RuntimeFileRequest across the provider cache-sync chunk
loop; only .offset changes per chunk.
- move the proposed session token out of StartClashRequest on success
instead of cloning it up-front.
- report the non-actionable service status by reference before
set_status takes ownership.
- hoist the macOS install markers to LazyLock, pass osascript args as
an array, compare the install-wait core name via the requirement
array, and log the silent-updater version by reference.
* fix(core): gate the LazyLock import to macOS
The install-marker static is the only LazyLock user in the module and
is macOS-gated; the ungated import made clippy -D warnings fail the
Linux and Windows builds. Co-locate the import with its cfg.
Adds a proxy page scenario to the measurement adapter: a core-module
shim serves synthetic proxy/clash/run-state data at the invoke seam
(active only for the proxy scenario; other scenarios stay
byte-identical), and a sawtooth scroll driver keeps the virtualizer
measuring and the throttled scroll-position save running. Running the
scene additionally requires the harness-side scenario contract and
schema v10 from the clash-verge-rev-harness repository.
* perf(profile): stabilize profile grid callbacks and context menus
ProfileItem is memoized, but the grid passed five freshly-created closure
props per render, so URL keystrokes and switch spinners re-rendered every
card. The callbacks are now uid/item-parameterized stable handlers, and
the context-menu label map and item literals are hoisted or gated on the
menu being open.
* perf(profile): derive editor policy names and dedupe pasted proxies
The groups editor re-read both profile files and re-parsed three YAML
documents on every prepend/append/delete edit. The origin names are now
read once per open and folded into a memoized policy list, and batch
pasted proxy names dedupe through a Set instead of a linear scan.
* perf(ui): keep mutateVerge identity stable across renders
mutateVerge was a per-render closure that dozens of consumer callbacks
depended on, and its updater fell back to a render-time config snapshot.
It now keeps a stable identity, revalidates through the module-level
query helper, and passes the live cache value (preload snapshot when the
cache is still empty) to function updaters; object-form callers were
migrated to updater functions.
* perf(ui): hoist static dialog identities and memoize settings search
The DNS viewer rebuilt Monaco's options object per keystroke, the update
dialog rebuilt its markdown component map and plugin array per progress
chunk (remounting link and blockquote subtrees), and the settings search
rescanned the ~180-entry catalog on unrelated renders such as arrow-key
selection. These identities are now module constants or single memos;
the width-dependent minimap option is applied at editor mount.
* perf(proxy): stable tool callbacks and shared delay entries
Group headers and heads passed freshly-created closures into the
memoized tools, defeating it on every render; the tool callbacks are now
groupName-parameterized and forwarded directly. Cached delay entries are
write-once, so the defensive copy on read and the second copy in the
delay-state reducer were dropped.
* perf(proxy): stable group location and chain list identities
The sticky-header scroll callback depended on the render list identity,
re-creating the item renderer on every list rebuild; it now reads the
list through a stable ref callback. Rebinding no longer allocates new
chain items and arrays when values are unchanged, so the 15s proxy-view
refresh stops re-serializing identical chains to localStorage, and the
chain delay key join is memoized.
* perf(log): reuse the empty logs fallback identity
A fresh [] fallback gave the subscription hook's refresh callback and
snapshot effect a new identity on every render while logs streamed; the
empty list is now a shared module constant.
* perf(home): build traffic range snapshots in one pass
The 200ms graph snapshot built three to four intermediate arrays on the
compressed path before posting to the worker. It now fills one
preallocated result in a single pass and only sorts when the compressed
and raw ranges actually interleave.
* chore(changelog): drop the render efficiency entry
* perf(home): draw the traffic graph from refs instead of per-snapshot state
Worker snapshots re-rendered the whole graph tree per update and the
sampler sliced its full buffer every second just to compare for
equality. Snapshots now feed display data and the y-scale through refs
(React state only tracks the diagnostics badge inputs, skipped while
hidden), the draw callback chain is identity-stable, per-draw axis
ticks/labels and gradient strings go through pooled buffers and bounded
caches, and the sampler version counter plus an oldest-point age check
let the idle poll skip unchanged slices.
* perf(ui): hoist static icons and style identities in traffic widgets
Stat-card icons were rebuilt per parsed-data update, defeating the
memoized card comparison, and the layout traffic widget reallocated its
style objects (with a redundant double sx spread) on every tick.
* perf(log): compile the highlight regex once per search state
Each visible row recompiled (and re-escaped) the same regex three times
per render while logs stream in; the compiled regex is now cached per
search state identity.
* perf(proxy): reuse the parsed scroll-position snapshot and drop per-frame copies
The sticky-index lookup copied and reversed its array per range
extraction and every throttled save re-read and re-parsed the same
localStorage payload; the reverse scan is now allocation-free and the
parse goes through one read-through snapshot.
* test(perf): add proxy scroll scene to the perf adapter
Adds a proxy page scenario to the measurement adapter: a core-module
shim serves synthetic proxy/clash/run-state data at the invoke seam
(active only for the proxy scenario; other scenarios stay
byte-identical), and a sawtooth scroll driver keeps the virtualizer
measuring and the throttled scroll-position save running. Running the
scene additionally requires the harness-side scenario contract and
schema v10 from the clash-verge-rev-harness repository.
* chore(changelog): drop the hot-path refresh entries
* test(perf): move the proxy adapter scene to a separate change