[PR #7599] [MERGED] fix(echo-chamber): show reactions for a new reply without a refresh (#7592) #7825

Closed
opened 2026-10-24 04:07:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7599
Author: @SpicyMarinara
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/7592-echo-chamber-live-reactions


📝 Commits (2)

  • c37142b fix(echo-chamber): show reactions for a new reply without a refresh (#7592)
  • 7817c7f fix(echo-chamber): trust only the held reply and log skipped rerun results (#7592)

📊 Changes

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

View changed files

📝 e2e/assigned-chat-sweep.e2e.ts (+218 -0)
📝 packages/client/src/hooks/use-generate.ts (+28 -5)
📝 packages/client/src/lib/agent-result-ownership.ts (+8 -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 #7592

Why this change

  • Echo Chamber reactions for a new reply did not show until you refreshed the page or reran Echo Chamber.
  • This happens when Prose Guardian, Continuity, HTML or a custom rewrite agent is on and streaming is on. The new reply is then held back from the chat's message list until the very end of the request, and the live stream shows it in the meantime. Echo Chamber runs alongside the reply, so its reactions arrive before the reply joins the list. The chat checks that a result belongs to the reply and swipe on screen by looking the reply up in that list. It found nothing, so it dropped the reactions without any log. The panel loads saved reactions only when it opens, so they did not come back until a refresh.
  • A manual rerun worked because by then the reply was already in the list.
  • This is a Marinara Engine fix, not a Marinara-Agents one. The Echo Chamber 1.0.2 package only contains agents.json with phase: "parallel" and its prompts, and has no runtime code. The reactions are dropped by the Engine's agent result handler (use-generate.ts and lib/agent-result-ownership.ts).

What changed

  • While a request is still live, its agent results are now also checked against the reply that request is holding back for a rewrite, if the chat's message list does not have that reply yet. The list still wins when it has the reply, so a result for another swipe or another reply is still dropped.
  • Only the held reply counts. Any other reply the list does not show, such as one you deleted while its request was still running, still has its results dropped, as before.
  • Game replies keep the old check. They stay hidden until their reveal, so they do not count as on screen yet.
  • The Card Evolution Auditor's "open the update window" check uses the same rule.
  • A skipped agent result now writes a console.debug line naming the agent, reply and swipe, both during a reply ([Agent] Skipped …) and during a manual rerun ([Retry Agent] Skipped …), so a dropped batch shows up in the browser console.
  • E2e regressions in e2e/assigned-chat-sweep.e2e.ts:
    • A held reply whose Echo Chamber results arrive before the reply joins the list. The reaction for that reply is kept and shown, and reactions for another swipe or another reply are dropped and logged. A rerun then drops and logs a result for another swipe. It fails on staging (no reactions kept).
    • A Conversation reply deleted while its request is still live. Its later result is dropped and logged, and a result with no reply still applies. It fails on the first version of this PR, which trusted every reply the request saved.

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 the agent ran:

  • pnpm check: passed (exit 0).
  • New test before the fix: playwright test e2e/assigned-chat-sweep.e2e.ts --project=desktop-chromium -g 7592 failed on staging (Received array: [], panel stuck on "Waiting for reactions…").
  • Review follow-up: with the client code of the first PR commit (c37142bef), both #7592 tests failed on desktop-chromium. The deleted reply's reaction was kept, and the rerun logged nothing.
  • After the follow-up, playwright test e2e/assigned-chat-sweep.e2e.ts -g "#7592": 2/2 passed on desktop-chromium, 4/4 on mobile-chromium + mobile-webkit.
  • Whole assigned-chat-sweep, illustration-arrival, mobile-echo-window, agent-write-approval and roleplay-commands on desktop-chromium: 43 passed, 2 skipped, 1 failed. The failure is Roleplay users send and edit private whispers and notes in Manual group chats (a malformed whisper's error text). It fails the same way with the staging client code, so this change did not cause it.
  • Related e2e on desktop-chromium (core-flows, roleplay-commands, illustration-arrival, mobile-echo-window filtered to Echo Chamber / rewrite streaming / live stream row / continue / illustration / agent): 30 passed, 4 skipped, 1 failed. The failure is Agent updates share one dismissible prompt and remain available after Not now. It fails the same way on unmodified staging, so this change did not cause it.
  • Node regressions assigned-issue-sweep (existing swipe-ownership assertions), agent-runtime, roleplay-streaming, assigned-chat-sweep and open-issues: all passed. After the follow-up, every regression that reads use-generate.ts (10 suites) plus agent-activation and spatial-context: all passed.
  • Local CodeRabbit (coderabbit review --agent --committed): 0 findings on the first commit, and 0 findings again on the follow-up commit.

Manual verification notes

  • Manually verify in a Roleplay chat with Echo Chamber and Prose Guardian on, and streaming on. Send a new message. Echo Chamber reactions should appear in the panel after the reply, with no refresh or rerun.
  • Manually verify the same with Prose Guardian off. Reactions should still appear as before.
  • Manually verify that after a reply finishes, swiping to another swipe and back does not bring in reactions that belong to a different swipe.
  • Manually verify a Game chat with agents on still reveals the narration as before, with no early agent output.
  • Manually verify in a Conversation chat with a tracker agent on: delete the new reply while its agents are still running. Nothing from that reply's agents should show up afterwards.
  • Optional: with the browser console set to show Verbose messages, an agent result for a swipe that is not on screen logs [Agent] Skipped …, and one from a rerun logs [Retry Agent] Skipped ….

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)

No docs, UI copy or release files change.

UI evidence (if applicable)

Not a visual change. The e2e regression above covers it.


🔄 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/7599 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/7592-echo-chamber-live-reactions` --- ### 📝 Commits (2) - [`c37142b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c37142befb84e6c71a9e7d6e4a67ad387be9c6f9) fix(echo-chamber): show reactions for a new reply without a refresh (#7592) - [`7817c7f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7817c7f2cd0a5da234d90147be6b0dc7a23c221c) fix(echo-chamber): trust only the held reply and log skipped rerun results (#7592) ### 📊 Changes **3 files changed** (+254 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `e2e/assigned-chat-sweep.e2e.ts` (+218 -0) 📝 `packages/client/src/hooks/use-generate.ts` (+28 -5) 📝 `packages/client/src/lib/agent-result-ownership.ts` (+8 -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`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Closes #7592 ## Why this change - Echo Chamber reactions for a new reply did not show until you refreshed the page or reran Echo Chamber. - This happens when Prose Guardian, Continuity, HTML or a custom rewrite agent is on and streaming is on. The new reply is then held back from the chat's message list until the very end of the request, and the live stream shows it in the meantime. Echo Chamber runs alongside the reply, so its reactions arrive before the reply joins the list. The chat checks that a result belongs to the reply and swipe on screen by looking the reply up in that list. It found nothing, so it dropped the reactions without any log. The panel loads saved reactions only when it opens, so they did not come back until a refresh. - A manual rerun worked because by then the reply was already in the list. - This is a Marinara Engine fix, not a Marinara-Agents one. The Echo Chamber 1.0.2 package only contains `agents.json` with `phase: "parallel"` and its prompts, and has no runtime code. The reactions are dropped by the Engine's agent result handler (`use-generate.ts` and `lib/agent-result-ownership.ts`). ## What changed - While a request is still live, its agent results are now also checked against the reply that request is holding back for a rewrite, if the chat's message list does not have that reply yet. The list still wins when it has the reply, so a result for another swipe or another reply is still dropped. - Only the held reply counts. Any other reply the list does not show, such as one you deleted while its request was still running, still has its results dropped, as before. - Game replies keep the old check. They stay hidden until their reveal, so they do not count as on screen yet. - The Card Evolution Auditor's "open the update window" check uses the same rule. - A skipped agent result now writes a `console.debug` line naming the agent, reply and swipe, both during a reply (`[Agent] Skipped …`) and during a manual rerun (`[Retry Agent] Skipped …`), so a dropped batch shows up in the browser console. - E2e regressions in `e2e/assigned-chat-sweep.e2e.ts`: - A held reply whose Echo Chamber results arrive before the reply joins the list. The reaction for that reply is kept and shown, and reactions for another swipe or another reply are dropped and logged. A rerun then drops and logs a result for another swipe. It fails on `staging` (no reactions kept). - A Conversation reply deleted while its request is still live. Its later result is dropped and logged, and a result with no reply still applies. It fails on the first version of this PR, which trusted every reply the request saved. ## 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 the agent ran: - `pnpm check`: passed (exit 0). - New test before the fix: `playwright test e2e/assigned-chat-sweep.e2e.ts --project=desktop-chromium -g 7592` **failed** on `staging` (`Received array: []`, panel stuck on "Waiting for reactions…"). - Review follow-up: with the client code of the first PR commit (c37142bef), both `#7592` tests **failed** on desktop-chromium. The deleted reply's reaction was kept, and the rerun logged nothing. - After the follow-up, `playwright test e2e/assigned-chat-sweep.e2e.ts -g "#7592"`: 2/2 passed on desktop-chromium, 4/4 on mobile-chromium + mobile-webkit. - Whole `assigned-chat-sweep`, `illustration-arrival`, `mobile-echo-window`, `agent-write-approval` and `roleplay-commands` on desktop-chromium: 43 passed, 2 skipped, 1 failed. The failure is `Roleplay users send and edit private whispers and notes in Manual group chats` (a malformed whisper's error text). It fails the same way with the `staging` client code, so this change did not cause it. - Related e2e on desktop-chromium (`core-flows`, `roleplay-commands`, `illustration-arrival`, `mobile-echo-window` filtered to Echo Chamber / rewrite streaming / live stream row / continue / illustration / agent): 30 passed, 4 skipped, 1 failed. The failure is `Agent updates share one dismissible prompt and remain available after Not now`. It fails the same way on unmodified `staging`, so this change did not cause it. - Node regressions `assigned-issue-sweep` (existing swipe-ownership assertions), `agent-runtime`, `roleplay-streaming`, `assigned-chat-sweep` and `open-issues`: all passed. After the follow-up, every regression that reads `use-generate.ts` (10 suites) plus `agent-activation` and `spatial-context`: all passed. - Local CodeRabbit (`coderabbit review --agent --committed`): 0 findings on the first commit, and 0 findings again on the follow-up commit. ### Manual verification notes - Manually verify in a Roleplay chat with Echo Chamber and Prose Guardian on, and streaming on. Send a new message. Echo Chamber reactions should appear in the panel after the reply, with no refresh or rerun. - Manually verify the same with Prose Guardian off. Reactions should still appear as before. - Manually verify that after a reply finishes, swiping to another swipe and back does not bring in reactions that belong to a different swipe. - Manually verify a Game chat with agents on still reveals the narration as before, with no early agent output. - Manually verify in a Conversation chat with a tracker agent on: delete the new reply while its agents are still running. Nothing from that reply's agents should show up afterwards. - Optional: with the browser console set to show Verbose messages, an agent result for a swipe that is not on screen logs `[Agent] Skipped …`, and one from a rerun logs `[Retry Agent] Skipped …`. ## 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) No docs, UI copy or release files change. ## UI evidence (if applicable) Not a visual change. The e2e regression above covers it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:54 +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#7825
No description provided.