[GH-ISSUE #4433] [Issue]: World Maps queued movement fails when Roleplay input is posted with /impersonate #2406

Closed
opened 2026-10-21 05:47:57 +07:00 by bsakaguchi · 8 comments
Owner

Originally created by @thetopham on GitHub (Aug 1, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4433

Originally assigned to: @thetopham on GitHub.

Summary

World Maps queued movement fails deterministically when a Roleplay player's next message is posted through /impersonate.

The reporter normally uses:

  • /impersonate for the player's messages;
  • /guided for NPC/assistant messages.

A bare control chat appeared to work because it used normal typed posts. Character cards, scenarios, personas, prompt presets, and other agents are therefore not the trigger.

Expected behavior

  • /impersonate generates and posts the user's next Roleplay message, so the accepted generated user message should count as the next owner turn.
  • If a ready World Maps destination is queued, saving that generated user message should atomically commit exactly one queued transition.
  • The pending destination should clear and Story location should display the destination.
  • /guided, regeneration, and continuation create or modify assistant-side output and must not consume the player's queued move.
  • An aborted or failed impersonation should preserve the ready move.
  • Needs review should appear only after a genuine stale or rejected transition, with an actionable reason.

Actual behavior

  1. Queue an adjacent destination. World Maps says it will move with the next turn.
  2. Run /impersonate, optionally with a direction.
  3. The generated user-role message is successfully posted.
  4. The story location does not change.
  5. The queued move becomes yellow: Needs review — choose the destination again.
  6. Re-selecting the destination and using /impersonate again repeats the loop indefinitely.

Normal typed Roleplay posts are a positive control: they forward the queued transition and move successfully.

Steps to reproduce

  1. Open a Roleplay chat with World Maps enabled and a valid current story location.
  2. Queue an immediately reachable adjacent destination.
  3. Confirm the status says the destination will move with the next turn.
  4. Enter /impersonate or /impersonate <direction>.
  5. Allow the generated user message to finish and save.
  6. Verify that the current location remains unchanged and the queue becomes Needs review.
  7. Re-select the same destination and repeat to confirm the loop.
  8. As a control, queue the destination again and submit a normal typed Roleplay message; that path should commit the move.

Confirmed cause

Current source separates the two paths incorrectly:

  • The standard Roleplay composer attaches a ready pendingSpatialTransition.
  • The /impersonate slash command sends impersonate: true without that transition.
  • The server currently rejects requests that combine impersonation with a pending spatial transition, even though the generated impersonation result is later saved as a user-role message.
  • The World Maps package bridge treats the generic composer disabled/busy cycle as if a movement-bearing owner turn was submitted. When impersonation finishes and the location is unchanged, it incorrectly marks the queued command needs_review.

This is a submission/acknowledgement contract bug, not corrupt map data. Exporting, reinstalling World Maps, changing the starting location, or rebuilding the chat does not address it.

Fix boundary

The corrected contract should:

  1. Carry the ready transition when /impersonate is used for the next Roleplay owner message.
  2. Generate the impersonated text before committing movement.
  3. Atomically save the generated user message and commit the queued transition.
  4. Emit the normal command-scoped spatial commit event and clear the matching queue.
  5. Distinguish an actual transition attempt from generic generation-busy state, so /guided, regeneration, continuation, illustration, or other passive generation cannot falsely mark a move Needs review.

This likely requires paired host integration and World Maps package-runtime changes. Engine owns the generation/spatial-transition contract; Marinara-Agents owns the downloadable World Maps bridge/runtime.

Acceptance coverage

  • Queue move + successful /impersonate: generated user message saves, move commits once, queue clears.
  • Queue move + /guided: NPC message saves and queued player move remains ready.
  • Queue move + aborted/failed /impersonate: no movement and queue remains ready.
  • Queue move + stale/rejected commit: queue becomes Needs review with a specific reason.
  • Normal typed Roleplay movement remains working.
  • Re-selecting or replacing a queued command cannot acknowledge or clear the wrong command.
  • Reload/restart preserves the correct pending or committed state.

The separate source-derived Game alternate-submission gaps are not part of this confirmed Roleplay reproduction and should be tracked independently if still actionable.

Environment

  • Mode: Roleplay
  • Submission path: /impersonate
  • Control path: normal typed Roleplay post
  • Engine version/build: Not recorded in the supplied reproduction
  • World Maps version: Not recorded in the supplied reproduction
  • Install type / OS / browser: Not recorded

Logs

A fresh debug log confirms that the impersonate generation completed with spatial context present. Private prompt and message content are intentionally omitted.

Prior history

The earlier World Maps 1.2.3 submitted-command acknowledgement defect and its 1.2.5 repair remain relevant history, but this is a distinct current path: /impersonate posts the player's generated message without participating in the queued owner-turn transition contract.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @thetopham on GitHub (Aug 1, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4433 Originally assigned to: @thetopham on GitHub. ## Summary World Maps queued movement fails deterministically when a Roleplay player's next message is posted through `/impersonate`. The reporter normally uses: - `/impersonate` for the player's messages; - `/guided` for NPC/assistant messages. A bare control chat appeared to work because it used normal typed posts. Character cards, scenarios, personas, prompt presets, and other agents are therefore not the trigger. ## Expected behavior - `/impersonate` generates and posts the user's next Roleplay message, so the accepted generated user message should count as the next owner turn. - If a ready World Maps destination is queued, saving that generated user message should atomically commit exactly one queued transition. - The pending destination should clear and Story location should display the destination. - `/guided`, regeneration, and continuation create or modify assistant-side output and must not consume the player's queued move. - An aborted or failed impersonation should preserve the ready move. - **Needs review** should appear only after a genuine stale or rejected transition, with an actionable reason. ## Actual behavior 1. Queue an adjacent destination. World Maps says it will move with the next turn. 2. Run `/impersonate`, optionally with a direction. 3. The generated user-role message is successfully posted. 4. The story location does not change. 5. The queued move becomes yellow: **Needs review — choose the destination again**. 6. Re-selecting the destination and using `/impersonate` again repeats the loop indefinitely. Normal typed Roleplay posts are a positive control: they forward the queued transition and move successfully. ## Steps to reproduce 1. Open a Roleplay chat with World Maps enabled and a valid current story location. 2. Queue an immediately reachable adjacent destination. 3. Confirm the status says the destination will move with the next turn. 4. Enter `/impersonate` or `/impersonate <direction>`. 5. Allow the generated user message to finish and save. 6. Verify that the current location remains unchanged and the queue becomes **Needs review**. 7. Re-select the same destination and repeat to confirm the loop. 8. As a control, queue the destination again and submit a normal typed Roleplay message; that path should commit the move. ## Confirmed cause Current source separates the two paths incorrectly: - The standard Roleplay composer attaches a ready `pendingSpatialTransition`. - The `/impersonate` slash command sends `impersonate: true` without that transition. - The server currently rejects requests that combine impersonation with a pending spatial transition, even though the generated impersonation result is later saved as a user-role message. - The World Maps package bridge treats the generic composer `disabled`/busy cycle as if a movement-bearing owner turn was submitted. When impersonation finishes and the location is unchanged, it incorrectly marks the queued command `needs_review`. This is a submission/acknowledgement contract bug, not corrupt map data. Exporting, reinstalling World Maps, changing the starting location, or rebuilding the chat does not address it. ## Fix boundary The corrected contract should: 1. Carry the ready transition when `/impersonate` is used for the next Roleplay owner message. 2. Generate the impersonated text before committing movement. 3. Atomically save the generated user message and commit the queued transition. 4. Emit the normal command-scoped spatial commit event and clear the matching queue. 5. Distinguish an actual transition attempt from generic generation-busy state, so `/guided`, regeneration, continuation, illustration, or other passive generation cannot falsely mark a move **Needs review**. This likely requires paired host integration and World Maps package-runtime changes. Engine owns the generation/spatial-transition contract; Marinara-Agents owns the downloadable World Maps bridge/runtime. ## Acceptance coverage - [ ] Queue move + successful `/impersonate`: generated user message saves, move commits once, queue clears. - [ ] Queue move + `/guided`: NPC message saves and queued player move remains ready. - [ ] Queue move + aborted/failed `/impersonate`: no movement and queue remains ready. - [ ] Queue move + stale/rejected commit: queue becomes **Needs review** with a specific reason. - [ ] Normal typed Roleplay movement remains working. - [ ] Re-selecting or replacing a queued command cannot acknowledge or clear the wrong command. - [ ] Reload/restart preserves the correct pending or committed state. The separate source-derived Game alternate-submission gaps are not part of this confirmed Roleplay reproduction and should be tracked independently if still actionable. ## Environment - Mode: Roleplay - Submission path: `/impersonate` - Control path: normal typed Roleplay post - Engine version/build: Not recorded in the supplied reproduction - World Maps version: Not recorded in the supplied reproduction - Install type / OS / browser: Not recorded ## Logs A fresh debug log confirms that the impersonate generation completed with spatial context present. Private prompt and message content are intentionally omitted. ## Prior history The earlier World Maps 1.2.3 submitted-command acknowledgement defect and its 1.2.5 repair remain relevant history, but this is a distinct current path: `/impersonate` posts the player's generated message without participating in the queued owner-turn transition contract. ## Template check - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@thetopham commented on GitHub (Aug 1, 2026):

Audit follow-up: the exact World Maps 1.2.5 artifact from Agents PR #164 passes the package lifecycle regression, including the normal Roleplay route and the API-driven Game route. That regression does not exercise Game alternate submission paths such as CYOA choices, QTE results, combat results, or item use. Those paths call GameSurface.sendMessage without forwarding the pending spatial transition, while GameInput only forwards it from scene-addressed composer submissions. This keeps the leading fix ownership in Engine and gives the manual retest a concrete matrix; the package lifecycle pass should not be treated as proof that the reported Game UI loop is fixed.

<!-- gh-comment-id:5153122124 --> @thetopham commented on GitHub (Aug 1, 2026): Audit follow-up: the exact World Maps 1.2.5 artifact from Agents PR #164 passes the package lifecycle regression, including the normal Roleplay route and the API-driven Game route. That regression does not exercise Game alternate submission paths such as CYOA choices, QTE results, combat results, or item use. Those paths call GameSurface.sendMessage without forwarding the pending spatial transition, while GameInput only forwards it from scene-addressed composer submissions. This keeps the leading fix ownership in Engine and gives the manual retest a concrete matrix; the package lifecycle pass should not be treated as proof that the reported Game UI loop is fixed.
Author
Owner

@thetopham commented on GitHub (Aug 2, 2026):

unable to reproduce in main

<!-- gh-comment-id:5154786825 --> @thetopham commented on GitHub (Aug 2, 2026): unable to reproduce in main
Author
Owner

@thetopham commented on GitHub (Aug 3, 2026):

Fresh recurrence reported on 2026-08-03:

I still don't understand this message Needs review — choose the destination again. I keep queueing my destination, and posting, but it never advances.

The reporter is believed to be using Roleplay mode, but the mode has not yet been confirmed. Engine version/build, World Maps version, install type, and submission surface were not supplied.

This is the same user-visible loop described in this issue. It is new evidence because this issue was closed as unable to reproduce rather than by a linked fix.

Current checked staging source still has submission-path differences:

  • The normal Roleplay composer forwards a ready pendingSpatialTransition and should commit it.
  • The normal Game composer forwards it only for Scene-addressed input.
  • Game CYOA, QTE, combat-result, inventory-use, and other direct sendMessage(...) paths still omit it.

If this is confirmed as a normal Roleplay post, the earlier alternate-Game explanation is insufficient and the package-to-Engine synchronization/server rejection path needs a fresh trace.

Please capture these details before closing again:

  1. Roleplay or Game mode.
  2. Marinara Engine release/build and installed World Maps version.
  3. Exact submission path: normal typed post, manual/group response, Scene/party/GM, CYOA, QTE, combat, or item use.
  4. Whether the queued state first says Moves with your next turn before becoming Needs review.
  5. The relevant debug log or /api/generate response code; private message content can be removed.
  6. Whether reloading shows a changed current location or map definition revision.

Reopening for reproduction against the currently installed package/Engine pair. If the reporter confirms Roleplay, the title/scope should be broadened from Game to Roleplay/Game.

<!-- gh-comment-id:5169688505 --> @thetopham commented on GitHub (Aug 3, 2026): Fresh recurrence reported on 2026-08-03: > I still don't understand this message Needs review — choose the destination again. I keep queueing my destination, and posting, but it never advances. The reporter is believed to be using Roleplay mode, but the mode has not yet been confirmed. Engine version/build, World Maps version, install type, and submission surface were not supplied. This is the same user-visible loop described in this issue. It is new evidence because this issue was closed as unable to reproduce rather than by a linked fix. Current checked `staging` source still has submission-path differences: - The normal Roleplay composer forwards a ready `pendingSpatialTransition` and should commit it. - The normal Game composer forwards it only for Scene-addressed input. - Game CYOA, QTE, combat-result, inventory-use, and other direct `sendMessage(...)` paths still omit it. If this is confirmed as a normal Roleplay post, the earlier alternate-Game explanation is insufficient and the package-to-Engine synchronization/server rejection path needs a fresh trace. Please capture these details before closing again: 1. Roleplay or Game mode. 2. Marinara Engine release/build and installed World Maps version. 3. Exact submission path: normal typed post, manual/group response, Scene/party/GM, CYOA, QTE, combat, or item use. 4. Whether the queued state first says **Moves with your next turn** before becoming **Needs review**. 5. The relevant debug log or `/api/generate` response code; private message content can be removed. 6. Whether reloading shows a changed current location or map definition revision. Reopening for reproduction against the currently installed package/Engine pair. If the reporter confirms Roleplay, the title/scope should be broadened from Game to Roleplay/Game.
Author
Owner

@thetopham commented on GitHub (Aug 3, 2026):

Additional reproduction detail from the reporter:

  1. Select the desired next room/location.
  2. The World Maps status confirms that the destination is queued and says the move will occur with the next turn.
  3. Submit the next normal turn.
  4. The current room/location does not change. The status turns yellow and says Needs review — choose the destination again.
  5. Select the same destination again.
  6. The status returns to the ready/queued message saying the move will occur with the next turn.
  7. Submit another turn.
  8. The location again remains unchanged and the status returns to Needs review.
  9. Steps 5–8 repeat indefinitely.

This rules out simple misunderstanding of the UI: destination selection succeeds and creates a ready pending move each time. The failure occurs during submission, server commit, or client acknowledgement of the immediately following turn.

Mode is still believed to be Roleplay but remains unconfirmed. If it is a normal typed Roleplay turn, the standard Roleplay path is expected to forward pendingSpatialTransition, so capture the failed request/response or relevant debug log rather than treating the warning as normal stale-state recovery.

<!-- gh-comment-id:5169751128 --> @thetopham commented on GitHub (Aug 3, 2026): Additional reproduction detail from the reporter: 1. Select the desired next room/location. 2. The World Maps status confirms that the destination is queued and says the move will occur with the next turn. 3. Submit the next normal turn. 4. The current room/location does not change. The status turns yellow and says **Needs review — choose the destination again**. 5. Select the same destination again. 6. The status returns to the ready/queued message saying the move will occur with the next turn. 7. Submit another turn. 8. The location again remains unchanged and the status returns to **Needs review**. 9. Steps 5–8 repeat indefinitely. This rules out simple misunderstanding of the UI: destination selection succeeds and creates a ready pending move each time. The failure occurs during submission, server commit, or client acknowledgement of the immediately following turn. Mode is still believed to be Roleplay but remains unconfirmed. If it is a normal typed Roleplay turn, the standard Roleplay path is expected to forward `pendingSpatialTransition`, so capture the failed request/response or relevant debug log rather than treating the warning as normal stale-state recovery.
Author
Owner

@thetopham commented on GitHub (Aug 3, 2026):

Timeline correction and scope clarification:

The reporter's longer sequence about restart drift, a two-step route stuck on step 1, canceling it, discovering Set current story location, and then seeing Needs review dates back to 2026-07-29. It is the original incident already recorded in Pasta-Devs/Marinara-Agents#160 against World Maps 1.2.3, not an independent post-fix reproduction.

Pasta-Devs/Marinara-Agents#164 merged World Maps 1.2.5 and closed #160. Its relevant changes scoped acknowledgement to the submitted movement command, retained the transition present at turn start through completion, and reconciled the next route step from saved state. Automated exact-artifact coverage included route/history persistence and restart, but the two-hop manual-verification checkbox remained unchecked.

The current state model also distinguishes the two controls:

  • Starting location is the fallback only when the chat has no eligible message snapshot and no bootstrap snapshot.
  • Current story location is resolved from the latest visible spatial snapshot, then a bootstrap snapshot. Set current story location stages an administrative correction that applies on Save, clears queued movement, and does not rewrite prior messages.

The reporter is said to still encounter the repeating Needs review loop now. Treat only a fresh reproduction after the 1.2.5 repair as current evidence. Before assigning a regression or host/package owner, confirm:

  1. The currently installed World Maps version and Engine release/build.
  2. That the loop occurs after updating/restarting, not only in pending state created by 1.2.3.
  3. Whether a fresh adjacent move in a new or cleanly corrected chat fails through a normal typed Roleplay turn.
  4. The failed request/response or debug log from that fresh turn.

Keep this issue open pending that current-version control. If World Maps is older than 1.2.5, update first; if the fresh loop reproduces on 1.2.5+ (especially current 1.3.0), it is a genuine unresolved regression rather than the already-closed 1.2.3 incident.

<!-- gh-comment-id:5169800913 --> @thetopham commented on GitHub (Aug 3, 2026): Timeline correction and scope clarification: The reporter's longer sequence about restart drift, a two-step route stuck on step 1, canceling it, discovering **Set current story location**, and then seeing **Needs review** dates back to 2026-07-29. It is the original incident already recorded in Pasta-Devs/Marinara-Agents#160 against World Maps 1.2.3, not an independent post-fix reproduction. Pasta-Devs/Marinara-Agents#164 merged World Maps 1.2.5 and closed #160. Its relevant changes scoped acknowledgement to the submitted movement command, retained the transition present at turn start through completion, and reconciled the next route step from saved state. Automated exact-artifact coverage included route/history persistence and restart, but the two-hop manual-verification checkbox remained unchecked. The current state model also distinguishes the two controls: - **Starting location** is the fallback only when the chat has no eligible message snapshot and no bootstrap snapshot. - **Current story location** is resolved from the latest visible spatial snapshot, then a bootstrap snapshot. **Set current story location** stages an administrative correction that applies on Save, clears queued movement, and does not rewrite prior messages. The reporter is said to still encounter the repeating **Needs review** loop now. Treat only a fresh reproduction after the 1.2.5 repair as current evidence. Before assigning a regression or host/package owner, confirm: 1. The currently installed World Maps version and Engine release/build. 2. That the loop occurs after updating/restarting, not only in pending state created by 1.2.3. 3. Whether a fresh adjacent move in a new or cleanly corrected chat fails through a normal typed Roleplay turn. 4. The failed request/response or debug log from that fresh turn. Keep this issue open pending that current-version control. If World Maps is older than 1.2.5, update first; if the fresh loop reproduces on 1.2.5+ (especially current 1.3.0), it is a genuine unresolved regression rather than the already-closed 1.2.3 incident.
Author
Owner

@thetopham commented on GitHub (Aug 3, 2026):

Mode and sequence are now confirmed:

  • Mode: Roleplay.
  • The reporter opened the map, selected Place A, used Set current story location, and then posted several normal turns.
  • They selected Place B as the next destination.
  • The next normal Roleplay post left the current location at Place A and changed the queued move to Needs review.
  • Re-selecting Place B returned the status to ready, but every subsequent normal post repeated the same ready -> needs-review cycle without moving.

This broadens the issue beyond alternate Game actions. Once Place A was saved as the current story location and several turns completed, changing the map's starting location was not required and should not affect the next queued move. A freshly queued adjacent move should carry the current definition/location revision.

Current checked staging source expects the standard Roleplay composer to forward a ready pendingSpatialTransition. The next diagnostic needs to locate the failure among:

  1. Package pending state reaching the Engine chat store.
  2. ChatInput attaching that transition to /api/generate.
  3. The server accepting or rejecting the owner-turn commit.
  4. The package bridge observing and acknowledging the committed destination when the turn finishes.

The exact current Engine build, installed World Maps version, and failed request/debug response are still needed. This is no longer adequately described as a Game-only issue.

<!-- gh-comment-id:5169864085 --> @thetopham commented on GitHub (Aug 3, 2026): Mode and sequence are now confirmed: - Mode: **Roleplay**. - The reporter opened the map, selected Place A, used **Set current story location**, and then posted several normal turns. - They selected Place B as the next destination. - The next normal Roleplay post left the current location at Place A and changed the queued move to **Needs review**. - Re-selecting Place B returned the status to ready, but every subsequent normal post repeated the same ready -> needs-review cycle without moving. This broadens the issue beyond alternate Game actions. Once Place A was saved as the current story location and several turns completed, changing the map's **starting location** was not required and should not affect the next queued move. A freshly queued adjacent move should carry the current definition/location revision. Current checked `staging` source expects the standard Roleplay composer to forward a ready `pendingSpatialTransition`. The next diagnostic needs to locate the failure among: 1. Package pending state reaching the Engine chat store. 2. `ChatInput` attaching that transition to `/api/generate`. 3. The server accepting or rejecting the owner-turn commit. 4. The package bridge observing and acknowledging the committed destination when the turn finishes. The exact current Engine build, installed World Maps version, and failed request/debug response are still needed. This is no longer adequately described as a Game-only issue.
Author
Owner

@thetopham commented on GitHub (Aug 3, 2026):

unable to reproduce on my current installation

<!-- gh-comment-id:5170192389 --> @thetopham commented on GitHub (Aug 3, 2026): unable to reproduce on my current installation
Author
Owner

@thetopham commented on GitHub (Aug 3, 2026):

/impersonate and que location causes error

<!-- gh-comment-id:5170591239 --> @thetopham commented on GitHub (Aug 3, 2026): /impersonate and que location causes error
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#2406
No description provided.