[PR #1822] [MERGED] Fix conversation prompt context parity #5291

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1822
Author: @cha1latte
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1789-conversation-prompt-context


📝 Commits (4)

  • de79882 Fix conversation prompt context parity
  • ae91fb5 Address conversation prompt review feedback
  • 2945038 Tighten conversation prompt gates
  • 9e4b15c Bound cross-chat prompt scans

📊 Changes

3 files changed (+722 additions, -1 deletions)

View changed files

➕ src/engine/generation/prompt-assembly.test.ts (+402 -0)
📝 src/engine/generation/prompt-assembly.ts (+318 -1)
📝 src/features/runtime/generation/hooks/use-generate.ts (+2 -0)

📄 Description

Linked issue

Closes #1789

Why this change

  • Conversation mode still exposed live presence, schedules, cross-chat awareness, connected chat, and command settings, but the refactor prompt assembly did not include the matching conversation context blocks.

What changed

  • Added conversation prompt context blocks for live user status/activity/time, generated character schedules, sibling conversation awareness, linked roleplay/game context, and gated hidden command instructions.
  • Plumbed foreground generation userStatus and userActivity into startGeneration so the engine can render live presence context.
  • Added focused prompt-assembly regression coverage for the restored context blocks and their disabled/non-conversation gates.

Refactor impact

Primary owner:

engine generation

Impact areas reviewed:

  • conversation mode prompt assembly
  • runtime generation request plumbing
  • roleplay/game linked-chat prompt boundaries
  • architecture/import boundaries via pnpm check

Boundary notes:

  • Prompt behavior remains engine-owned in src/engine/generation/prompt-assembly.ts.
  • Feature code only passes existing UI presence state through the generation request; it does not assemble prompt text.
  • Roleplay/game-owned prompt blocks are unchanged; conversation context blocks are gated to mode === "conversation".

Pressure points touched:

  • src/engine/generation/prompt-assembly.ts
  • src/features/runtime/generation/hooks/use-generate.ts

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Codex machine verification:

  • pnpm exec vitest run src\engine\generation\prompt-assembly.test.ts passed. The regression suite covers live presence/schedules, cross-chat awareness enabled/disabled, linked roleplay and game context, command instructions enabled/disabled, and roleplay non-injection.
  • pnpm typecheck passed.
  • pnpm check passed after the final staged diff: line endings, architecture, frontend typecheck, Rust check, docs, discovery, and unused-code.
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed locally.
  • Bunny review pass completed locally before PR creation with no blocking findings.

Manual verification notes

  • No manual verification required for the core claim; the prompt assembly behavior is covered by focused automated tests and full local validation.
  • Local non-UI proof artifacts were captured under scratch/issue-1789-vitest-after.txt and scratch/issue-1789-proof.png.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Bugfix restoring behavior promised by existing conversation settings; no new discoverable surface was added.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A. This is prompt assembly/request plumbing, not a visible UI-state change.

Summary by CodeRabbit

Release Notes

  • New Features
    • Enhanced AI context with live character presence and weekly schedule information
    • Cross-chat awareness enabling AI to reference related character conversations
    • Support for linked conversation contexts from connected roleplay and game chats
    • Expanded conversation command suite including schedule management, cross-posting, and memory features
    • Improved integration of user status and activity into AI interactions

🔄 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/1822 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1789-conversation-prompt-context` --- ### 📝 Commits (4) - [`de79882`](https://github.com/Pasta-Devs/Marinara-Engine/commit/de79882fe5c94b949cb10bf95cd9a8b0b4f93be9) Fix conversation prompt context parity - [`ae91fb5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ae91fb5136d596fb9a0ee4f37aaf2271cbda8e7b) Address conversation prompt review feedback - [`2945038`](https://github.com/Pasta-Devs/Marinara-Engine/commit/29450383cc247b8634b9f1531efcac31f560642d) Tighten conversation prompt gates - [`9e4b15c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9e4b15c2a7aba377bdc407f1437d1e7ce8fdfac8) Bound cross-chat prompt scans ### 📊 Changes **3 files changed** (+722 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `src/engine/generation/prompt-assembly.test.ts` (+402 -0) 📝 `src/engine/generation/prompt-assembly.ts` (+318 -1) 📝 `src/features/runtime/generation/hooks/use-generate.ts` (+2 -0) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1789 ## Why this change - Conversation mode still exposed live presence, schedules, cross-chat awareness, connected chat, and command settings, but the refactor prompt assembly did not include the matching conversation context blocks. ## What changed - Added conversation prompt context blocks for live user status/activity/time, generated character schedules, sibling conversation awareness, linked roleplay/game context, and gated hidden command instructions. - Plumbed foreground generation `userStatus` and `userActivity` into `startGeneration` so the engine can render live presence context. - Added focused prompt-assembly regression coverage for the restored context blocks and their disabled/non-conversation gates. ## Refactor impact Primary owner: engine generation Impact areas reviewed: - conversation mode prompt assembly - runtime generation request plumbing - roleplay/game linked-chat prompt boundaries - architecture/import boundaries via `pnpm check` Boundary notes: - Prompt behavior remains engine-owned in `src/engine/generation/prompt-assembly.ts`. - Feature code only passes existing UI presence state through the generation request; it does not assemble prompt text. - Roleplay/game-owned prompt blocks are unchanged; conversation context blocks are gated to `mode === "conversation"`. Pressure points touched: - `src/engine/generation/prompt-assembly.ts` - `src/features/runtime/generation/hooks/use-generate.ts` ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> <!-- Do not submit *.test.ts or *.test.tsx files as PR proof; cite existing checks, command output, app/browser/Tauri verification, or manual notes instead. --> - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [ ] Remote runtime smoke checked when relevant Codex machine verification: - `pnpm exec vitest run src\engine\generation\prompt-assembly.test.ts` passed. The regression suite covers live presence/schedules, cross-chat awareness enabled/disabled, linked roleplay and game context, command instructions enabled/disabled, and roleplay non-injection. - `pnpm typecheck` passed. - `pnpm check` passed after the final staged diff: line endings, architecture, frontend typecheck, Rust check, docs, discovery, and unused-code. - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed locally. - Bunny review pass completed locally before PR creation with no blocking findings. ### Manual verification notes - No manual verification required for the core claim; the prompt assembly behavior is covered by focused automated tests and full local validation. - Local non-UI proof artifacts were captured under `scratch/issue-1789-vitest-after.txt` and `scratch/issue-1789-proof.png`. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Bugfix restoring behavior promised by existing conversation settings; no new discoverable surface was added. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A. This is prompt assembly/request plumbing, not a visible UI-state change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Enhanced AI context with live character presence and weekly schedule information * Cross-chat awareness enabling AI to reference related character conversations * Support for linked conversation contexts from connected roleplay and game chats * Expanded conversation command suite including schedule management, cross-posting, and memory features * Improved integration of user status and activity into AI interactions <!-- 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-22 04:14:59 +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#5291
No description provided.