[PR #8496] [MERGED] feat(capability): let packages hide or show chat messages from the AI (API 1.389) #8635

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8496
Author: @Promansis
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @Promansis

Base: staging ← Head: feature(capability)/hide-messages-from-ai


📝 Commits (1)

  • 8ed62b3 feat(capability): let packages hide or show chat messages from the AI

📊 Changes

6 files changed (+103 additions, -6 deletions)

View changed files

📝 docs/development/optional-agent-packages.md (+17 -0)
📝 packages/server/src/services/capability-packages/capability-persistence.service.ts (+18 -0)
📝 packages/shared/src/schemas/capability-package.schema.ts (+3 -1)
📝 packages/shared/src/types/capability-runtime.ts (+7 -0)
📝 scripts/regressions/capability-package-lifecycle.regression.ts (+6 -5)
📝 scripts/regressions/capability-runtime-host-services.regression.ts (+52 -0)

📄 Description

Linked issue

Closes #8491

Why this change

  • The Engine's chat summary can hide the messages it summarised from the AI. A capability package that keeps its own memory of a chat (the first user is Long-Term Memory, Agents #1914) had no way to do the same: the persistence host could read chats and, with chat-write, append messages and patch chat metadata, but not change a message's hiddenFromAI flag.

What changed

  • New optional host method CapabilityPersistenceHost.setMessagesHiddenFromAI?(chatId, messageIds, hidden): Promise<string[]> (Capability API 1.389; 1.388 is #8413 host-only services). Packages feature-detect it, so they keep working on older Engines.
  • It requires chat-write, rejects an unknown chat, ignores ids from other chats, never changes a message whose visibility the user set by hand (extra.visibilityManual), and resolves only the ids whose flag it actually changed. It reuses bulkSetHiddenFromAI (one transaction behind the message patch queues, updates every swipe) and never sets visibilityManual.
  • supportedCapabilityApi minor 388 → 389, lifecycle regression updated, and a "Capability API 1.389" section added to docs/development/optional-agent-packages.md.
  • Regression cases added next to the appendMessages checks in capability-runtime-host-services.regression.ts.
  • User-facing note for release notes: capability packages can now hide or show chat messages from the AI (Capability API 1.389).

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

Commands run by the agent (not ticked above): pnpm check (exit 0), node scripts/run-regressions.mjs --filter capability (26/26 passed), capability-runtime-host-services fails before the fix with setMessagesHiddenFromAI is not a function.

Manual verification notes

  • Manually verify a package with chat-write can hide and show messages in a real chat and that generation leaves hidden messages out of the prompt.
  • Manually verify a message hidden or shown by the user by hand is not changed by the package.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) 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)

docs/development/optional-agent-packages.md gains a 1.389 section (developer doc, not a translated user doc). No app version bump; CHANGELOG untouched per AGENTS.md.

UI evidence (if applicable)

None; no UI change.

🤖 Generated with Claude Code


🔄 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/8496 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `feature(capability)/hide-messages-from-ai` --- ### 📝 Commits (1) - [`8ed62b3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8ed62b384047c35e4c71b65a3f10cb22e78e65b1) feat(capability): let packages hide or show chat messages from the AI ### 📊 Changes **6 files changed** (+103 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/optional-agent-packages.md` (+17 -0) 📝 `packages/server/src/services/capability-packages/capability-persistence.service.ts` (+18 -0) 📝 `packages/shared/src/schemas/capability-package.schema.ts` (+3 -1) 📝 `packages/shared/src/types/capability-runtime.ts` (+7 -0) 📝 `scripts/regressions/capability-package-lifecycle.regression.ts` (+6 -5) 📝 `scripts/regressions/capability-runtime-host-services.regression.ts` (+52 -0) </details> ### 📄 Description ## Linked issue Closes #8491 ## Why this change - The Engine's chat summary can hide the messages it summarised from the AI. A capability package that keeps its own memory of a chat (the first user is Long-Term Memory, Agents #1914) had no way to do the same: the persistence host could read chats and, with `chat-write`, append messages and patch chat metadata, but not change a message's `hiddenFromAI` flag. ## What changed - New optional host method `CapabilityPersistenceHost.setMessagesHiddenFromAI?(chatId, messageIds, hidden): Promise<string[]>` (Capability API **1.389**; 1.388 is #8413 host-only services). Packages feature-detect it, so they keep working on older Engines. - It requires `chat-write`, rejects an unknown chat, ignores ids from other chats, never changes a message whose visibility the user set by hand (`extra.visibilityManual`), and resolves only the ids whose flag it actually changed. It reuses `bulkSetHiddenFromAI` (one transaction behind the message patch queues, updates every swipe) and never sets `visibilityManual`. - `supportedCapabilityApi` minor 388 → 389, lifecycle regression updated, and a "Capability API 1.389" section added to `docs/development/optional-agent-packages.md`. - Regression cases added next to the `appendMessages` checks in `capability-runtime-host-services.regression.ts`. - User-facing note for release notes: capability packages can now hide or show chat messages from the AI (Capability API 1.389). ## 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` Commands run by the agent (not ticked above): `pnpm check` (exit 0), `node scripts/run-regressions.mjs --filter capability` (26/26 passed), `capability-runtime-host-services` fails before the fix with `setMessagesHiddenFromAI is not a function`. ### Manual verification notes - Manually verify a package with `chat-write` can hide and show messages in a real chat and that generation leaves hidden messages out of the prompt. - Manually verify a message hidden or shown by the user by hand is not changed by the package. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) 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) `docs/development/optional-agent-packages.md` gains a 1.389 section (developer doc, not a translated user doc). No app version bump; CHANGELOG untouched per AGENTS.md. ## UI evidence (if applicable) None; no UI change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:46:07 +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#8635
No description provided.