Skip to content

Commit 30f2b11

Browse files
reyortiz3claude
andauthored
fix(registry-servers): tag registry installs with registry+server fields (#2292)
Registry-installed workloads currently send only req.image, which makes the API treat them as direct image installs. Policy gates that allow only registry-resolved servers then reject them — even when the image is the exact one listed in the registry — because workload_service's image-name lookup misses (the registry is keyed by server name, not image URL), and RegistryServerName/RegistryAPIURL come back empty on the RunConfig. Send registry: 'default' and server: server.name so the API takes the resolveRegistryServer path. The canonical registry entry name is kept separate from the user-editable workload name, which may diverge when the user renames the workload at install time or installs the same server twice into different groups. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 424cc24 commit 30f2b11

2 files changed

Lines changed: 37 additions & 0 deletions

File tree

renderer/src/features/registry-servers/lib/__tests__/orchestrate-run-registry-server.test.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ describe('prepareCreateWorkloadData', () => {
6767
target_port: 8080,
6868
network_isolation: false,
6969
volumes: [],
70+
registry: 'default',
71+
server: 'test-server',
7072
})
7173
})
7274

@@ -97,9 +99,35 @@ describe('prepareCreateWorkloadData', () => {
9799
target_port: 8080,
98100
network_isolation: false,
99101
volumes: [],
102+
registry: 'default',
103+
server: 'test-server',
100104
})
101105
})
102106

107+
it('tags the request with the registry source so the API runs the registry-resolution path', () => {
108+
const data: FormSchemaRegistryMcp = {
109+
proxy_mode: 'streamable-http',
110+
name: 'My Custom github',
111+
group: 'default',
112+
envVars: [],
113+
secrets: [],
114+
networkIsolation: false,
115+
allowedHosts: [],
116+
allowedPorts: [],
117+
volumes: [],
118+
}
119+
120+
const result = prepareCreateWorkloadData(SERVER, data)
121+
122+
// Workload name comes from the form (user-editable); registry entry name
123+
// comes from the canonical server metadata. They are deliberately distinct
124+
// so the API can resolve registry defaults even when the user renames the
125+
// workload at install time.
126+
expect(result.name).toBe('My Custom github')
127+
expect(result.registry).toBe('default')
128+
expect(result.server).toBe('test-server')
129+
})
130+
103131
it('handles empty cmd_arguments', () => {
104132
const data: FormSchemaRegistryMcp = {
105133
proxy_mode: 'streamable-http',

renderer/src/features/registry-servers/lib/orchestrate-run-registry-server.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,14 @@ export function prepareCreateWorkloadData(
5151
network_isolation: networkIsolation,
5252
permission_profile,
5353
volumes,
54+
// Tag the request as a registry install so the API records the source
55+
// registry on the workload. `name` is the workload name (user-editable
56+
// and may diverge from the registry entry name when the user installs
57+
// the same server twice into different groups), so the canonical
58+
// registry entry name from `server.name` is sent separately. Without
59+
// these fields the API treats the request as a direct image install
60+
// and policy gates that allow only registry servers reject it.
61+
registry: 'default',
62+
server: server.name,
5463
}
5564
}

0 commit comments

Comments
 (0)