Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .claude/skills/sdk/notes/2026-11-24-ai-3676.md
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
`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.
`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 by this change, so it shows neither `base_url` nor the tools; AI-3871 gives it `sources` (`2026-11-25-ai-3871.md`). 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.
1 change: 1 addition & 0 deletions .claude/skills/sdk/notes/2026-11-25-ai-3871.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
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.
61 changes: 61 additions & 0 deletions acceleration/internal/api/child_agents_sensitive_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ package api

import (
"encoding/json"
"maps"
"net/http"
"strconv"
"strings"

"github.com/GetStream/Vision-Agents/acceleration/internal/connectors/core"
httpsource "github.com/GetStream/Vision-Agents/acceleration/internal/connectors/sources/http"
"github.com/GetStream/Vision-Agents/acceleration/internal/harness"
"github.com/GetStream/Vision-Agents/acceleration/internal/store"
)
Expand Down Expand Up @@ -126,6 +129,44 @@ func (s *ChildAgentsSuite) TestADelegationRunsBesideASensitiveChildTheParentDoes
s.Contains(run.FinalText, "tool: be brief")
}

// An http tool that only reads at the latest revision reads only for a grant that pins that
// revision's digest: a session opens it at the digest its grant pins, or pins one on first use.
// Beside a sensitive connector, in the parent or in a child, a delegation so runs for the pinned
// grant and is refused for a grant that pins no digest or another one (AI-3675).
func (s *ChildAgentsSuite) TestADelegationJudgesAnHTTPToolReadOnlyOnlyAtTheDigestItsGrantPins() {
s.useInternalApp()
id, digest := s.readOnlyHTTPConnector()
for name, c := range map[string]struct {
grant store.ToolGrant
refused bool
}{
"pinned": {store.ToolGrant{Name: "get", SchemaDigest: digest}, false},
"pinned nothing": {store.ToolGrant{Name: "get"}, true},
"pinned another": {store.ToolGrant{Name: "get", SchemaDigest: strings.Repeat("0", len(digest))}, true},
} {
api := store.ConnectorBinding{Name: "api", ConnectorID: id, Connection: store.ConnectionBinding{Type: "session"},
Tools: []store.ToolGrant{c.grant}}
nessy := store.ConnectorBinding{Name: "customers", ConnectorID: "nessy", Connection: store.ConnectionBinding{Type: "session"},
Tools: []store.ToolGrant{{Name: "org_lookup"}}}
for layout, bindings := range map[string][2]store.ConnectorBinding{"sensitive parent": {nessy, api}, "sensitive child": {api, nessy}} {
parent := s.agentWith("fanning/fanning-model", nil)
child := s.agentWith("echo/echo-model", nil)
s.delegate(parent, map[string]AgentConfig{"ask_a": child})
s.change(parent.Id, func(config *store.AgentConfig) { config.Connectors = []store.ConnectorBinding{bindings[0]} })
s.change(child.Id, func(config *store.AgentConfig) { config.Connectors = []store.ConnectorBinding{bindings[1]} })

run := s.run(CreateRunRequest{ConfigId: parent.Id, Input: "review this"})

if c.refused {
s.refusedAll(run)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Nit] R1.1 refusedAll has fixed messages, so a failing refused case does not say which of the 4 refused cases (grant x layout) broke: under the SendsOutTool mutant the output is four identical the graph breaks the rule whichever child is called lines, while the run case names name+", "+layout. Wrapping the loop body in s.Run(name+", "+layout, ...) would name it. Ticket, not a blocker; map loops are the norm in this package (ConfigsSuite.TestAnHTTPToolReadsOnlyAtTheDigestItsGrantPins does the same).

} else {
s.NotContains(run.FinalText, "was not run", name+", "+layout)
s.Contains(run.FinalText, "tool: be brief", name+", "+layout)
}
}
}
}

// TestADelegationWithNoSensitiveConnectorRuns is the control: on the base, dca845c2e, the
// same graph answered the same (author-1.md, «Control probe»).
func (s *ChildAgentsSuite) TestADelegationWithNoSensitiveConnectorRuns() {
Expand Down Expand Up @@ -195,3 +236,23 @@ func (s *ChildAgentsSuite) refusedAll(run Run) {
s.NotContains(run.FinalText, name, "the tool error names nothing of a server-side config")
}
}

// readOnlyHTTPConnector is a custom connector whose latest revision has one http tool, get, a
// read-only GET, and the digest a grant pins to open it as listed there. Its manifest is
// linear.yaml's with an http source in place of its mcp one (as in ConfigsSuite).
func (s *ChildAgentsSuite) readOnlyHTTPConnector() (string, string) {
ctx := s.T().Context()
linear, err := s.store.ConnectorDefinitions.Latest(ctx, s.customerID(), "linear")
s.Require().NoError(err)
tool := core.HTTPTool{Name: "get", Description: "Reads the API.", Method: http.MethodGet, Path: "/get", ReadOnly: true}
manifest := linear.Manifest
manifest.ID = "custom_t" + strings.ReplaceAll(s.utils.uuid(), "-", "")
manifest.Endpoints = maps.Clone(manifest.Endpoints)
manifest.Endpoints[core.SourceKindHTTP] = "https://8.8.8.8/api"
manifest.Sources = []core.SourceRule{{Kind: core.SourceKindHTTP, Endpoint: core.SourceKindHTTP, HTTPTools: []core.HTTPTool{tool}}}
_, err = s.store.ConnectorDefinitions.Revise(ctx, s.customerID(), manifest)
s.Require().NoError(err)
digest, err := httpsource.ToolSchemaDigest(tool)
s.Require().NoError(err)
return manifest.ID, digest
}
Loading