[PR #2339] [MERGED] Make remote health probe opt in #5542

Closed
opened 2026-10-22 04:17:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2339
Author: @Xelvanis
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/5/2026
Merged by: @Xelvanis

Base: refactor ← Head: fix/health-runtime-rate-limit


📝 Commits (1)

  • b1b4aba Make remote health probe opt in

📊 Changes

3 files changed (+210 additions, -7 deletions)

View changed files

📝 src-tauri/src/http_server.rs (+208 -5)
📝 src/shared/api/remote-runtime.test.ts (+1 -1)
📝 src/shared/api/remote-runtime.ts (+1 -1)

📄 Description

Linked issue

Closes #2333

Why this change

  • The remote runtime /health endpoint wrote and deleted a temp file on every unauthenticated liveness request, creating avoidable disk churn.
  • Remote runtime readiness still needs writable-storage proof, but that proof should be explicit instead of part of every liveness probe.

What changed

  • Changed /health to return cheap liveness by default.
  • Added ?probe=1 / ?probe=true support for opt-in writable storage probing with a short cache.
  • Added rate limiting for /health while preserving its auth bypass for liveness checks.
  • Updated the shared remote runtime readiness client to call /health?probe=1 before /api/invoke readiness.

Refactor impact

Primary owner:

Remote runtime.

Impact areas reviewed:

  • Axum /health route and HTTP controls.
  • API rate-limit middleware path handling.
  • Shared remote-runtime health/readiness wrapper and its focused test.

Boundary notes:

  • Rust owns the hostable HTTP route and writable disk probe.
  • src/shared/api/remote-runtime.ts owns frontend readiness calls into the hostable runtime.
  • No engine, mode, React feature, or raw remote fetch boundary changes.

Pressure points touched:

  • None.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • cargo fmt --manifest-path src-tauri/Cargo.toml
  • cargo test --manifest-path src-tauri/Cargo.toml health_ --lib
  • cargo test --manifest-path src-tauri/Cargo.toml api_rate_limiter_uses_default_bucket_health_bucket_and_skips_other_non_api_paths --lib
  • cargo check --manifest-path src-tauri/Cargo.toml
  • pnpm test src/shared/api/remote-runtime.test.ts
  • pnpm typecheck
  • pnpm check
  • git diff --check
  • No live remote-runtime HTTP flood test was run.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • This is a remote-runtime health/readiness bugfix, not a new user-discoverable workflow.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • Not applicable; no visible UI changes.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2339 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/5/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `fix/health-runtime-rate-limit` --- ### 📝 Commits (1) - [`b1b4aba`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b1b4abaa36ab5e4fd27ae3425713f43cdb2fc763) Make remote health probe opt in ### 📊 Changes **3 files changed** (+210 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/http_server.rs` (+208 -5) 📝 `src/shared/api/remote-runtime.test.ts` (+1 -1) 📝 `src/shared/api/remote-runtime.ts` (+1 -1) </details> ### 📄 Description ## Linked issue Closes #2333 ## Why this change - The remote runtime `/health` endpoint wrote and deleted a temp file on every unauthenticated liveness request, creating avoidable disk churn. - Remote runtime readiness still needs writable-storage proof, but that proof should be explicit instead of part of every liveness probe. ## What changed - Changed `/health` to return cheap liveness by default. - Added `?probe=1` / `?probe=true` support for opt-in writable storage probing with a short cache. - Added rate limiting for `/health` while preserving its auth bypass for liveness checks. - Updated the shared remote runtime readiness client to call `/health?probe=1` before `/api/invoke` readiness. ## Refactor impact Primary owner: Remote runtime. Impact areas reviewed: - Axum `/health` route and HTTP controls. - API rate-limit middleware path handling. - Shared remote-runtime health/readiness wrapper and its focused test. Boundary notes: - Rust owns the hostable HTTP route and writable disk probe. - `src/shared/api/remote-runtime.ts` owns frontend readiness calls into the hostable runtime. - No engine, mode, React feature, or raw remote fetch boundary changes. Pressure points touched: - None. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `cargo fmt --manifest-path src-tauri/Cargo.toml` - `cargo test --manifest-path src-tauri/Cargo.toml health_ --lib` - `cargo test --manifest-path src-tauri/Cargo.toml api_rate_limiter_uses_default_bucket_health_bucket_and_skips_other_non_api_paths --lib` - `cargo check --manifest-path src-tauri/Cargo.toml` - `pnpm test src/shared/api/remote-runtime.test.ts` - `pnpm typecheck` - `pnpm check` - `git diff --check` - No live remote-runtime HTTP flood test was run. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - This is a remote-runtime health/readiness bugfix, not a new user-discoverable workflow. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - Not applicable; no visible UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:13 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5542
No description provided.