[PR #1849] [MERGED] Add /amend guided response revisions #5320

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

📋 Pull Request Information

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

Base: refactor ← Head: feat/issue-1848-amend-command


📝 Commits (2)

  • 5727433 Add amend slash command
  • fc28793 Trigger CI after PR body update

📊 Changes

9 files changed (+199 additions, -11 deletions)

View changed files

📝 src/engine/generation/generation-replay.ts (+1 -0)
➕ src/engine/shared/text/generation-guide.test.ts (+21 -0)
📝 src/engine/shared/text/generation-guide.ts (+18 -1)
📝 src/features/modes/conversation/components/ConversationInput.tsx (+16 -0)
📝 src/features/modes/shared/chat-ui/components/ChatInput.tsx (+22 -1)
📝 src/features/modes/shared/chat-ui/components/GenerationReplayDetailsModal.tsx (+10 -3)
📝 src/features/shell/discovery/discovery-entries.json (+4 -4)
➕ src/shared/lib/slash-commands.test.ts (+64 -0)
📝 src/shared/lib/slash-commands.ts (+43 -2)

📄 Description

Linked issue

Closes #1848

Why this change

  • Users sometimes want to revise the latest assistant response with a specific instruction while preserving what already works. /amend <instruction> makes that workflow explicit and saves the revised output as a new swipe instead of replacing chat history.

What changed

  • Added /amend <revision instruction> and /revise <revision instruction> slash commands for Conversation and Roleplay chats.
  • The command targets the latest visible assistant response, embeds that response into a focused amend instruction, and reuses the existing regeneration/swipe path through regenerateMessageId.
  • Added an amend generation guide source so replay metadata and stored guidance can represent amended swipes.
  • Updated stored guidance display/copy behavior and discovery metadata for slash commands and swipes/rerolls.
  • Added focused coverage for amend guide formatting and slash command execution.

Refactor impact

Primary owner:

  • Shared mode UI / runtime generation

Impact areas reviewed:

  • Conversation input slash-command context
  • Shared Roleplay/Conversation chat input slash-command context
  • Generation guide/replay metadata
  • Prompt inspector stored guidance display
  • Discovery metadata

Boundary notes:

  • Engine changes stay in React-free generation guide/replay helpers.
  • Feature UI changes stay in input surfaces and prompt-inspector display.
  • No shared API, Tauri/Rust storage, remote runtime, schema, migration, dependency, or provider changes.

Pressure points touched:

  • Shared mode chat input
  • Conversation input
  • Slash-command registry
  • Generation replay details modal
  • Discovery registry metadata

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex ran pnpm test src/engine/shared/text/generation-guide.test.ts src/shared/lib/slash-commands.test.ts and it passed: 2 files, 4 tests.
  • Codex ran pnpm check after rebasing on current upstream/refactor; it passed line endings, architecture, frontend typecheck, Rust check, docs, discovery, and unused-code checks.
  • Manual app/browser verification not run; the command path is covered by focused unit tests and TypeScript/full repo checks.

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:

  • Updated the Slash Commands and Swipes And Rerolls discovery entries so /amend can be found through Discover search.

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

  • Not captured. This is a typed slash-command workflow; behavior was verified with focused command/helper tests and the full repo gate.

🔄 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/1849 **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:** `feat/issue-1848-amend-command` --- ### 📝 Commits (2) - [`5727433`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5727433c8d637885652de51a8dbef90a48679dd2) Add amend slash command - [`fc28793`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fc2879384668433dfb29443687f06b59cf66718b) Trigger CI after PR body update ### 📊 Changes **9 files changed** (+199 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/generation/generation-replay.ts` (+1 -0) ➕ `src/engine/shared/text/generation-guide.test.ts` (+21 -0) 📝 `src/engine/shared/text/generation-guide.ts` (+18 -1) 📝 `src/features/modes/conversation/components/ConversationInput.tsx` (+16 -0) 📝 `src/features/modes/shared/chat-ui/components/ChatInput.tsx` (+22 -1) 📝 `src/features/modes/shared/chat-ui/components/GenerationReplayDetailsModal.tsx` (+10 -3) 📝 `src/features/shell/discovery/discovery-entries.json` (+4 -4) ➕ `src/shared/lib/slash-commands.test.ts` (+64 -0) 📝 `src/shared/lib/slash-commands.ts` (+43 -2) </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 #1848 ## Why this change - Users sometimes want to revise the latest assistant response with a specific instruction while preserving what already works. `/amend <instruction>` makes that workflow explicit and saves the revised output as a new swipe instead of replacing chat history. ## What changed - Added `/amend <revision instruction>` and `/revise <revision instruction>` slash commands for Conversation and Roleplay chats. - The command targets the latest visible assistant response, embeds that response into a focused amend instruction, and reuses the existing regeneration/swipe path through `regenerateMessageId`. - Added an `amend` generation guide source so replay metadata and stored guidance can represent amended swipes. - Updated stored guidance display/copy behavior and discovery metadata for slash commands and swipes/rerolls. - Added focused coverage for amend guide formatting and slash command execution. ## Refactor impact Primary owner: - Shared mode UI / runtime generation Impact areas reviewed: - Conversation input slash-command context - Shared Roleplay/Conversation chat input slash-command context - Generation guide/replay metadata - Prompt inspector stored guidance display - Discovery metadata Boundary notes: - Engine changes stay in React-free generation guide/replay helpers. - Feature UI changes stay in input surfaces and prompt-inspector display. - No shared API, Tauri/Rust storage, remote runtime, schema, migration, dependency, or provider changes. Pressure points touched: - Shared mode chat input - Conversation input - Slash-command registry - Generation replay details modal - Discovery registry metadata ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex ran `pnpm test src/engine/shared/text/generation-guide.test.ts src/shared/lib/slash-commands.test.ts` and it passed: 2 files, 4 tests. - Codex ran `pnpm check` after rebasing on current `upstream/refactor`; it passed line endings, architecture, frontend typecheck, Rust check, docs, discovery, and unused-code checks. - Manual app/browser verification not run; the command path is covered by focused unit tests and TypeScript/full repo checks. ## Feature Discoverability Check exactly one: - [x] 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: - Updated the Slash Commands and Swipes And Rerolls discovery entries so `/amend` can be found through Discover search. ## 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 - Not captured. This is a typed slash-command workflow; behavior was verified with focused command/helper tests and the full repo gate. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:15:12 +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#5320
No description provided.