Skip to content

Fix typo: 'nstruments' → 'instruments'#76

Open
by22Jy wants to merge 1 commit intoahujasid:mainfrom
by22Jy:main
Open

Fix typo: 'nstruments' → 'instruments'#76
by22Jy wants to merge 1 commit intoahujasid:mainfrom
by22Jy:main

Conversation

@by22Jy
Copy link
Copy Markdown

@by22Jy by22Jy commented Feb 21, 2026

Summary

Fixes #74

Fixed typo in AbletonMCP_Remote_Script/__init__.py:

  • Line 675: "nstruments" → "instruments"

Type of Change

  • Bug fix (typo)

Testing

  • Verified the typo is fixed in the modified file
  • This is a simple typo fix in a string comparison, no functional changes

This fix ensures that the instrument browser navigation works correctly.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where the instrument browser was not initializing correctly due to a path matching error. The browser now properly recognizes and initializes instrument selections as intended.

@qodo-code-review
Copy link
Copy Markdown

Review Summary by Qodo

Fix typo in instrument browser path navigation

🐞 Bug fix

Grey Divider

Walkthroughs

Description
• Fixed typo in browser path navigation logic
• Changed "nstruments" to "instruments" for correct comparison
Diagram
flowchart LR
  A["Browser Path Parser"] -- "path_parts[0].lower()" --> B["String Comparison"]
  B -- "Before: 'nstruments'" --> C["Incorrect Match"]
  B -- "After: 'instruments'" --> D["Correct Match"]
  D --> E["app.browser.instruments"]
Loading

Grey Divider

File Changes

1. AbletonMCP_Remote_Script/__init__.py 🐞 Bug fix +1/-1

Fix instrument browser path typo

• Fixed typo in line 675: "nstruments" → "instruments"
• Corrects browser path navigation logic for instrument selection
• Ensures proper matching of "instruments" path component

AbletonMCP_Remote_Script/init.py


Grey Divider

Qodo Logo

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 21, 2026

📝 Walkthrough

Walkthrough

Fixed a typo in the browser item path resolution logic, where "nstruments" has been corrected to "instruments" on line 675. This ensures that file paths beginning with "instruments" are properly matched and routed to the appropriate initialization branch.

Changes

Cohort / File(s) Summary
Typo Fix
AbletonMCP_Remote_Script/__init__.py
Corrected string comparison from "nstruments" to "instruments" in the _get_browser_item path matching logic, fixing improper path resolution for instrument browser initialization.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A letter was lost in the code so deep,
'nstruments' without its 'i' caused sleep,
Now paths align with the instruments true,
One character fixed makes the browser brand new! 🎹✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title directly and accurately describes the main change: fixing a typo from 'nstruments' to 'instruments'.
Linked Issues check ✅ Passed The code changes directly address issue #74 by correcting the typo on line 675, changing 'nstruments' to 'instruments' as required.
Out of Scope Changes check ✅ Passed The pull request contains only the minimal change required to fix the typo, with no additional or unrelated modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@qodo-code-review
Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. Breaking path keyword change 🐞 Bug ⛯ Reliability
Description
get_browser_item accepts a user-provided path string; changing the recognized root from the
misspelled value to "instruments" may break any existing clients that started sending the old
misspelling as a workaround. Those requests will now fall into the defaulting logic and typically
return Path part 'nstruments' not found, which is a behavioral/API compatibility change.
Code

AbletonMCP_Remote_Script/init.py[675]

+                if path_parts[0].lower() == "instruments":
Evidence
path is provided by the client command payload and is routed directly into _get_browser_item.
When the first segment isn’t one of the known roots, the function defaults to instruments and
prepends "instruments" to the path parts; a client sending nstruments/... would therefore cause
the next navigation step to search for a child named nstruments under the instruments root and
return an error.

AbletonMCP_Remote_Script/init.py[210-314]
AbletonMCP_Remote_Script/init.py[668-706]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`get_browser_item` is a client-facing command that accepts `params.path`. The PR changes the recognized root path keyword from a misspelling to the correct `"instruments"`. Any client that started sending the misspelling as a workaround will now fail path navigation.

### Issue Context
- `path` is passed directly from `_process_command` into `_get_browser_item`.
- `_get_browser_item` defaults unknown roots to instruments and prepends `"instruments"` to the path; a legacy `nstruments/...` path will then usually error with `Path part 'nstruments' not found`.

### Fix Focus Areas
- AbletonMCP_Remote_Script/__init__.py[668-689]
- AbletonMCP_Remote_Script/__init__.py[691-706]
- AbletonMCP_Remote_Script/__init__.py[311-314]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
AbletonMCP_Remote_Script/__init__.py (1)

229-232: ⚠️ Potential issue | 🟠 Major

Dead code: "load_instrument_or_effect" handler inside main_thread_task is unreachable and calls an undefined function.

The outer dispatch check on lines 229–232 does not include "load_instrument_or_effect", so the entire main_thread_task block is never scheduled for that command type. The handler at lines 277–280 therefore cannot execute, and any client sending "load_instrument_or_effect" receives an "Unknown command" error instead. Additionally, the handler calls self._load_instrument_or_effect(track_index, uri) which is not defined anywhere in the file.

Suggested fix — add the command to the dispatch list and implement the handler
  elif command_type in ["create_midi_track", "set_track_name",
                       "create_clip", "add_notes_to_clip", "set_clip_name",
                       "set_tempo", "fire_clip", "stop_clip",
-                      "start_playback", "stop_playback", "load_browser_item"]:
+                      "start_playback", "stop_playback", "load_browser_item",
+                      "load_instrument_or_effect"]:

Also implement the missing _load_instrument_or_effect(self, track_index, uri) method.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AbletonMCP_Remote_Script/__init__.py` around lines 229 - 232, The command
"load_instrument_or_effect" is never dispatched because command_type's main
dispatch list (in main_thread_task) omits it and the handler calls an undefined
method; add "load_instrument_or_effect" to the list alongside the other command
strings so the main_thread_task branch runs for that command, and implement a
new method _load_instrument_or_effect(self, track_index, uri) that performs the
intended instrument/effect loading logic (validate inputs, locate the track by
track_index, load the device/preset from uri and attach it to the track) and
return appropriate success/error responses consistent with other handlers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@AbletonMCP_Remote_Script/__init__.py`:
- Around line 229-232: The command "load_instrument_or_effect" is never
dispatched because command_type's main dispatch list (in main_thread_task) omits
it and the handler calls an undefined method; add "load_instrument_or_effect" to
the list alongside the other command strings so the main_thread_task branch runs
for that command, and implement a new method _load_instrument_or_effect(self,
track_index, uri) that performs the intended instrument/effect loading logic
(validate inputs, locate the track by track_index, load the device/preset from
uri and attach it to the track) and return appropriate success/error responses
consistent with other handlers.

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.

Typo check: 'nstruments' should be 'instruments'

1 participant