Custom game dataset visibility#71
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 081a8528f4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // and never gets routed to stale state. Otherwise prefer the Train-tab | ||
| // game id, then Teach, staying backwards-compatible. Normalized so the | ||
| // scanned folder matches the safe id used at record time. | ||
| const gameId = normalizeCustomGameId( |
There was a problem hiding this comment.
Preserve legacy custom game folders
When a user upgrades with datasets already recorded under a custom id containing spaces or case, the old recording path and the backend only trimmed game_id, so those files live under the exact folder such as datasets/My Custom Game. This unconditional normalization now makes every refresh query datasets/my_custom_game instead, so existing custom-game recordings disappear from the Train dropdown and cannot be selected without manually renaming folders; consider falling back to the raw id or migrating legacy folders when the normalized lookup is empty.
Useful? React with 👍 / 👎.
I checked the proposed diff against the live code: all its "before" sections matched, the logic is sound, and the recording_finalized payload genuinely carries game_id (confirmed in session_manager.py:174/224). I applied its substance, with two correctness gaps closed:
The proposed diff normalized at refresh/finalize but not at the recording START path (main.js recording start still only .trim()'d). Because the backend doesn't normalize, a name like My Custom Game could be written to one folder and looked up under another — reintroducing the bug. I now normalize at START and put all game-id fields in lockstep before recording.
Start Training had the same raw-vs-normalized mismatch (train-game-id was only trimmed). A custom game typed directly into the Train field would train against the wrong folder. Now normalized too.
I made the START sync surgical (sync identity fields directly instead of applyGamePreset()) so a user's hand-picked capture resolution isn't visually reset when they hit Record.