Repository navigation
[AI-3871] A connector's answer names its source kind #2464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kanat
merged 1 commit into
feature/ai-3669-http-connectors
from
connectors/http-source-kind
Nov 25, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| `createConnector` (`POST /v1/agents/connectors`) takes an HTTP API in place of an MCP server (AI-3676). `CustomConnectorRequest` has a new optional `http`, a `CustomHTTPAPI` `{base_url, tools}`. Each tool is a `CustomHTTPTool` `{name, description, method, path, parameters, read_only}`: `method` is one of `GET`, `HEAD`, `POST`, `PUT`, `PATCH` and `DELETE`, and `parameters` maps a name to a `CustomHTTPParameter` `{type, description, required}`, whose `type` is one of `string`, `number`, `integer` and `boolean`. `endpoint` is no longer required: a request sends a non-empty `endpoint` or `http`, not both. This breaks existing callers in four SDKs. In Go, `CustomConnectorRequest.Endpoint` is now a `*string` (`sdks/go/acceleration/generated.go`), and a caller that set it as a string now sets a pointer. In Rust, `CustomConnectorRequest.endpoint` is now an `Option<String>` (`sdks/rust/src/types.rs`), so a struct literal or a read of a `String` no longer compiles. In PHP (`sdks/php/src/Generated/CustomConnectorRequest.php`) and Python (`plugins/stream`, `_generated/models/custom_connector_request.py`), `endpoint` moves from the first constructor argument to after `schemes`, so a positional call no longer matches; named and keyword arguments still work. The `Connector` the router answers is unchanged, so it shows neither `base_url` nor the tools. Go, JavaScript, Python (`plugins/stream`), .NET, Ruby, Rust and PHP have the regenerated clients. Other SDKs need to update: a `connectors.create` resource method, where an SDK has one, takes `http` beside `endpoint`. Swift, Kotlin and Dart need nothing, since `createConnector` is not client-accessible. | ||
|
|
||
| The `Connector` the router answers now has `sources` (AI-3871), a list of `ConnectorSource` `{kind}` whose `kind` is `mcp` or `http`: a custom connector made from an `endpoint` reads `mcp`, one made from `http` reads `http`, and a built-in names its own. It never carries a URL, a path or a tool. This adds a required field to a response, so a client that builds a `Connector` itself, or compares one whole, must give it `sources`. In Go it is `[]ConnectorSource`, and the constants are `ConnectorSourceKindMCP` and `ConnectorSourceKindHTTP`. Go, JavaScript, Python (`plugins/stream`), .NET, Ruby, Rust and PHP have the regenerated clients; Swift, Kotlin and Dart generate nothing new. Other SDKs need to update: a resource method that returns a connector (`connectors.get`, `connectors.list`), where an SDK has one, exposes `sources`, so a caller can tell an http connector from an MCP one. | ||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| package api | ||
|
|
||
| import ( | ||
| "encoding/json" | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/suite" | ||
|
|
||
| "github.com/GetStream/Vision-Agents/acceleration/internal/connectors/core" | ||
| "github.com/GetStream/Vision-Agents/acceleration/internal/store" | ||
| ) | ||
|
|
||
| // ConnectorSourcesSuite covers the sources a Connector shows, without a store. | ||
| type ConnectorSourcesSuite struct { | ||
| suite.Suite | ||
| } | ||
|
|
||
| func TestConnectorSourcesSuite(t *testing.T) { | ||
| suite.Run(t, new(ConnectorSourcesSuite)) | ||
| } | ||
|
|
||
| // sourcesJSON is what a caller reads of the sources of a manifest with these source rules. | ||
| func (s *ConnectorSourcesSuite) sourcesJSON(rules ...core.SourceRule) string { | ||
| shown := connectorOf(store.ConnectorDefinition{Manifest: core.Manifest{Sources: rules}}, "") | ||
| raw, err := json.Marshal(shown) | ||
| s.Require().NoError(err) | ||
| var decoded struct { | ||
| Sources json.RawMessage `json:"sources"` | ||
| } | ||
| s.Require().NoError(json.Unmarshal(raw, &decoded)) | ||
| return string(decoded.Sources) | ||
| } | ||
|
|
||
| // Defect: one entry per kind rather than per source, or the order lost, so a connector with an | ||
| // http source beside its mcp one reads as only one of them. | ||
| func (s *ConnectorSourcesSuite) TestEverySourceIsShownByItsKindInTheManifestsOrder() { | ||
| s.JSONEq(`[{"kind":"mcp"},{"kind":"http"}]`, s.sourcesJSON( | ||
| core.SourceRule{Kind: core.SourceKindMCP, Endpoint: "mcp"}, core.SourceRule{Kind: core.SourceKindHTTP, Endpoint: "http"})) | ||
| s.JSONEq(`[{"kind":"http"},{"kind":"mcp"}]`, s.sourcesJSON( | ||
| core.SourceRule{Kind: core.SourceKindHTTP, Endpoint: "http"}, core.SourceRule{Kind: core.SourceKindMCP, Endpoint: "mcp"})) | ||
| } | ||
|
|
||
| // Defect: a connector with no source answering null, which a client reads as absent. | ||
| func (s *ConnectorSourcesSuite) TestAConnectorWithNoSourceShowsAnEmptyList() { | ||
| s.Equal(`[]`, s.sourcesJSON()) | ||
| } | ||
|
|
||
| // Defect: a source's endpoint, headers or tools copied into the answer with its kind. | ||
| func (s *ConnectorSourcesSuite) TestASourceShowsNothingButItsKind() { | ||
| rule := core.SourceRule{ | ||
| Kind: core.SourceKindHTTP, Endpoint: "http", Headers: map[string]string{"X-Team": "secret-team"}, | ||
| Tools: []core.ToolRule{{Name: "scoped", NeedsScopes: []string{"s"}}}, | ||
| HTTPTools: []core.HTTPTool{{Name: "get_forecast", Method: "GET", Path: "/v1/forecast"}}, | ||
| } | ||
| s.JSONEq(`[{"kind":"http"}]`, s.sourcesJSON(rule)) | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Nit] R1.1 This paragraph is another change (AI-3871) appended to AI-3676's note, but
notes/README.mdasks for one file per change, and the first paragraph above still says "TheConnectorthe router answers is unchanged". Move it to its own file, e.g.2026-11-25-ai-3871.md. An SDK update picks up either (it diffs the notes tree), so this does not block.