BACK-572 - Clear task dependencies through the CLI - #840
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3970291ae7
ℹ️ 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".
| createMultiValueAccumulator(), | ||
| ) | ||
| .option("--clear-final-summary", "remove final summary") | ||
| .option("--clear-deps", "remove all task dependencies (cannot combine with --depends-on or --dep)") |
There was a problem hiding this comment.
Treat --clear-deps as a direct edit flag
When this command runs in an interactive terminal with only --clear-deps, hasEditFieldFlags() does not recognize the new option, so the action enters the edit wizard instead of executing the dependency-clearing logic and leaves the dependencies unchanged. Include clearDeps in that predicate so the advertised CLI operation works in normal interactive shells.
AGENTS.md reference: AGENTS.md:L61-L65
Useful? React with 👍 / 👎.
| return; | ||
| } | ||
| const dependencyValues = combinedDependencies.length > 0 ? normalizeDependencies(combinedDependencies) : undefined; | ||
| if (combinedDependencies.length > 0 && dependencyValues?.length === 0) { |
There was a problem hiding this comment.
Reject every empty dependency flag occurrence
This condition rejects an empty value only when the entire combined dependency list normalizes to empty. For example, task edit 2 --depends-on "" --dep TASK-1 succeeds because the valid value keeps dependencyValues nonempty, even though one supplied dependency flag is empty; validate each raw occurrence before combining and normalizing it.
AGENTS.md reference: AGENTS.md:L61-L65
Useful? React with 👍 / 👎.
| if (dependencies) { | ||
| updateInput.dependencies = dependencies; | ||
| if (args.dependencies !== undefined) { | ||
| updateInput.dependencies = sanitizeStringArray(args.dependencies) ?? []; |
There was a problem hiding this comment.
Preserve dependencies for blank-only MCP arrays
When an MCP task_edit request supplies a nonempty but blank-only array such as dependencies: [" "], schema validation trims it to an empty string and this fallback converts it into an empty replacement, silently clearing every dependency. This previously produced no dependency update and differs from the established labels behavior, so distinguish an intentional empty array from a nonempty array whose entries sanitize away.
AGENTS.md reference: AGENTS.md:L63-L69
Useful? React with 👍 / 👎.
Summary
task edit --clear-depsto remove all task dependenciesFixes #839.
Validation
bun test src/test/cli-dependency.test.tsbunx tsc --noEmitbun run check .bun test(1880 passed, 5 skipped)