Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[bug] mcp inject --dry-run can still save a config migration

Open Beginner friendly
#893 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
cli

Research direction

Start at src/mcp-cmd.ts:97 and inspect how mcp inject passes options to autoDetectInit; confirm the dry-run flag reaches the loader. Then update the LOAD_ONLY_COMMANDS regression tests using the fixture from #866, and verify that mcp inject --dry-run leaves config.yaml unchanged while the tests pass.

Written by the indexing model from the issue text.

Description

bug help wanted

Description

teamai mcp inject --dry-run can still write config: it loads the scope without { dryRun }, so a pending legacy role migration (or a partition rename, or a self-mode bootstrap) is saved even though nothing should change.

 mcpInject(options)                                   src/mcp-cmd.ts:97
-  autoDetectInit()                                   loads with LoadOptions = {}  → migrations persist
+  autoDetectInit(undefined, { dryRun: options.dryRun })
   reconcileMcpForConfig(…, { dryRun })               already honours it

#866 threaded { dryRun } through the loaders pull, push, status and list use; mcp inject was left out. mcp list (:27) is read-only and could load with dryRun: true unconditionally, as #866 does for status and list.

Expected: mcp inject --dry-run writes nothing, config included.

Proposed fix: the diff above, plus a ['mcp inject --dry-run', …] row in the LOAD_ONLY_COMMANDS table the #866 tests use, so the regression is pinned.

Reproduction

  1. A user scope whose config.yaml is due for the legacy role migration (the fixture #866's tests use).
  2. teamai mcp inject --dry-run.
  3. config.yaml has been rewritten.

Environment

  • OS: macOS 27.0
  • Node.js: v24.21.0
  • teamai: main at b3b3a0b0
  • Provider: any
  • AI tool(s): any

Logs

Where it was found

Found while merging main (#866) into #880, which threads { dryRun } through the env commands and env exec the same way (with tests). Evidence here is from reading the code on main; not reproduced with the CLI.

Dominant language
TypeScript
Stars
5k
Forks
376
Avg merge
13h 21m
Merged PRs (30d)
288

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Tencent/teamai-cli

All issues in Tencent/teamai-cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.