Created
April 7, 2026 07:12
-
-
Save jleechan2015/2a026ae4cc80f2bdaa6ecde2965bf66d to your computer and use it in GitHub Desktop.
PR 6138 Evidence
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ╔═══════════════════════════════════════════════════════╗ | |
| ║ Fix CharacterCreationAgent hijacking LevelUpAgent ║ | |
| ║ Recorded: 2026-04-07T07:11:32Z ║ | |
| ╚═══════════════════════════════════════════════════════╝ | |
| ━━━━━━━ 1. GIT PROVENANCE ━━━━━━━ | |
| HEAD SHA: 3b49337d0e7e023a077cf64124db9963fdf82baf | |
| Branch: fix/level-up-agent-hijack | |
| Merge-base vs main: e089c2539b3aa867b236975c56817dac3def778f | |
| Commits ahead of main: 4 | |
| ━━━━━━━ 2. COMMIT LOG ━━━━━━━ | |
| 3b49337d0 Address CR/Cursor feedback: fix modal lock, update tests, fix Python version | |
| de4219a24 Fix run_tests.sh picking up google/genai/tests inside .venv | |
| f6ab41016 Merge branch 'main' into fix/level-up-agent-hijack | |
| ab24c48a8 Fix CharacterCreationAgent hijacking LevelUpAgent | |
| ━━━━━━━ 3. CODE DIFFS ━━━━━━━ | |
| --- diff --stat --- | |
| mvp_site/tests/test_world_logic.py | 6 +- | |
| mvp_site/world_logic.py | 15 +- | |
| pyproject.toml | 2 +- | |
| run_tests.sh | 2 +- | |
| testing_mcp/test_level_up_agent_hijack_real_e2e.py | 154 +++++++++++++++++++++ | |
| 5 files changed, 167 insertions(+), 12 deletions(-) | |
| --- key file diffs (abbreviated) --- | |
| [mvp_site/world_logic.py]: | |
| diff --git a/mvp_site/world_logic.py b/mvp_site/world_logic.py | |
| index af563dfa4..9702d5184 100755 | |
| --- a/mvp_site/world_logic.py | |
| +++ b/mvp_site/world_logic.py | |
| @@ -3303,9 +3303,7 @@ def _load_campaign_and_continue_story( | |
| return None, [], None | |
| story_context = story_context or [] | |
| - _maybe_force_level_up_character_creation( | |
| - llm_input, story_context, current_game_state | |
| - ) | |
| + _maybe_trigger_level_up_modal(llm_input, story_context, current_game_state) | |
| selected_prompts = campaign_data.get("selected_prompts", []) | |
| use_default_world = campaign_data.get("use_default_world", False) | |
| @@ -3440,12 +3438,12 @@ def _load_campaign_and_continue_story( | |
| return campaign_data, story_context, llm_response_obj | |
| -def _maybe_force_level_up_character_creation( | |
| +def _maybe_trigger_level_up_modal( | |
| user_input: str, | |
| story_context: list[dict[str, Any]], | |
| current_game_state: GameState, | |
| ) -> None: | |
| - """If user chose level_up_now, force CharacterCreationAgent for this request.""" | |
| + """If user chose level_up_now, trigger the LevelUpAgent.""" | |
| selected_choice = _get_selected_choice_from_story_context(user_input, story_context) | |
| if not selected_choice: | |
| return | |
| @@ -3458,11 +3456,12 @@ def _maybe_force_level_up_character_creation( | |
| custom_state = {} | |
| custom_state["level_up_pending"] = True | |
| - custom_state["character_creation_in_progress"] = True | |
| - custom_state.setdefault("character_creation_stage", "level_up") | |
| + # Also set level_up_in_progress to ensure _enforce_character_creation_modal_lock | |
| + # is active on first level-up turn (modal lock enforcement) | |
| + custom_state["level_up_in_progress"] = True | |
| current_game_state.custom_campaign_state = custom_state | |
| logging_util.info( | |
| - "🎭 LEVEL_UP_SELECTION: Forcing CharacterCreationAgent via level_up_pending" | |
| + "🎭 LEVEL_UP_SELECTION: Triggering LevelUpAgent via level_up_pending" | |
| ) | |
| ━━━━━━━ 4. PR STATUS ━━━━━━━ | |
| PR STATUS REST API CALL OMITTED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment