Skip to content

fix: keep a config.json MCP client's stored id when its block declares another client's - #9131

Open
Pratham-Mishra04 wants to merge 1 commit into
10-26-feat_let_a_deployment_gate_the_per-user_oauth_and_headers_sweepsfrom
10-26-fix_keep_a_config.json_mcp_client_s_stored_id_when_its_block_declares_another_client_s
Open

Pratham-Mishra04 wants to merge 1 commit into
10-26-feat_let_a_deployment_gate_the_per-user_oauth_and_headers_sweepsfrom
10-26-fix_keep_a_config.json_mcp_client_s_stored_id_when_its_block_declares_another_client_s

Conversation

@Pratham-Mishra04

Copy link
Copy Markdown
Collaborator

Summary

Briefly explain the purpose of this PR and the problem it solves.

Changes

  • What was changed and why
  • Any notable design decisions or trade-offs

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

Describe the steps to validate this change. Include commands and expected outcomes.

# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

If adding new configs or environment variables, document them here.

Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

Breaking changes

  • Yes
  • No

If yes, describe impact and migration instructions.

Related issues

Link related issues and discussions. Example: Closes #123

Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 7c61a8e and 96626a4.

Files selected for processing: 1
  • transports/bifrost-http/lib/config.go

Limit details: You’ve used all 8 included reviews currently available.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • When loading MCP client configuration, a client matched by name retains the ID of the stored client, even if the configuration file specifies a different ID.
    • A file-declared client without a matching stored client receives a generated ID when its configured ID is empty.
    • In configuration-file source-of-truth mode, clients not declared in the file are removed from the active configuration, including when a declared client’s ID conflicts with another stored client.

The MCP config loader now uses the stored ID for a matched client. It warns when the file declares a different non-empty ID. A SQLite-backed regression test checks the retained ID and pruning of another stored client.

Changes: MCP config ID matching

Layer / File(s) Summary
Preserve the stored ID for name matches
transports/bifrost-http/lib/config.go, transports/bifrost-http/lib/config_test.go
For a matched client, the loader uses the stored ID and warns if the file declares a different non-empty ID. The regression test checks that the name-matched client retains its stored ID and that the other stored client is pruned.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: Moderate · up to 96626

Some configurations can lose an MCP client at startup. Resolve the ID collision before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description contains only the repository template and placeholder text. It does not explain the bug, implementation, affected area, testing performed, breaking changes, security considerations, or… Replace the placeholders with completed content. Describe the stored-ID fix, list the changed HTTP transport area, identify the change as a bug fix, document test commands and results such as the relevant Go tests, state whether the change …
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving the stored MCP client ID when config.json declares another client ID.
Linked Issues check Passed The only directly linked issue, #123 ("Files API Support"), is closed and completed. It supplies background only. No active directly linked target remains, so no linked-issue coding requirements apply…
Out of Scope Changes check Passed The whole-PR diff (merge base to reviewed head) has two files. transports/bifrost-http/lib/config.go changes only the ID-assignment block in syncMCPConfigFromFile. The change keeps the stored ID for a…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

The only directly linked issue, #123 ("Files API Support"), is closed and completed. It supplies background only. No active directly linked target remains, so no linked-issue coding requirements apply. The PR objective is a PR-level fix: a config.json MCP client keeps its stored ID when its block declares another client's ID. That objective is not an issue requirement. The whole-PR diff in transports/bifrost-http/lib/config.go implements the fix. A name-matched client with a stored non-empty ID now takes that stored ID. A conflicting declared ID triggers a warning. A UUID is generated only when no match exists and the declared ID is empty.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff (merge base to reviewed head) has two files. transports/bifrost-http/lib/config.go changes only the ID-assignment block in syncMCPConfigFromFile. The change keeps the stored ID for a name-matched client and adds a warning for a conflicting declared ID. transports/bifrost-http/lib/config_test.go adds one regression test, TestLoadMCPConfig_ConfigJSONKeepsTheStoredIDOfANameMatch. The test loads alpha and beta, then reloads with a block named alpha that declares beta's ID. It asserts that the runtime client keeps id-alpha and its URL, and that id-beta is pruned. The test directly exercises the config.go change. No unrelated change is found in either file.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Full details: Description check

Explanation

The description contains only the repository template and placeholder text. It does not explain the bug, implementation, affected area, testing performed, breaking changes, security considerations, or checklist status.

Resolution

Replace the placeholders with completed content. Describe the stored-ID fix, list the changed HTTP transport area, identify the change as a bug fix, document test commands and results such as the relevant Go tests, state whether the change is breaking, address security considerations, and complete the checklist or mark items accurately.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

Note

This review was completed with usage-based billing: files reviewed beyond your plan's included limits are billed at $0.25/file. View usage-based billing.

Pratham-Mishra04 commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps

greptile-apps Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Reviews (4) · Last reviewed commit: "fix: keep a config.json MCP client's sto..." · Reviewed by Greptile

@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-26-feat_let_a_deployment_gate_the_per-user_oauth_and_headers_sweeps branch from 4de19bd to be8b33b Compare October 31, 2026 11:33
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-26-fix_keep_a_config.json_mcp_client_s_stored_id_when_its_block_declares_another_client_s branch from aefd7ea to 88bc868 Compare October 31, 2026 11:33
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-26-fix_keep_a_config.json_mcp_client_s_stored_id_when_its_block_declares_another_client_s branch from 88bc868 to f4e4cf6 Compare October 31, 2026 14:59
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-26-feat_let_a_deployment_gate_the_per-user_oauth_and_headers_sweeps branch from be8b33b to be6cdae Compare October 31, 2026 14:59
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-26-fix_keep_a_config.json_mcp_client_s_stored_id_when_its_block_declares_another_client_s branch from f4e4cf6 to ddb028c Compare November 1, 2026 11:05
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-26-feat_let_a_deployment_gate_the_per-user_oauth_and_headers_sweeps branch from be6cdae to 7ed130d Compare November 1, 2026 11:05
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-26-fix_keep_a_config.json_mcp_client_s_stored_id_when_its_block_declares_another_client_s branch from ddb028c to 7c61a8e Compare November 1, 2026 18:11
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-26-feat_let_a_deployment_gate_the_per-user_oauth_and_headers_sweeps branch from 7ed130d to 29821e8 Compare November 1, 2026 18:11
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-26-feat_let_a_deployment_gate_the_per-user_oauth_and_headers_sweeps branch from 29821e8 to 80d69fe Compare November 1, 2026 19:13
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 10-26-fix_keep_a_config.json_mcp_client_s_stored_id_when_its_block_declares_another_client_s branch from 7c61a8e to 96626a4 Compare November 1, 2026 19:13

This branch is waiting to be deployed

1 waiting deployment
pr-testing — 96626a48 Waiting Nov 1, 2026 by Pratham-Mishra04 via dependency-review #42117
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