11 KiB
SPRINT v0.1.33 - NEXT FOR OPENCODE
Use The Ableton MCP Correctly, Stop Stalling, Generate Songs With Tools Or Python Fallback
Owner: OpenCode
Reviewer: Codex
Fecha: 2026-04-03
Reason: OpenCode is behaving as if the MCP were unavailable or unreliable, and is overthinking instead of using the tools to make songs.
1. Verified MCP Truth
Codex already verified the MCP state from this workspace.
Current truth:
- OpenCode MCP server is connected
toolCount = 77- canonical wrapper is:
C:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\mcp_wrapper.py
- current OpenCode config is valid in:
C:\Users\ren\.config\opencode\opencode.jsonC:\ProgramData\Ableton\Live 12 Suite\Resources\MIDI Remote Scripts\opencode.json
- MCP timeout is already:
600000 ms
Therefore:
- this is not a connection sprint
- this is not a config sprint
- this is a tool-usage discipline sprint
If OpenCode says:
- "MCP unavailable"
- "tools missing"
- "timeout means failure"
without rechecking runtime state, that is a workflow error.
2. Core Problem
OpenCode is wasting turns in reasoning and often does one of these bad patterns:
- thinks too much before calling any MCP tool
- treats a timeout as final failure
- retries generation blindly
- mixes code-debugging behavior into a normal "make me a song" request
- claims a song was generated without validating the runtime result
This sprint exists to stop that behavior.
3. Hard Rules For OpenCode
These are not suggestions.
3.1 When the user asks for a song, use MCP immediately
If the user asks to:
- create a song
- generate a track
- remake a reference
- refine an existing generated song
then OpenCode must call Ableton MCP tools early.
Do not spend the turn in analysis-only mode.
Within the first tool phase, OpenCode must do at least:
ableton-mcp-ai_get_session_infoableton-mcp-ai_get_tracks- one generation or edit tool appropriate to the request
3.1.b If MCP tools are temporarily unavailable in the client UI, use Python or shell immediately
If OpenCode cannot see MCP tools in the chat client but the project is local and the wrapper exists, it must not stop there.
Approved fallback:
- verify MCP config files
- verify wrapper path
- run
opencode mcp list --print-logs - inspect Live log if needed
- only after that declare a true MCP problem
Allowed shell or Python checks:
opencode mcp list --print-logspython C:\\ProgramData\\Ableton\\Live 12 Suite\\Resources\\MIDI Remote Scripts\\mcp_wrapper.pyGet-Content C:\\Users\\ren\\AppData\\Roaming\\Ableton\\Live 12.0.15\\Preferences\\Log.txt -Tail 200
This fallback path is for diagnosis and recovery, not for replacing song generation logic permanently.
3.2 For full-song creation, prefer async by default
For a complete song request, the default tool must be:
ableton-mcp-ai_generate_song_async
Do not start with generate_song unless there is a strong reason to keep the call synchronous.
Reason:
- full-song generation can legitimately take time
- async is the correct contract for long-running jobs
- retrying sync generation creates duplicate or misleading states
3.3 Timeout does not equal failure
If generate_song_async or generate_song times out:
- do not immediately retry generation
- do not claim the run failed
- do not spawn a second generation blindly
Instead, OpenCode must verify state first.
3.4 Never close a generation turn without validation
After generation, OpenCode must always run:
ableton-mcp-ai_validate_setableton-mcp-ai_diagnose_generated_setableton-mcp-ai_get_generation_manifest
If these are missing, the report is incomplete.
4. Approved Workflow
This is the exact workflow OpenCode must follow.
There are two approved modes:
MCP-firstPython/shell recovery
4.1 Preflight
Before generating:
- call
ableton-mcp-ai_get_session_info - call
ableton-mcp-ai_get_tracks - confirm Live is reachable
- confirm there is no confusion about the active set state
Minimum output OpenCode should understand from preflight:
- tempo
- track count
- whether the session is empty or already populated
4.1.b Python or shell recovery preflight
If the client UI cannot access the MCP tools directly, OpenCode must verify local truth with shell or Python before giving up.
Minimum recovery checks:
opencode mcp list --print-logs- inspect:
C:\\Users\\ren\\.config\\opencode\\opencode.jsonC:\\ProgramData\\Ableton\\Live 12 Suite\\Resources\\MIDI Remote Scripts\\opencode.json
- verify wrapper path:
C:\\ProgramData\\Ableton\\Live 12 Suite\\Resources\\MIDI Remote Scripts\\mcp_wrapper.py
- inspect Ableton log:
C:\\Users\\ren\\AppData\\Roaming\\Ableton\\Live 12.0.15\\Preferences\\Log.txt
If those checks show the MCP is healthy, OpenCode must return to MCP generation, not drift into passive analysis.
4.2 Full-song generation
For "make me a song", use:
ableton-mcp-ai_generate_song_async
Typical parameters:
genrestylereference_pathbpmkeystructure
Example shape:
- genre:
reggaeton - style:
perreo duro vieja escuela tipo safaera - reference_path:
libreria\\reggaeton\\ejemplo.mp3 - bpm:
95 - key:
Am
4.3 Job follow-up
If async returns a job_id, OpenCode must poll with:
ableton-mcp-ai_get_generation_job_status
Poll sparingly and read the state:
queuedrunningcompletedfailedcancelled
Do not interpret running as failure.
4.4 If the async call itself times out
This is the recovery order:
- re-check
ableton-mcp-ai_get_session_info - re-check
ableton-mcp-ai_get_tracks - call
ableton-mcp-ai_get_generation_history - inspect whether a new run appeared or the set changed
- only retry generation if there is clear evidence that nothing started
OpenCode must not create duplicate jobs because it panicked on timeout.
4.5 Validation
After a generation completes, OpenCode must run:
ableton-mcp-ai_validate_setableton-mcp-ai_diagnose_generated_setableton-mcp-ai_get_generation_manifest
OpenCode must report:
- the new
session_id generation_mode- whether the arrangement contains real material
- whether the result is usable or still weak
4.6 Python or shell diagnosis is allowed after generation, but it is not the source of truth
Allowed post-run shell checks:
- inspect
generation_manifests.json - inspect
generation_jobs.json - inspect Ableton
Log.txt
But final truth still comes from:
- MCP validation tools
- persisted manifest truth
- the actual Arrangement state
5. Approved Edit Workflow
If the user wants to edit what already exists, OpenCode must not regenerate immediately.
Start with inspection:
ableton-mcp-ai_get_session_infoableton-mcp-ai_get_tracksableton-mcp-ai_get_track_infoon the important tracks
Then use the edit tools that already exist instead of rewriting the whole set:
ableton-mcp-ai_set_track_nameableton-mcp-ai_set_track_volumeableton-mcp-ai_apply_clip_fadesableton-mcp-ai_write_volume_automationableton-mcp-ai_apply_sidechain_pumpableton-mcp-ai_arrange_song_structureableton-mcp-ai_set_loop_markers
OpenCode must understand this distinction:
- if the user asks for refinement, edit first
- if the user asks for a new song, generate first
If MCP is temporarily unavailable at the client layer, OpenCode may use Python or shell to inspect manifests, jobs and logs before resuming the edit workflow.
6. Anti-Patterns That Are No Longer Allowed
6.1 Bad pattern: think forever, call nothing
Wrong:
- long reasoning
- no MCP tools
- no song
Correct:
- preflight
- generation
- validation
6.2 Bad pattern: sync timeout then async timeout then surrender
Wrong:
- call
generate_song - get timeout
- call
generate_song_async - get timeout
- declare MCP broken
Correct:
- use
generate_song_asyncfirst - if timeout happens, inspect state
- then decide whether a retry is actually necessary
6.3 Bad pattern: report success from logs alone
Wrong:
- "generation completed"
without:
validate_setdiagnose_generated_setget_generation_manifest
Correct:
- only claim success when runtime validation agrees
6.4 Bad pattern: use code-review mode for a song request
If the user asked for a song, OpenCode must not spend the turn mainly reading Python files.
Only debug code when:
- generation tools genuinely fail
- or the user explicitly asks for debugging/review
6.5 Bad pattern: use Python or Bash as an excuse to avoid MCP
Wrong:
- inspect logs
- inspect config
- inspect python files
- never generate
Correct:
- use Python or Bash only to restore or verify MCP
- return to MCP tools as soon as they are available
7. Product Rules Still Active
OpenCode must preserve these project requirements while generating:
- final result must live in Arrangement View
- no automatic vocal tracks
- user library must remain part of the musical identity
- harmonic support must stay present across the song
- do not solve variation with silence and holes
- do not claim success if the song still feels like one good 4-second loop plus empty space
- no pianos
- no piano audio loops
- no
HARMONY_PIANO_MIDI - no piano-roll strategy based on piano timbre
OpenCode must also remember:
- harmonic support is still required
- but it must be implemented with non-piano timbres
- use pluck, synth, keys-like non-piano textures, pads or other coherent harmonic roles from the library
- do not reinterpret "harmony" as permission to add piano
This rule is absolute for this sprint:
- if OpenCode adds piano, it failed the requirement
8. Minimum Report Format For OpenCode
Every song-generation answer must include:
- which MCP tools were used
- whether generation was sync or async
- session id
- validation result
- diagnosis result
- short honest statement of whether the song is actually usable
If any of those are missing, the result is below standard.
The report must also state explicitly:
- whether MCP-first was used
- whether Python or shell recovery was needed
- whether any piano asset or piano MIDI role was used
If piano appears, the report must mark that as a failure.
9. What OpenCode Must Do Next
On the next real song request, OpenCode must:
- use MCP immediately
- use
generate_song_asyncas the default full-song path - handle timeout by inspecting state, not panicking
- validate the result every time
- report the actual session truth, not assumptions
- avoid all piano material
- use Python or Bash only as a recovery or verification path, not as a substitute for MCP song generation
This sprint is complete only when OpenCode behaves like an operator of the system, not a spectator of the system.