Skip to content

fix(mihomo-control): avoid CPU budget exhaustion on large API polls (v0.1.4) - #513

Merged
ItsLemmy merged 2 commits into
noctalia-dev:mainfrom
mdj2812:fix/mihomo-control-cpu-budget
Aug 30, 2026
Merged

fix(mihomo-control): avoid CPU budget exhaustion on large API polls (v0.1.4)#513
ItsLemmy merged 2 commits into
noctalia-dev:mainfrom
mdj2812:fix/mihomo-control-cpu-budget

Conversation

@mdj2812

@mdj2812 mdj2812 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Plugin

  • Id: mdj2812/mihomo-control
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

Fixes Mihomo Control becoming unresponsive when polling remote controllers with large /connections or /proxies API responses. The service now scrapes /connections totals without a full json.decode, and projects oversized /proxies bodies through jq instead of decoding them inline within Noctalia's per-callback CPU budget.

External dependencies

  • jq — used only when a /proxies response exceeds the inline decode size limit, to project group data without exhausting the Luau CPU budget.

Testing

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Noctalia version tested against: latest dev build (2026-08-28)
  • Plugin API level: 9

Verified against a remote Mihomo controller with large /connections and /proxies payloads: the service keeps publishing state and the panel stays responsive. Ran lua5.4 mihomo-control/tests/group_order_test.lua.

Screenshots / Videos

Not applicable — service-only reliability fix; no visual UI changes in this release.

Checklist

Ready-for-review requirement: Every box in this section must be checked. If any statement is not true, keep the
pull request as Draft. An explanation does not replace a required check.

  • The directory name matches the part of id after the / in plugin.toml exactly.
  • It ships plugin.toml, README.md, thumbnail.webp, and translations/en.json.
  • README.md follows the
    README template, documents
    every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
  • I created thumbnail.webp with the thumbnail generator.
  • version follows semver and is bumped in this PR; plugin_api is the oldest API level this plugin requires.
  • Every non-English translation in this PR uses a locale supported by Noctalia core, and I can read, write, and
    understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
  • I did not edit catalog.toml; CI generates it.
  • This PR touches exactly one plugin directory.

Code review attestation

Plugins run as trusted, unsandboxed Luau in the user's session. Confirm:
Ready-for-review requirement: Every attestation below must be checked.

  • The code is readable and not obfuscated, minified, or generated.
  • It does not download and execute remote code.
  • Every network call, filesystem write, and spawned process is something the description above accounts for.
  • I have the right to publish this code under the license declared in plugin.toml.

mdj2812 and others added 2 commits August 28, 2026 20:51
…v0.1.5)

Parse /connections summaries without full json.decode and project oversized
/proxies responses through jq so the service keeps publishing state reliably.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@ItsLemmy
ItsLemmy merged commit c548de1 into noctalia-dev:main Aug 30, 2026
3 checks passed
@mdj2812
mdj2812 deleted the fix/mihomo-control-cpu-budget branch August 30, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants