Repository navigation
Conversation
…iteral alias
Two coordinated additions make a shared connector bound by its PLAIN name usable
for non-owner viewers:
* service.list_active_mcp_server_names + custom_harness_configs authorise and
materialise the plain name (own servers win it; the mangled key always stays).
* custom_mcp.expand_custom_instances (shared_view) emits the plain alias next
to the mangled key so it appears in listInstances and stays selectable in the
chat composer. Without the UI half, resolveInitialConnectors drops the agent's
literal binding from the allowed set and MCPToolMiddleware strips every tool.
Independent of the per-user identity-template feature; this only concerns shared-
connector name visibility. Adds unit tests for both surfaces.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Make a shared MCP connector usable when referenced by its plain (literal) name
by a non-owner viewer, instead of only by the internal mangled key
custom__<parentInstanceId>__<serverName>.Two coordinated, minimal additions (one commit):
Runtime / authorization (
service.py):ConnectorService.list_active_mcp_server_namesadditionally yields the literalserver name for a shared server (next to the mangled key).
ConnectorService.custom_harness_configsmaterializes the harness spec under theliteral name too.
(
if name not in names/configs); the mangled key is always kept, so existingbindings that persist the mangled key keep working unchanged.
UI / list surface (
custom_mcp.py):expand_custom_instances(shared_view=True)emits, right after each mangled entry,an extra alias entry with the same
instance_idbutmcp_server_name = <plain name>,so the plain name appears in
listInstancesand stays selectable in the chat composer.Why
Before this change, a shared parent row only surfaced the mangled key to viewers.
Binding an assistant to the plain name therefore:
merge_turn_mcp_serversat runtime (the plain name wasn't inthe authorized set), and
service.py-only half left the composer broken:listInstances(
expand_custom_instances(shared_view=True)) still returned only the mangled key, so thefront-end
resolveInitialConnectorsallowed-set lacked the plain name, dropped the agent'splain-name binding from the turn, and
MCPToolMiddlewarestripped every MCP tool(observed as
filter: mcp=28 -> 0).Net effect: a shared connector could not be maintained/bound by plain name from the UI at all.
This PR closes that gap symmetrically across both surfaces (authorization + list).
Independence
This is split out of #1845 (per-user identity injection into connector url/headers). It does
not depend on or touch
${octop.*}placeholders; it concerns shared-connector namevisibility only. #1845 remains orthogonal.
Tests
Adds unit tests for both surfaces (
tests/unit/connectors/test_custom_mcp.py):expand_custom_instances(shared_view=True)yields the literal alias next to the mangled key.Full CI-equivalent gate run on the resulting image (toolchain pinned to repo lockfile):
ruff check src tests/ruff format --check src tests: cleanmypy src/octop: no issuespytest tests/unit/connectors: all pass (incl. the new alias cases)MISS/ patchedHITfor both symbolsNotes / limits
listInstancesnow returns two rows for the same shared server (mangled + literal) with anidentical
display_name; the composer distinguishes them bymcp_server_name(valuesdiffer). A cosmetic duplicate label; runtime authorization/materialisation stays keyed on the
literal name to match
list_active_mcp_server_names.