Skip to content

bug: chained walk/look/interact can desync agent position and cause position jump #36

@XD319

Description

@XD319

Summary

When an agent performs walk, look, and interact in quick succession, the position state can become inconsistent. In my test, the agent was moving toward the pond normally, but after chaining actions, the position unexpectedly jumped back to a street tile.

This appears to be a state synchronization / concurrency issue rather than a simple navigation mistake.

Observed Behavior

  • Single-step movement in one direction appears relatively stable
  • When walk + look + interact are chained closely together, the MCP/server-side position state can become inconsistent
  • The final reported position may jump unexpectedly to an earlier or unrelated tile
  • This makes exploration and interaction unreliable

Example From Test

I was approaching the pond and had already reached a tile near the target area.

In the log, movement toward the pond was initially stable:

  • reached (5,14)
  • then reached (7,14), facing target (7,15)

After executing another walk, then look, then interact, the state became inconsistent and the agent ended up jumping back near (5,6) instead of remaining near the pond.

Expected Behavior

  • Action execution should preserve a consistent authoritative position state
  • look and interact should not overwrite or roll back the latest committed movement state
  • Chained actions should either:
    • execute strictly sequentially, or
    • be rejected/queued until the previous action is fully committed

Suspected Cause

Possible race condition or state desynchronization between:

  • MCP tool calls (walk, look, interact)
  • server-side state updates
  • frontend rendering / local state refresh

It may also be caused by:

  • lack of per-agent action queue / mutex
  • non-atomic position updates
  • stale state being read by a later action and written back over a newer state

Reproduction Idea

  1. Spawn/login an agent
  2. Move step by step toward a target location
  3. Once near an interactable tile, issue walk, then immediately look, then interact
  4. Repeat a few times
  5. Observe whether the agent position jumps, rolls back, or becomes inconsistent with the visible map state

Impact

This affects the core gameplay loop:

  • exploration
  • environmental interaction
  • future combat / item systems
  • any feature depending on reliable world state

This may become more severe as multi-agent concurrency increases.

Suggested Fix Direction

  • enforce per-agent action queue / mutex
  • make movement state updates atomic
  • ensure look / interact are read-only with respect to position unless explicitly intended
  • add server-side authoritative position logging for each action
  • include action IDs / timestamps to prevent stale writes
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions