[PR #5726] [MERGED] fix: keep active package assets through restart #6902

Closed
opened 2026-10-23 04:14:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5726
Author: @Gunterlie
Created: 9/1/2026
Status: ✅ Merged
Merged: 9/1/2026
Merged by: @Gunterlie

Base: staging ← Head: fix/5715-package-asset-continuity


📝 Commits (2)

  • 63b358f fix(capabilities): keep active package assets through restart
  • b35e8ea fix(capabilities): preserve legacy active version across updates

📊 Changes

6 files changed (+195 additions, -54 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/client/src/hooks/use-capability-packages.ts (+24 -19)
📝 packages/server/src/services/capability-packages/package-manager.service.ts (+50 -14)
📝 packages/shared/src/schemas/capability-package.schema.ts (+1 -0)
📝 scripts/regressions/agent-registry-hydration.regression.ts (+17 -4)
📝 scripts/regressions/capability-package-cache.regression.ts (+101 -17)

📄 Description

Important

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

Linked issue

Closes #5715

Why this change

  • Installing a server-backed Agent update leaves the old runtime active until restart, but the package file routes switched to the pending version and rejected it as not ready. Home icons disappeared and a browser opened during that interval could not load the active client module.

What changed

  • Store the trusted previous manifest beside the previous version in the installed-package registry.
  • Resolve Home metadata, client modules, client entrypoints, and static assets from the active previous version while its replacement waits for restart.
  • Recover old pending registry records that have previousVersion but no stored previousManifest.
  • Keep the original active version stable across repeated updates before restart.
  • Add regressions with different old and new client and icon bytes.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Focused automated regressions pass: capability-package-cache.regression.ts and agent-registry-hydration.regression.ts.
  • pnpm version:check and pnpm guard:installer-artifacts pass.
  • Local CodeRabbit review found two issues. This revision fixes both: loading the old client in a fresh browser session and compatibility with old pending registry records.
  • No manual browser update or container test was performed. GitHub CI will run the full check suite.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • Not included. This fixes package update continuity and does not add a new UI surface.

Summary by CodeRabbit

  • Bug Fixes

    • Preserved Agent Home icons and client features while package updates await a restart.
    • Continued serving the active, verified files until the replacement version is applied.
    • Improved compatibility with existing installations missing prior package manifest information.
  • Tests

    • Added coverage for pending updates, asset serving, legacy records, and activation of new assets after restart.

🔄 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/5726 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 9/1/2026 **Status:** ✅ Merged **Merged:** 9/1/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `fix/5715-package-asset-continuity` --- ### 📝 Commits (2) - [`63b358f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/63b358f1597567438fef6ee649a513ba27ee70ba) fix(capabilities): keep active package assets through restart - [`b35e8ea`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b35e8eaf37ce45e007570a6448e65670638232b1) fix(capabilities): preserve legacy active version across updates ### 📊 Changes **6 files changed** (+195 additions, -54 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/client/src/hooks/use-capability-packages.ts` (+24 -19) 📝 `packages/server/src/services/capability-packages/package-manager.service.ts` (+50 -14) 📝 `packages/shared/src/schemas/capability-package.schema.ts` (+1 -0) 📝 `scripts/regressions/agent-registry-hydration.regression.ts` (+17 -4) 📝 `scripts/regressions/capability-package-cache.regression.ts` (+101 -17) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #5715 ## Why this change - Installing a server-backed Agent update leaves the old runtime active until restart, but the package file routes switched to the pending version and rejected it as not ready. Home icons disappeared and a browser opened during that interval could not load the active client module. ## What changed - Store the trusted previous manifest beside the previous version in the installed-package registry. - Resolve Home metadata, client modules, client entrypoints, and static assets from the active previous version while its replacement waits for restart. - Recover old pending registry records that have `previousVersion` but no stored `previousManifest`. - Keep the original active version stable across repeated updates before restart. - Add regressions with different old and new client and icon bytes. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Focused automated regressions pass: `capability-package-cache.regression.ts` and `agent-registry-hydration.regression.ts`. - `pnpm version:check` and `pnpm guard:installer-artifacts` pass. - Local CodeRabbit review found two issues. This revision fixes both: loading the old client in a fresh browser session and compatibility with old pending registry records. - No manual browser update or container test was performed. GitHub CI will run the full check suite. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - Not included. This fixes package update continuity and does not add a new UI surface. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Preserved Agent Home icons and client features while package updates await a restart. * Continued serving the active, verified files until the replacement version is applied. * Improved compatibility with existing installations missing prior package manifest information. * **Tests** * Added coverage for pending updates, asset serving, legacy records, and activation of new assets after restart. <!-- 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-23 04:14:45 +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#6902
No description provided.