fix(connectors): accepting a connector writes an empty tool list, not NULL
Since the MCP migration made accepted.tools NOT NULL, the connector and secret engine accept path never set it, so re-accepting any connector failed with a not-null violation.
This commit is contained in:
1 file changed
+4
@@ -3,6 +3,7 @@ package connectors
|
||||
import (
|
||||
"cmp"
|
||||
"context"
|
||||
"encoding/json/jsontext"
|
||||
json "encoding/json/v2"
|
||||
"errors"
|
||||
"fmt"
|
||||
@@ -230,6 +231,9 @@ func (m *Module) acceptAs(w http.ResponseWriter, r *http.Request, contract strin
|
||||
a := store.Accepted{
|
||||
OrgID: m.orgID, Name: name, Path: req.Path, SHA256: req.SHA256,
|
||||
Egress: req.Egress, Env: req.Env, Settings: settings, Contract: contract, Credentials: slots,
|
||||
// Only an MCP server declares its tools at acceptance; the column
|
||||
// holds a list either way.
|
||||
Tools: jsontext.Value(`[]`),
|
||||
}
|
||||
if err := m.store.Upsert(r.Context(), a); err != nil {
|
||||
httpjson.Error(w, http.StatusInternalServerError, err.Error())
|
||||
|
||||
Reference in new issue
Block a user