[PR #4890] [MERGED] Centralize Agent result types and hydrate Sidecar trackers #6527

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4890
Author: @Xelvanis
Created: 8/11/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @SpicyMarinara

Base: staging ← Head: chore/agent-registry-consistency


📝 Commits (3)

  • eb6a050 refactor: centralize agent result type vocabulary
  • bd56b7d fix: react to tracker registry hydration
  • 9b1a802 docs: document agent registry consistency fixes

📊 Changes

8 files changed (+193 additions, -96 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/panels/ConnectionsPanel.tsx (+8 -4)
📝 packages/client/src/hooks/use-capability-packages.ts (+7 -0)
📝 packages/server/src/services/agents/agent-executor.ts (+2 -30)
📝 packages/shared/src/schemas/agent.schema.ts (+2 -31)
📝 packages/shared/src/types/agent.ts (+33 -29)
📝 scripts/regressions/agent-registry-hydration.regression.ts (+66 -0)
📝 scripts/regressions/agent-runtime.regression.ts (+74 -2)

📄 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 #4889

Why this change

  • Connections could mount before capability Agent hydration and retain a stale Sidecar tracker list because it memoized the mutable built-in registry once.
  • The ordered Agent result-type vocabulary had three handwritten production owners, making future additions or compatibility changes easier to apply inconsistently.

What changed

  • Added AGENT_RESULT_TYPE_VALUES as the sole production vocabulary owner and derived AgentResultType, the Zod enum, and executor admission from it.
  • Preserved all 28 values, order, built-in mappings, music/HTML overrides, and mapped/unmapped unknown-value fallbacks.
  • Independently pinned the ordered compatibility vocabulary in the runtime regression so accidental removals, substitutions, additions, or reorders fail visibly while intentional changes remain possible through an explicit test update.
  • Added a visible-tracker selector over React Query capability-Agent data and subscribed SidecarCard to hydration/refresh updates.
  • Kept displayed assigned/total counts and bulk local assignment on the same current visible tracker list, excluding hidden trackers.
  • Added focused hydration/refresh and production-wiring regression coverage.
  • Added a concise [Unreleased] changelog entry.

Validation

The checkboxes remain intentionally unchecked for human confirmation even where local proof exists.

  • 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

Recorded local proof

  • pnpm check — passed on final prepared commit 9b1a802185cc54a1e42e6a341ba2778c77219a08.
  • pnpm regression:agent-runtime — passed.
  • pnpm regression:agent-registry-hydration — passed.
  • git diff --check — passed.
  • Negative controls:
    • disabling the capability-Agent query failed the intended subscription assertion;
    • replacing the rendered tracker count with {0}/{0} failed the intended count assertion;
    • swapping the first two production result-type values failed the independent ordered-vocabulary assertion.
  • Independent code review and four-lens Bunny Review are closed with no current findings.

Manual verification notes

  • Started an isolated disposable headed Edge session from the feature worktree.
  • Dismissed onboarding, opened Connections, and inspected the Local Model card on desktop and at 390×844 mobile.
  • /api/capability-packages/agents, /api/capability-packages/installed, agent/config, connection, and Sidecar status requests returned 200.
  • Browser console errors: 0; failed non-static requests: 0.
  • The isolated runtime had no downloaded local Sidecar model, so the conditional tracker count and assign-all control were not visible. Their changed wiring is covered by the deterministic hydration regression, production-source contracts, negative controls, and direct query/invalidation inspection.
  • No container validation was run. Light/dark theme behavior, error states, and a fully downloaded local model were not manually exercised; the production patch does not change styling or layout.

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
  • Version/release files updated (only if this PR includes a version bump)

CHANGELOG.md is updated. No version bump or translated-document change is required. Checkboxes remain for human confirmation.

UI evidence (if applicable)

No screenshots or recordings are attached. The change repairs data sourcing without visual redesign; bounded headed desktop/mobile proof is recorded above.

Risks and known limitations

  • The current Sidecar production-wiring guard is intentionally formatting-sensitive static proof. Mounted refresh/click lifecycle hardening is queued separately as TODO-20260811-001; it is not a current production defect or submission blocker.
  • Intentional future result-type changes must update the test-only compatibility oracle and consider migration/fallback handling when persisted or package-authored values are removed or renamed.

Summary by CodeRabbit

  • Bug Fixes

    • Tracker counts and bulk assignments now refresh correctly when Agent packages are hydrated or refreshed.
    • Tracker selections consistently reflect currently visible tracker capabilities.
    • Improved compatibility and validation for supported Agent result types.
  • Tests

    • Added regression coverage for tracker updates before and after hydration.
    • Added validation for supported, unknown, built-in, and custom Agent result types.

🔄 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/4890 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 8/11/2026 **Status:** ✅ Merged **Merged:** 8/11/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `chore/agent-registry-consistency` --- ### 📝 Commits (3) - [`eb6a050`](https://github.com/Pasta-Devs/Marinara-Engine/commit/eb6a050a45d5b55d3b111dc77e34ea38e7540708) refactor: centralize agent result type vocabulary - [`bd56b7d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bd56b7d74ecd5bf4f02a0048822340eed9986bb6) fix: react to tracker registry hydration - [`9b1a802`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9b1a802185cc54a1e42e6a341ba2778c77219a08) docs: document agent registry consistency fixes ### 📊 Changes **8 files changed** (+193 additions, -96 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/panels/ConnectionsPanel.tsx` (+8 -4) 📝 `packages/client/src/hooks/use-capability-packages.ts` (+7 -0) 📝 `packages/server/src/services/agents/agent-executor.ts` (+2 -30) 📝 `packages/shared/src/schemas/agent.schema.ts` (+2 -31) 📝 `packages/shared/src/types/agent.ts` (+33 -29) 📝 `scripts/regressions/agent-registry-hydration.regression.ts` (+66 -0) 📝 `scripts/regressions/agent-runtime.regression.ts` (+74 -2) </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`. ## Linked issue Closes #4889 ## Why this change - Connections could mount before capability Agent hydration and retain a stale Sidecar tracker list because it memoized the mutable built-in registry once. - The ordered Agent result-type vocabulary had three handwritten production owners, making future additions or compatibility changes easier to apply inconsistently. ## What changed - Added `AGENT_RESULT_TYPE_VALUES` as the sole production vocabulary owner and derived `AgentResultType`, the Zod enum, and executor admission from it. - Preserved all 28 values, order, built-in mappings, music/HTML overrides, and mapped/unmapped unknown-value fallbacks. - Independently pinned the ordered compatibility vocabulary in the runtime regression so accidental removals, substitutions, additions, or reorders fail visibly while intentional changes remain possible through an explicit test update. - Added a visible-tracker selector over React Query capability-Agent data and subscribed `SidecarCard` to hydration/refresh updates. - Kept displayed assigned/total counts and bulk local assignment on the same current visible tracker list, excluding hidden trackers. - Added focused hydration/refresh and production-wiring regression coverage. - Added a concise `[Unreleased]` changelog entry. ## Validation The checkboxes remain intentionally unchecked for human confirmation even where local proof exists. - [x] `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) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Recorded local proof - `pnpm check` — passed on final prepared commit `9b1a802185cc54a1e42e6a341ba2778c77219a08`. - `pnpm regression:agent-runtime` — passed. - `pnpm regression:agent-registry-hydration` — passed. - `git diff --check` — passed. - Negative controls: - disabling the capability-Agent query failed the intended subscription assertion; - replacing the rendered tracker count with `{0}/{0}` failed the intended count assertion; - swapping the first two production result-type values failed the independent ordered-vocabulary assertion. - Independent code review and four-lens Bunny Review are closed with no current findings. ### Manual verification notes - Started an isolated disposable headed Edge session from the feature worktree. - Dismissed onboarding, opened Connections, and inspected the Local Model card on desktop and at 390×844 mobile. - `/api/capability-packages/agents`, `/api/capability-packages/installed`, agent/config, connection, and Sidecar status requests returned 200. - Browser console errors: 0; failed non-static requests: 0. - The isolated runtime had no downloaded local Sidecar model, so the conditional tracker count and assign-all control were not visible. Their changed wiring is covered by the deterministic hydration regression, production-source contracts, negative controls, and direct query/invalidation inspection. - No container validation was run. Light/dark theme behavior, error states, and a fully downloaded local model were not manually exercised; the production patch does not change styling or layout. ## Docs and release impact - [ ] No docs changes needed - [x] 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 - [ ] Version/release files updated (only if this PR includes a version bump) `CHANGELOG.md` is updated. No version bump or translated-document change is required. Checkboxes remain for human confirmation. ## UI evidence (if applicable) No screenshots or recordings are attached. The change repairs data sourcing without visual redesign; bounded headed desktop/mobile proof is recorded above. ## Risks and known limitations - The current Sidecar production-wiring guard is intentionally formatting-sensitive static proof. Mounted refresh/click lifecycle hardening is queued separately as `TODO-20260811-001`; it is not a current production defect or submission blocker. - Intentional future result-type changes must update the test-only compatibility oracle and consider migration/fallback handling when persisted or package-authored values are removed or renamed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Tracker counts and bulk assignments now refresh correctly when Agent packages are hydrated or refreshed. - Tracker selections consistently reflect currently visible tracker capabilities. - Improved compatibility and validation for supported Agent result types. - **Tests** - Added regression coverage for tracker updates before and after hydration. - Added validation for supported, unknown, built-in, and custom Agent result types. <!-- 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:11:16 +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#6527
No description provided.