Skip to content

Fix AutoMap when creating a new project controller - #18

Merged
Mamat79 merged 1 commit into
mainfrom
agent/fix-new-controller-automap
Aug 10, 2026
Merged

Mamat79 merged 1 commit into
mainfrom
agent/fix-new-controller-automap

Conversation

@Mamat79

@Mamat79 Mamat79 commented Aug 10, 2026

Copy link
Copy Markdown
Owner

What changed

  • fixes AutoMap when the project has no Companion/OSC controller and the user selects “Create a new controller from the selected profile”
  • uses the already validated probe controller UID instead of reading the final controller before it exists
  • adds a regression test for explicit controller embedding
  • documents validation against the supplied Baxter Dury LiveProfessor project

Root cause

The new-controller branch referenced controller.controller_uid before the final controller export assigned controller, raising UnboundLocalError before any plug-in mapping began.

Validation

  • python -m pytest -q — 224 passed
  • supplied project: 41 instances / 19 plug-in types mapped successfully
  • custom selection: all five Saturn 2 instances excluded, remaining 36 instances mapped successfully
  • source .rack2 SHA-256 stayed unchanged in both tests
  • Windows EXE and installer rebuilt successfully
  • corrected V.2026.4 installed locally; installed EXE hash matches the build

@Mamat79
Mamat79 marked this pull request as ready for review August 10, 2026 12:22
@Mamat79
Mamat79 merged commit f47536e into main Aug 10, 2026
3 checks passed
@Mamat79
Mamat79 deleted the agent/fix-new-controller-automap branch August 10, 2026 12:24

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5841df0e9e

ℹ️ 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".

)
if embed_new_controller:
selected_controller_uid = controller.controller_uid
selected_controller_uid = probe.controller_uid

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the collision-adjusted UID for new controllers

When the project already contains any hardware controller using the profile's stable UID, selecting “Create a new controller” still uses the unadjusted probe UID here. If the collision is with a Companion/OSC controller, create_automapped_project silently selects that existing controller instead of embedding the new one; if it is with another controller type, _controller_from_template adjusts the embedded UID and then rejects it because it no longer matches this value. Use a UID that accounts for all project controllers and pass that same UID to the final export and AutoMap.

Useful? React with 👍 / 👎.

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.

1 participant