Skip to content

fix(opencode-subagent): pass global through forDeletion#1645

Closed
Chen17-sq wants to merge 1 commit into
dyoshikawa:mainfrom
Chen17-sq:fix/1639-opencode-subagent-fordeletion-global
Closed

fix(opencode-subagent): pass global through forDeletion#1645
Chen17-sq wants to merge 1 commit into
dyoshikawa:mainfrom
Chen17-sq:fix/1639-opencode-subagent-fordeletion-global

Conversation

@Chen17-sq
Copy link
Copy Markdown

Summary

Addresses follow-up item 2 from #1639.

SubagentsProcessor.loadToolFiles({ forDeletion: true }) builds deletion placeholders via:

factory.class.forDeletion({
  outputRoot: this.outputRoot,
  relativeDirPath: paths.relativeDirPath,
  relativeFilePath: basename(path),
  global: this.global,
});

KiloSubagent.forDeletion already destructures global and forwards it to the constructor (PR #1635). OpenCodeSubagent.forDeletion did not, so the flag was silently dropped and the resulting placeholder always defaulted to global: false. This patch mirrors the kilo precedent — destructure global = false from the params, forward it on the constructor call.

No behavior change for project-scope deletions (which were always the default anyway). Removes the inconsistency between the two opencode-style classes called out in #1639.

Test plan

  • pnpm cicheck (fmt + oxlint + eslint + tsgo + 5550 vitest + cspell + secretlint) passes locally on Node 22.
  • Diff is a single file, two added lines, mirroring the kilo fix at the same call site shape — low risk.

Refs #1639 (item 2 of 2 — the KiloSubagent.validate() schema-override item is out of scope here).

subagents-processor.ts calls forDeletion with global: this.global, but OpenCodeSubagent.forDeletion did not destructure it, so the flag was silently dropped and the constructed placeholder always defaulted to global: false.

Mirror the fix already applied to KiloSubagent.forDeletion in PR dyoshikawa#1635 — destructure global from the params and forward it to the constructor. No behavior change for project-scope deletion; closes the second follow-up item tracked in dyoshikawa#1639.
@github-actions
Copy link
Copy Markdown
Contributor

Thank you for your contribution! Unfortunately, you currently have 3 open PRs (including this one), which exceeds the limit of 2 for external contributors.

Please wait for an existing PR to be reviewed/merged, or close one before opening a new one. See CONTRIBUTING.md for details.

@Chen17-sq
Copy link
Copy Markdown
Author

Closing this proactively — the github-actions bot flagged that I'm well over the 2-PR limit for external contributors documented in CONTRIBUTING.md. I opened these nine PRs in one batch without spotting that rule first, which was my mistake — sorry for the noise.

The patch in this PR is ready as-is (pnpm cicheck green, lint-staged green, pre-commit pnpm dev generate green) and stays small enough for a quick read; reopening is one click.

Keeping #1643 (refactor(utils): consolidate isPlainObject, addresses #1638) and #1644 (refactor(copilot-rule): reuse toPosixPath, addresses #1603) as my current two. I'll reopen this one — addressing #1639 item 2 — once a slot frees up.

@Chen17-sq Chen17-sq closed this May 16, 2026
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.

1 participant