[PR #795] [MERGED] fix(memory-nag): send the saved admin secret on plain-HTTP remote clients #1141

Closed
opened 2026-10-21 05:03:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/795
Author: @Romuromylus
Created: 9/11/2026
Status: ✅ Merged
Merged: 9/11/2026
Merged by: @Romuromylus

Base: staging ← Head: fix/794-memory-nag-admin-secret-http


📝 Commits (1)

  • e05d4c2 fix(memory-nag): send the saved admin secret on plain-HTTP remote clients

📊 Changes

12 files changed (+58 additions, -30 deletions)

View changed files

➕ artifacts/memory-nag-1.1.1.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/notes.json (+6 -0)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v2/notes.json (+6 -0)
📝 catalog/v3/catalog.json (+6 -6)
📝 catalog/v3/notes.json (+6 -0)
📝 packages/memory-nag/CHANGELOG.md (+4 -0)
📝 packages/memory-nag/client.js (+7 -7)
📝 packages/memory-nag/manifest.json (+3 -3)
📝 packages/memory-nag/src/engine/packages/client/src/features/memory-nag/api.ts (+7 -1)
📝 scripts/build-feature-packages.mjs (+1 -1)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #794 (mirror of Pasta-Devs/Marinara-Engine#6048)

Why this change

  • Every Memory Nag route is registered behind the Engine's privileged gate, so a non-loopback browser must send X-Admin-Secret. The package client only attached that header when the page was served over HTTPS, so a remote browser on plain HTTP (a LAN address, or a Termux server reached by IP) failed Create Memories with "Invalid or missing X-Admin-Secret header" even though the secret was saved in Settings, Advanced, Admin Access.
  • The Engine's own api-client.ts and the Long-Term Memory package already send the header regardless of protocol from the same browser, so the HTTPS-only guard did not protect the secret; it only disabled the package on exactly the setups that need the header.

What changed

  • packages/memory-nag/src/engine/packages/client/src/features/memory-nag/api.ts: adminHeaders() drops the protocol !== "https:" early return and uses the same typeof window guard as the Engine and Long-Term Memory clients.
  • memory-nag bumped 1.1.0 to 1.1.1 in scripts/build-feature-packages.mjs; packages/memory-nag/CHANGELOG.md entry.
  • Regenerated by node scripts/build-feature-packages.mjs memory-nag: packages/memory-nag/client.js, manifest.json, artifacts/memory-nag-1.1.1.zip, and the catalog/**/catalog.json and notes.json lanes.

Package and security impact

  • Affected package IDs: memory-nag
  • Engine compatibility impact: none (engine.min 2.4.4 unchanged)
  • New or changed permissions/entrypoints: none
  • Restart, storage, update, or uninstall impact: none beyond the normal package update; restartRequired unchanged

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Ran node scripts/test-catalog-lanes.mjs, node scripts/validate-catalog.mjs (lanes v2=35, v3=35, legacy alias valid) and git diff --check; all pass.
  • Confirmed the rebuilt client.js no longer contains the protocol!=="https:" early return.
  • Build environment note: the bundle was produced with the builder's default Engine root (esbuild 0.27.7). A baseline rebuild of the untouched 1.1.0 sources on this machine already differed from the committed bundle by about 2 KB of minifier output, so this rebuild is not byte-identical to a maintainer build; the source diff is the two-line change above.
  • Not yet done: installing 1.1.1 through a running Engine and exercising Create Memories from a plain-HTTP remote browser.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

UI evidence (if applicable)

Not applicable (no UI change).

Summary by CodeRabbit

  • Bug Fixes

    • Create Memories now works for plain-HTTP remote clients on LAN and Termux setups by sending the saved admin secret.
    • Prevented server-side rendering from attempting to access browser-only settings.
  • Releases

    • Updated the memory-nag package to version 1.1.1.
  • Documentation

    • Added version 1.1.1 changelog entries describing the remote-client fix.

🔄 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-Agents/pull/795 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 9/11/2026 **Status:** ✅ Merged **Merged:** 9/11/2026 **Merged by:** [@Romuromylus](https://github.com/Romuromylus) **Base:** `staging` ← **Head:** `fix/794-memory-nag-admin-secret-http` --- ### 📝 Commits (1) - [`e05d4c2`](https://github.com/Pasta-Devs/Marinara-Agents/commit/e05d4c24da045d5ea4dad62da4d78c8bbbae3444) fix(memory-nag): send the saved admin secret on plain-HTTP remote clients ### 📊 Changes **12 files changed** (+58 additions, -30 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/memory-nag-1.1.1.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/notes.json` (+6 -0) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v2/notes.json` (+6 -0) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `catalog/v3/notes.json` (+6 -0) 📝 `packages/memory-nag/CHANGELOG.md` (+4 -0) 📝 `packages/memory-nag/client.js` (+7 -7) 📝 `packages/memory-nag/manifest.json` (+3 -3) 📝 `packages/memory-nag/src/engine/packages/client/src/features/memory-nag/api.ts` (+7 -1) 📝 `scripts/build-feature-packages.mjs` (+1 -1) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #794 (mirror of Pasta-Devs/Marinara-Engine#6048) ## Why this change - Every Memory Nag route is registered behind the Engine's privileged gate, so a non-loopback browser must send `X-Admin-Secret`. The package client only attached that header when the page was served over HTTPS, so a remote browser on plain HTTP (a LAN address, or a Termux server reached by IP) failed Create Memories with "Invalid or missing X-Admin-Secret header" even though the secret was saved in Settings, Advanced, Admin Access. - The Engine's own `api-client.ts` and the Long-Term Memory package already send the header regardless of protocol from the same browser, so the HTTPS-only guard did not protect the secret; it only disabled the package on exactly the setups that need the header. ## What changed - `packages/memory-nag/src/engine/packages/client/src/features/memory-nag/api.ts`: `adminHeaders()` drops the `protocol !== "https:"` early return and uses the same `typeof window` guard as the Engine and Long-Term Memory clients. - `memory-nag` bumped 1.1.0 to 1.1.1 in `scripts/build-feature-packages.mjs`; `packages/memory-nag/CHANGELOG.md` entry. - Regenerated by `node scripts/build-feature-packages.mjs memory-nag`: `packages/memory-nag/client.js`, `manifest.json`, `artifacts/memory-nag-1.1.1.zip`, and the `catalog/**/catalog.json` and `notes.json` lanes. ## Package and security impact - Affected package IDs: `memory-nag` - Engine compatibility impact: none (`engine.min` 2.4.4 unchanged) - New or changed permissions/entrypoints: none - Restart, storage, update, or uninstall impact: none beyond the normal package update; `restartRequired` unchanged ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Ran `node scripts/test-catalog-lanes.mjs`, `node scripts/validate-catalog.mjs` (lanes v2=35, v3=35, legacy alias valid) and `git diff --check`; all pass. - Confirmed the rebuilt `client.js` no longer contains the `protocol!=="https:"` early return. - Build environment note: the bundle was produced with the builder's default Engine root (esbuild 0.27.7). A baseline rebuild of the untouched 1.1.0 sources on this machine already differed from the committed bundle by about 2 KB of minifier output, so this rebuild is not byte-identical to a maintainer build; the source diff is the two-line change above. - Not yet done: installing 1.1.1 through a running Engine and exercising Create Memories from a plain-HTTP remote browser. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) Not applicable (no UI change). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Create Memories now works for plain-HTTP remote clients on LAN and Termux setups by sending the saved admin secret. - Prevented server-side rendering from attempting to access browser-only settings. - **Releases** - Updated the memory-nag package to version 1.1.1. - **Documentation** - Added version 1.1.1 changelog entries describing the remote-client fix. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:03:46 +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-Agents#1141
No description provided.