feat: add session review handoff flow

Introduce a desktop/web-only /handoff-review flow that generates a handoff from the active implementation session, creates or reuses a separate review session in the same directory, and links the pair through hidden OpenChamber session metadata.

Add review flow orchestration, metadata helpers, magic prompts, localized command/action labels, session metadata create/update support, and assistant message transfer actions for sending reviewer feedback back to the implementer or implementation responses back to the reviewer.

Review sessions are ordinary sessions, not child sessions. The flow avoids exposing session IDs or routing metadata to agents, hides review controls on mobile and VS Code, hides unrelated assistant actions inside review sessions, cleans up stale metadata where possible, and uses the optimistic send path so cross-session sends scroll like normal composer messages.
This commit is contained in:
Bohdan Triapitsyn
2026-06-07 01:22:40 +03:00
parent e0113c637d
commit 1f9769a932
19 changed files with 1381 additions and 13 deletions
+75
View File
@@ -29,6 +29,11 @@ export type MagicPromptId =
| 'session.summary.instructions'
| 'session.review.visible'
| 'session.review.instructions'
| 'session.reviewHandoff.visible'
| 'session.reviewHandoff.instructions'
| 'session.reviewSession.visible'
| 'session.reviewFeedbackToImplementer.visible'
| 'session.implementationResponseToReviewer.visible'
| 'session.plan.visible'
| 'session.plan.instructions'
| 'session.catchup.visible'
@@ -603,6 +608,76 @@ Output:
- If you find nothing real, say so plainly instead of inventing findings.
Keep the review concise and practical. Respond in the same language the user uses.`,
},
{
id: 'session.reviewHandoff.visible',
title: 'Review Handoff Visible Prompt',
group: 'Session',
description: 'Visible user message sent by the /handoff-review command.',
template: 'Prepare a handoff for another agent to review this work.',
},
{
id: 'session.reviewHandoff.instructions',
title: 'Review Handoff Instructions',
group: 'Session',
description: 'Hidden instructions attached to the /handoff-review command. Produces a handoff for a separate review agent.',
template: `Produce a review handoff for another agent. Do not compact or mutate session history. Your output is an assistant message that OpenChamber will send to a separate reviewer agent.
Include:
- The user's original intent and any later clarifications that changed the intent
- What was implemented and why
- Files changed, with brief purpose per file
- Important design decisions and tradeoffs
- Validation/tests run, if known
- Known gaps, uncertainty, or areas the reviewer should inspect closely
Formatting:
- Concise markdown with clear sections
- No preamble like "Here is a handoff"
- Do not mention OpenChamber metadata, linked sessions, session IDs, or routing
- Respond in the same language the user used most in the conversation`,
},
{
id: 'session.reviewSession.visible',
title: 'Review Session Starter Prompt',
group: 'Session',
description: 'Visible user message sent to the generated review session.',
placeholders: [
{ key: 'handoff', description: 'The generated implementation handoff.' },
],
template: `Please review the changes described in this handoff.
Focus on correctness, regressions, missing implementation, missing tests, and whether the implementation satisfies the stated intent. Provide concise, actionable feedback for the agent implementing the changes.
{{handoff}}`,
},
{
id: 'session.reviewFeedbackToImplementer.visible',
title: 'Review Feedback Transfer Prompt',
group: 'Session',
description: 'Visible user message sent from a review session back to the implementing agent.',
placeholders: [
{ key: 'review_feedback', description: 'Reviewer assistant feedback text.' },
],
template: `Another agent reviewed your changes and left the feedback below.
Please review the feedback, resolve the relevant issues, and explain what you changed.
{{review_feedback}}`,
},
{
id: 'session.implementationResponseToReviewer.visible',
title: 'Implementation Response Transfer Prompt',
group: 'Session',
description: 'Visible user message sent from the implementing agent back to the review session.',
placeholders: [
{ key: 'implementation_response', description: 'Implementing assistant response text.' },
],
template: `The agent implementing the changes has responded to the previous review feedback.
Please review the latest state again and report any remaining issues.
{{implementation_response}}`,
},
{
id: 'session.plan.visible',