Remove remote instance proxy handling from handlers

This commit is contained in:
2025-10-25 14:07:11 +02:00
parent 6a973fae2d
commit ff719f3ef9
6 changed files with 13 additions and 167 deletions

View File

@@ -188,14 +188,6 @@ func (i *Instance) GetProxy() (*httputil.ReverseProxy, error) {
return nil, fmt.Errorf("instance %s has no proxy component", i.Name)
}
// Remote instances should not use local proxy - they are handled by RemoteInstanceProxy
opts := i.GetOptions()
if opts != nil && len(opts.Nodes) > 0 {
if _, isLocal := opts.Nodes[i.localNodeName]; !isLocal {
return nil, fmt.Errorf("instance %s is a remote instance and should not use local proxy", i.Name)
}
}
return i.proxy.get()
}

View File

@@ -577,7 +577,9 @@ func TestRemoteInstanceOperations(t *testing.T) {
LlamaCpp: config.BackendSettings{Command: "llama-server"},
},
Instances: config.InstancesConfig{LogsDir: "/tmp/test"},
Nodes: map[string]config.NodeConfig{},
Nodes: map[string]config.NodeConfig{
"remote-node": {Address: "http://remote-node:8080"},
},
LocalNode: "main",
}
options := &instance.Options{
@@ -612,8 +614,8 @@ func TestRemoteInstanceOperations(t *testing.T) {
}
// GetProxy should fail for remote instance
if _, err := inst.GetProxy(); err == nil {
t.Error("Expected error when getting proxy for remote instance")
if _, err := inst.GetProxy(); err != nil {
t.Error("Expected no error when getting proxy for remote instance")
}
// GetLogs should fail for remote instance