From dbb754f085fa6883dcf5001c97cc9d00aff7ffd4 Mon Sep 17 00:00:00 2001 From: Michael Pursifull Date: Fri, 6 Feb 2026 20:43:12 -0600 Subject: [PATCH] fix(party-mode): add return protocol to prevent lost-in-the-middle failures (#1569) After Party Mode completes within a parent workflow, the LLM fails to re-present the parent workflow's completion menu due to lost-in-the-middle effect at 50-100K tokens. The parent workflow instructions get pushed into mid-context where they are no longer proactively recalled. Add a Return Protocol section to step-03-graceful-exit.md that instructs the LLM to: 1. Identify the parent workflow that invoked party-mode 2. Re-read that file to restore context 3. Resume from the invocation point 4. Present required menus/options This is platform-independent prompt engineering that forces proactive re-reading rather than relying on mid-context recall. Fixes #1319 Co-authored-by: Brian --- .../party-mode/steps/step-03-graceful-exit.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/workflows/party-mode/steps/step-03-graceful-exit.md b/src/core/workflows/party-mode/steps/step-03-graceful-exit.md index eef378774..92274a382 100644 --- a/src/core/workflows/party-mode/steps/step-03-graceful-exit.md +++ b/src/core/workflows/party-mode/steps/step-03-graceful-exit.md @@ -142,6 +142,17 @@ Thank you for using BMAD Party Mode for collaborative multi-agent discussions!" - Express genuine appreciation for user's participation and engagement - Leave user with encouragement for future collaborative sessions +## RETURN PROTOCOL: + +If this workflow was invoked from within a parent workflow: + +1. Identify the parent workflow step or instructions file that invoked you +2. Re-read that file now to restore context +3. Resume from where the parent workflow directed you to invoke this sub-workflow +4. Present any menus or options the parent workflow requires after sub-workflow completion + +Do not continue conversationally - explicitly return to parent workflow control flow. + ## WORKFLOW COMPLETION: After farewell sequence and final closure: