Skip to content

Fix early-game control path and Gen 1 memory layout - #13

Merged
jacobyoby merged 1 commit into
mainfrom
cursor/review-fixes-2630
Sep 21, 2026
Merged

jacobyoby merged 1 commit into
mainfrom
cursor/review-fixes-2630

Conversation

@jacobyoby

@jacobyoby jacobyoby commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Description

Fixes the bugs from the general review that change what the agent actually does: the strategy shortcut was skipping the policy chain, LLM replies containing START were parsed as A, party max HP and route map IDs did not match Pokemon Red, OCR dialog text was paired with the wrong region, and each LLM call was counted twice.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Related Issues

None open.

Changes Made

  • step() no longer takes a raw strategy button before get_action(). Naming scripts, menu escape, and dialog handling run first. Overworld routing stays in _route_policy.
  • LLM button parsing matches whole words, so START stays START and prose like GO EAST is not button A. WAIT is capped at 30 units.
  • Party max HP is offset 34 and status is offset 4 (pret party_struct). Route 1 is map 0x0C (0x0B is unused).
  • OCR dialog strings stay paired with the region that produced them after short reads are dropped.
  • LLM call counts are recorded only in the provider.

Testing

  • All existing tests pass
  • New tests added for new functionality
  • Tested with both Ollama and Claude providers (if applicable)
  • Tested on Windows/macOS/Linux (if applicable)

ruff check is clean on the changed files. pytest -m "not slow" : 203 passed. The slow/integration set that covers early-game and end-to-end flows also passed (159 tests in the focused run, including those files).

Checklist

  • Code follows PEP 8 style guidelines
  • Code is commented, particularly in hard-to-understand areas
  • Documentation updated (README, CHANGELOG, docs/)
  • CHANGELOG.md updated
  • No ROM files included
  • No sensitive data included (API keys, etc.)
  • Tests pass locally
Open in Web Open in Cursor 

Keep strategy suggestions inside the policy chain, parse button tokens as whole words, and align party HP plus Route 1 map IDs with the pret layout.

Co-authored-by: Jacobrakai <jacobyoby@users.noreply.github.com>
@jacobyoby
jacobyoby marked this pull request as ready for review September 21, 2026 23:06
@jacobyoby
jacobyoby merged commit e53ddaf into main Sep 21, 2026
3 checks passed
@jacobyoby
jacobyoby deleted the cursor/review-fixes-2630 branch September 21, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants