Skip to content

Conversation

@paoloricciuti
Copy link
Contributor

This makes so that when using the command mcp add the config will actually be updated (asking the user if he want's to add it globally or locally).

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

@github-actions
Copy link
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@rekram1-node
Copy link
Collaborator

/review


let text = "{}"
if (await file.exists()) {
text = await file.text()
Copy link
Contributor

Choose a reason for hiding this comment

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

Style suggestion: The let text with conditional reassignment could be simplified using a ternary or IIFE. Something like:

const text = await file.exists() ? await file.text() : "{}"

This is a minor suggestion - the current code is fine if you prefer the explicit check.


// Resolve config paths eagerly for hints
const [projectConfigPath, globalConfigPath] = await Promise.all([
resolveConfigPath(Instance.worktree),
Copy link
Contributor

Choose a reason for hiding this comment

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

Style suggestion: The let configPath with conditional reassignment is a pattern the style guide discourages. Consider using a ternary or restructuring:

const configPath = project.vcs === "git" 
  ? await (async () => {
      const result = await prompts.select({...})
      if (prompts.isCancel(result)) throw new UI.CancelledError()
      return result
    })()
  : globalConfigPath

However, given the interactive prompt flow and the need to throw on cancel, the current approach may actually be the clearest. Your call on whether to change it.

@rekram1-node rekram1-node merged commit 498a4ab into anomalyco:dev Jan 13, 2026
3 checks passed
sauerdaniel pushed a commit to sauerdaniel/opencode that referenced this pull request Jan 13, 2026
dl-alexandre pushed a commit to dl-alexandre/opencode that referenced this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants