Skip to content

BACK-572 - Clear task dependencies through the CLI - #840

Open
MrLesk wants to merge 1 commit into
mainfrom
tasks/back-572-clear-dependencies
Open

BACK-572 - Clear task dependencies through the CLI#840
MrLesk wants to merge 1 commit into
mainfrom
tasks/back-572-clear-dependencies

Conversation

@MrLesk

@MrLesk MrLesk commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • add task edit --clear-deps to remove all task dependencies
  • reject empty dependency flag values and conflicting clear/set input to prevent false-success edits
  • add CLI regression coverage for clearing, validation, and help output

Fixes #839.

Validation

  • bun test src/test/cli-dependency.test.ts
  • bunx tsc --noEmit
  • bun run check .
  • bun test (1880 passed, 5 skipped)

@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: 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".

Comment thread src/cli.ts
createMultiValueAccumulator(),
)
.option("--clear-final-summary", "remove final summary")
.option("--clear-deps", "remove all task dependencies (cannot combine with --depends-on or --dep)")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Comment thread src/cli.ts
return;
}
const dependencyValues = combinedDependencies.length > 0 ? normalizeDependencies(combinedDependencies) : undefined;
if (combinedDependencies.length > 0 && dependencyValues?.length === 0) {

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 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) ?? [];

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 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 👍 / 👎.

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.

[Bug]: task edit cannot clear dependencies — empty --dep is a silent no-op that reports success

1 participant