Skip to content

Make AI movement clamping expansion-aware for frontier objectives - #143

Merged
AaronKow merged 1 commit into
mainfrom
codex/make-ai-movement-map-expansion-aware
Mar 14, 2026
Merged

AaronKow merged 1 commit into
mainfrom
codex/make-ai-movement-map-expansion-aware

Conversation

@AaronKow

Copy link
Copy Markdown
Owner

Motivation

  • Prevent the agent from being clipped back into the base 100×100 map when the world has been expanded so frontier/external tiles remain reachable.
  • Preserve existing safety: reject non-finite inputs and block absurd teleports while allowing movement beyond base-map limits for valid expansion tiles.
  • Ensure move → expand_map objective flow still works from reachable frontier positions.

Description

  • Replace hardcoded clamp x = max(1, min(99, x)) / z = max(1, min(99, z)) with expansion-aware bounds derived from client.world_size and get_world_state_snapshot() expansionTiles, adding a small margin MOVE_BOUNDS_EXPANSION_MARGIN.
  • Add _safe_move_scalar(value, fallback) to sanitize non-finite/invalid coordinates and _movement_bounds() to compute dynamic (min_x, max_x, min_z, max_z) from snapshot + base world size.
  • Add MOVE_MAX_ABSURD_DELTA guard to prevent absurd teleport deltas and clamp movement deltas to a safe maximum instead of forcing movement back into the base map.
  • Update _execute() move branch to use the new sanitization, expansion-aware bounds, and absurd-delta guard; keep rotation calculation consistent with sanitized origin.
  • Extend tests in client-sdk-python/tests/test_ai_agent_timing.py (and adapt DummyClient) to cover frontier coordinates preservation, move→expand_map flow from frontier positions, and sanitization of non-finite inputs.

Testing

  • Ran pytest client-sdk-python/tests/test_ai_agent_timing.py client-sdk-python/tests/test_openbot_client.py -q; both test modules passed locally.
  • Test results: 16 passed (all tests in the two modules succeeded).
  • Unit tests added/updated: expansion-frontier move preservation, move then expand_map frontier flow, and non-finite coordinate sanitization in client-sdk-python/tests/test_ai_agent_timing.py.

Codex Task

@netlify

netlify Bot commented Mar 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for openbot-social canceled.

Name Link
🔨 Latest commit 5623f2e
🔍 Latest deploy log https://app.netlify.com/projects/openbot-social/deploys/69b4d2a356fa7d000823de61

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@AaronKow
AaronKow merged commit 2c1fad0 into main Mar 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant