fix: pass context correctly to fixDependenciesCommand to prevent tag data loss#1695
fix: pass context correctly to fixDependenciesCommand to prevent tag data loss#1695octo-patch wants to merge 1 commit into
Conversation
…data loss (fixes eyaltoledano#1636) The fixDependenciesDirect MCP wrapper was passing { projectRoot, tag } directly as options, but fixDependenciesCommand expects these under a context key: { context: { projectRoot, tag } }. Without this fix, context.projectRoot was always undefined, causing writeJSON to skip the tag-merging logic and overwrite tasks.json with only the resolved tag's tasks — wiping all other tags from the file. Co-Authored-By: Octopus <liyuan851277048@icloud.com>
🦋 Changeset detectedLatest commit: 83cd9df The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR fixes a critical bug where the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Fixes #1636
Problem
The
fix_dependenciesMCP tool (andtask-master fix-dependenciesCLI) was silently wiping all tags except the resolved one fromtasks.jsonin multi-tag workspaces.Root cause:
fixDependenciesDirectwas passing{ projectRoot, tag }directly as options, butfixDependenciesCommanddestructures these from a nestedcontextkey:With
context.projectRootundefined,writeJSONskipped the tag-merging branch (which requiresprojectRoot) and wrote only the resolved tag's tasks directly, discarding all other tags.Solution
Wrap
projectRootandtagunder thecontextkey thatfixDependenciesCommandexpects:Testing
tasks.json— confirmed tags were wipedfix_dependenciesagainst a specific tagNote
Medium Risk
Touches the path that reads/writes
tasks.json; while the change is a small options-shape fix, mistakes here could still affect task data persistence across tags.Overview
Ensures the
fix_dependenciesMCP tool correctly scopes dependency repairs to the requested tag by passing{ context: { projectRoot, tag } }intofixDependenciesCommand, preventing other tags in multi-tagtasks.jsonfrom being wiped.Adds a patch changeset documenting the data-loss fix and expected behavior in multi-tag workspaces.
Reviewed by Cursor Bugbot for commit 83cd9df. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit