Skip to content

[AI-3676] HTTP connectors: the API accepts http connectors - #2344

Merged
kanat merged 11 commits into
feature/ai-3669-http-connectorsfrom
connectors/http-api
Nov 25, 2026
Merged

kanat merged 11 commits into
feature/ai-3669-http-connectorsfrom
connectors/http-api

Conversation

@kanat

@kanat kanat commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Targets the feature branch feature/ai-3669-http-connectors, not main. Leaf 4 of 4 in the router for AI-3669 (the keystone): until it merges, no API stores an http connector.

Why

The CLI writes connectors/http/<name>.yaml (base_url + tools), and the router can run such tools since leaves 1-3 (#2316 manifest, #2324 call-time safety). POST /v1/agents/connectors took only an MCP endpoint, and AI-3674 made POST /v1/data/import refuse an http connector until this leaf. The AI-3674 reviews asked for two things: base_url is checked with egress.ValidatePublicHTTPSURL on create and on every new revision (S1.5), and import and create open at the same time with the same checks (R1.1).

How it works

POST /v1/agents/connectors  (CustomConnectorRequest)
├─ endpoint set == http set (both, or neither) -> 400 "exactly one of them"
├─ scheme not on this deployment              -> 400 (as before)
├─ http set
│  ├─ core.CheckBaseURL(base_url) fails: over 2048, not https://,
│  │  a {name}, or egress.ValidatePublicHTTPSURL refuses
│  │     -> 400 "base_url must be a public https URL
│  │             without userinfo, query or fragment"   (AC-7, one answer)
│  ├─ core.CustomManifest(base_url, tools) refuses
│  │     -> 400 core's reason, naming the tool          (AC-5)
│  └─ ok -> store revision (the same path as MCP)
└─ endpoint set: exactly as before                     (control test)

POST /v1/data/import  (importableDefinition)
├─ http source -> core.CheckBaseURL before AsCustom, the same message
│                 (AI-3674's refusal is gone)
└─ a change set: every definition checked before applyChanges'
   transaction opens, so no DNS lookup runs inside it

GET /v1/agents/connectors[/{id}]  (connectorOf, unchanged)
└─ copies fields by name: no base_url, no tools          (AC-1)

The request shape:

CustomConnectorRequest
├─ endpoint   string, now optional      MCP server
└─ http       CustomHTTPAPI, new        HTTP API
   ├─ base_url   string <= 2048
   └─ tools[]    CustomHTTPTool, 1 to 128
      ├─ name ^[A-Za-z0-9_-]{1,63}$, description <= 1000, path <= 2048
      ├─ method      GET|HEAD|POST|PUT|PATCH|DELETE
      ├─ read_only   only with GET or HEAD
      └─ parameters  {name: CustomHTTPParameter}, up to 64
                       type  string|number|integer|boolean
                       description <= 1000, required

The base_url is checked before the manifest's rules, so http://..., a {name} in it or one over 2048 gets the fixed message too (core would answer it in its own words), on create and on import alike. The schema carries core's caps and tool name pattern, and core holds them as well (a parameter's description and the base_url included), so an import, which has no request schema, stores nothing the API would refuse. Egress's own error never reaches the caller on create or import: it tells a name that does not resolve from a private one.

Changes

  • internal/api/connectors.go: http beside endpoint on CustomConnectorRequest (new CustomHTTPAPI, CustomHTTPTool, CustomHTTPParameter, each refusing unknown fields); customManifest checks exactly-one and the base_url, then builds through core.CustomManifest. createConnector is untouched, so [AI-3663] Keep the last synced hash for connectors and routers #2302 (ReviseSynced) merges beside it.
  • internal/connectors/core: CheckBaseURL, the one base_url check create and import share; Manifest.Validate caps a parameter's description (1000) and the http endpoint (2048).
  • internal/store/datamove.go: importableDefinition takes ctx and checks an http connector's base_url in place of AI-3674's refusal; importableRow checks a definition before importRow, and applyChanges runs it for the whole change set before its transaction.
  • The new enums name their constants (x-enum-varnames), so the Go SDK keeps Array, Boolean, Null, Number, Object and String; sdks/go/acceleration/enums_test.go pins them.
  • api/openapi.yaml and the Go, JS, Python, .NET, Ruby, Rust and PHP clients regenerated; Kotlin, Swift and Dart generate nothing new (createConnector is not client-accessible).
  • SDK note .claude/skills/sdk/notes/2026-11-24-ai-3676.md; connectors and add-connector skills name http; sources/http/AGENTS.md says who stores an http connector now.

Validation

Rule Test
AC-1: stored at revision 1 as the source's manifest; no answer shows base_url or tools ConnectorsSuite/TestACustomHTTPConnectorIsStoredAndItsAPIIsNeverShown
AC-2: a none connection validates connected; tools list says read_only ConnectorsSuite/TestAConnectionToAnHTTPConnectorListsItsReadOnlyTool
AC-5: read_only POST / DELETE -> 400 naming the tool, nothing stored ConnectorsSuite/TestAReadOnlyToolThatWritesIsRefusedNamingIt
AC-7 + S1.5: 127.0.0.1, 10.0.0.1, 169.254.169.254, http://, ::1, .invalid, query, userinfo, fragment -> one message, nothing stored ConnectorsSuite/TestAnHTTPConnectorWhoseAPIIsNotPublicHTTPSIsRefused
A new revision is checked again; a refused one leaves revision 1 ConnectorsSuite/TestANewRevisionOfAnHTTPConnectorIsCheckedAgain
Both / neither / empty endpoint -> 400 ConnectorsSuite/TestAConnectorWithBothOrNeitherOfEndpointAndHTTPIsRefused
Schema edges (method/type enums, lowercase method, unknown fields, base_url > 2048, null tools, no base_url, no type, no tool, 129 tools, bad name, description / path / parameter description over cap, 65 parameters) -> validation_failed ConnectorsSuite/TestAnHTTPToolTheSchemaRefusesIsAValidationFailure
Core's reasons through the API (oauth2_code, _method) ConnectorsSuite/TestAnHTTPConnectorTheManifestRefusesIsRefusedWithItsReason
Control: MCP create and its refusals answer as on 5a798ad (keys, values, messages from a probe run there) ConnectorsSuite/TestAnMCPConnectorIsAnsweredAsBefore (passes on base and head)
Core caps: a parameter description over 1000, a base_url over 2048 HTTPSourceSuite/TestAnHTTPSourceBreakingARuleIsRefused, ImportableDefinitionSuite/TestAnOversizedHTTPConnectorIsRefused
A change set's definitions are checked before its transaction opens store DataMoveSuite/TestAChangesDefinitionsAreCheckedBeforeItsTransactionOpens
Go SDK constant names kept sdks/go/acceleration TestInvocationArgumentTypeKeepsItsConstantNames, TestCustomHTTPToolMethodNamesItsConstants
Import: http kept, MCP kept; private / .invalid / http:// / {name} base_url refused with the fixed message ImportableDefinitionSuite, store DataMoveSuite/TestAnImportedHTTP*, api DataMoveSuite/TestAnImportedHTTPConnectorIsCheckedAsTheAPIChecksIt

The AC tests fail on the base (run there with this branch's test file), except the schema test, which the base also passes by refusing http as an unknown field. Each changed condition, field copy and schema tag was mutated; the list is in the author log.

Open points

  • An imported MCP definition's endpoint gets no public-address check (as on the base); the MCP source's egress client still checks each address it dials.
  • Breaking for SDK callers (CHANGELOG Breaking Changes): Go CustomConnectorRequest.Endpoint is *string, Rust's endpoint is Option<String>, and PHP's and Python's constructors take endpoint after schemes.

🤖 Generated with Claude Code

POST /v1/agents/connectors takes an optional http {base_url, tools[]}
beside endpoint, exactly one of the two. base_url must pass
egress.ValidatePublicHTTPSURL, checked before the manifest's rules so
every refusal answers one fixed message; the manifest is built through
core.CustomManifest, whose read_only rule names the tool. connectorOf
still shows neither base_url nor tools.

POST /v1/data/import loses AI-3674's http refusal and checks the
base_url the same way (importableDefinition).

openapi.yaml and the Go, JS, Python, .NET, Ruby, Rust and PHP clients
are regenerated; SDK note in .claude/skills/sdk/notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kanat kanat left a comment

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.

VERDICT: NO-GO

Security review, round 1 (head fba0377 on the feature branch).

The trust boundaries hold. Create and import are server-side only: a device token gets a 403 and no credential gets a 401. Every write is scoped to the caller's customer. A built-in id cannot be written. The base_url egress check runs on create, on each new revision, on import and on a replayed change, and every refusal gets the same sentence. The dial-time check still covers call time. No new error text reaches a caller, and no client-side SDK changes.

One size limit is missing, which blocks the merge:

  • [Should fix] S1.1: the size of an http connector's tool list is limited only by the API's 1 MiB body. Nothing caps a parameter's description, and base_url has a cap only in the request schema. An import (lines of up to 64 MiB) can therefore store a much larger http connector than the API would accept, and every session that binds it sends that tool list to the model on each turn. Fix: cap each parameter's description at maxHTTPToolDescription in checkHTTPSource, and the http source's endpoint at maxHTTPPath in Manifest.Validate, so create and import share the limits. The test rows go to the fixer.
  • [Nit] S1.2: a base_url with a {name} in its path, and an imported http:// base_url, get core's wording instead of the one base_url sentence. This depends only on the URL's syntax, not on a DNS lookup, so it tells a caller nothing about the resolver.
  • [Question] S1.3 (unverified): on a replayed change, the import's base_url check resolves DNS inside the open transaction (applyChanges), and only the request context bounds it. Should it have its own short timeout, or move out of the transaction?

Comment thread acceleration/internal/api/connectors.go Outdated
// CustomHTTPParameter is one value the model gives an http tool (core.HTTPParameter).
type CustomHTTPParameter struct {
Type string `json:"type" enum:"string,number,integer,boolean"`
Description string `json:"description,omitempty"`

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.

[Should fix] S1.1 Nothing caps a parameter's description, here or in core (checkHTTPSource caps only the tool's description, at 1000 bytes). The base_url cap is only the schema's maxLength. An import bypasses both, so it can store an http connector larger than create would accept, and its tool list goes to the model on every turn. Fix: in core, cap each parameter's description at maxHTTPToolDescription and the http endpoint at maxHTTPPath, so create and import enforce the same limits.

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.

Fixed in 5a1c77a: checkHTTPSource caps each parameter description at maxHTTPToolDescription, and Manifest.Validate caps the http endpoint at maxHTTPPath. Test: HTTPSourceSuite/TestAnHTTPSourceBreakingARuleIsRefused (rows "a parameter description over 1000" and "a base_url over 2048"). Each cap removed alone fails it.

Comment thread acceleration/internal/store/datamove.go Outdated
// that error tells a name that does not resolve from one that resolves to a private address.
if core.HTTPSource(custom.Sources) != nil {
return nil, fmt.Errorf("store: imported connector definition %q: %w: an http connector cannot be imported yet", id, ErrNotACustomConnector)
if err := egress.ValidatePublicHTTPSURL(ctx, custom.Endpoints[core.SourceKindHTTP]); err != nil {

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.

[Should fix] S1.1 (import side) AsCustom is the only rule set here, and core has no length caps on base_url or on parameter descriptions. An import therefore keeps what the API's body limit would refuse. It is fixed by the core caps in the other comment. Add an ImportableDefinitionSuite row for each cap.

[Question] S1.3 On a replayed change this lookup runs inside applyChanges' transaction, and only the request context bounds it. Should it get a short timeout of its own, or run before the transaction opens?

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.

S1.1 fixed in 5a1c77a: ImportableDefinitionSuite/TestAnOversizedHTTPConnectorIsRefused (a 2 MiB parameter description, a 4 KiB base_url). Without the parameter cap it fails.
S1.3 fixed in 7de22c6: the check now runs before the transaction opens. importableRow checks a definition before importRow, and applyChanges runs it for the whole change set before RunInTx. Test: store DataMoveSuite/TestAChangesDefinitionsAreCheckedBeforeItsTransactionOpens. Its first change names no table, so it fails only inside the transaction. The test expects the definition after it to be refused first. Moving the check back into importRow fails the test.

// Tools). The base URL has the endpoint's limit. The other rules are core.Manifest.Validate's
// (checkHTTPSource in internal/connectors/core/http_tools.go), which answer naming the tool.
type CustomHTTPAPI struct {
BaseURL string `json:"base_url" maxLength:"2048" doc:"The API the tools call, each at its path under it: a public https URL without userinfo, query or fragment. An address on a private network, loopback or link-local is refused. Never shown once stored."`

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] S1.2 AC-7 asks for one answer for every refused base_url. A URL that passes egress but fails core's template rule (a {name} in the path) gets core's wording. So does an imported http:// base_url, since import runs AsCustom before egress. Both depend on syntax only, never on DNS. Either accept it, or run core's endpoint rule under the same sentence.

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.

Fixed in 6249bd7: core.CheckBaseURL holds a base URL to core's endpoint rules (the 2048 cap, https://, no {name}) and to egress, and gives one sentence for every refusal. Create and import both run it before CustomManifest and AsCustom. Tests: ConnectorsSuite/TestAnHTTPConnectorWhoseAPIIsNotPublicHTTPSIsRefused (HTTPS://8.8.8.8, https://8.8.8.8/{x}) and ImportableDefinitionSuite/TestAnHTTPConnectorWhoseAPIIsNotPublicIsRefused (http://, HTTPS://, {x}, over 2048). Each of the four conditions removed alone fails the import test. Going back to the egress-only check in the API fails the API test.

@kanat kanat left a comment

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.

VERDICT: NO-GO

Round-1 review of fba0377, merged onto feature/ai-3669-http-connectors at 5a798ad. Three Should fix items block the merge: R1.1, R1.2 and R1.3 (inline).

Checked and sound:

  • Touched suites pass: api ConnectorsSuite, ConfigsSuite and DataMoveSuite; store DataMoveSuite and ImportableDefinitionSuite; unit tests for api, connectors and store.
  • generated.sh reports no drift. The Go, .NET, Rust, Ruby, PHP and Python generator checks also find none.
  • The MCP control test passes against the base's connectors.go and against the head.
  • createConnector has no x-client-accessible.
  • AC-1, AC-2, AC-5 and AC-7 hold through the API. The AC-7 message contains the epic's phrase word for word, after the field name. The base_url check runs before core's rules, and the egress error never reaches the caller.
  • A stored http connector fails closed on the previous release: no such tool source.
  • A trial merge with #2302 conflicts only in add-connector/SKILL.md and three generated files. The Go code merges cleanly, and ConnectorsSuite passes on the merge.
  • CI does not run on this draft. It runs at gh pr ready.

Nits for tickets:

  • [Nit] R1.4 connectors.go:190-207: the doc text states caps (1-128 tools, the name pattern, 1000 bytes, 64 parameters) that the schema has no tags for. Core enforces them.
  • [Nit] R1.5 datamove.go:1681: an imported http:// base_url gets core's message from AsCustom, not the fixed base_url message that the description promises for import.

Author questions: Q1 (Go Endpoint becomes *string) was decided, and R1.1 and R1.2 widen it. Q2 (an imported MCP endpoint has no public check) goes to a ticket.


// CustomHTTPParameter is one value the model gives an http tool (core.HTTPParameter).
type CustomHTTPParameter struct {
Type string `json:"type" enum:"string,number,integer,boolean"`

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.

[Should fix] R1.1 This enum shares string, number and boolean with InvocationArgumentType. oapi-codegen prefixes every constant of two enums that share a value (see sdks/go/acceleration/enums_test.go). So the released Go SDK constants acceleration.Array, Boolean, Null, Number, Object and String (sdks/go v0.5.1) are renamed to InvocationArgumentType* in generated.go. Neither CHANGELOG nor the SDK note mentions this. CustomHTTPToolMethod (line 204) also exports bare GET, HEAD, POST, PUT, PATCH and DELETE, and the next enum with those values renames them the same way.

Fix: set x-enum-varnames on both properties in their TransformSchema, as connections.go:129 and schemas.go:461 do. Then regenerate, and pin InvocationArgumentType's names in enums_test.go, as TestAgentLogSourceKeepsItsConstantNames does. I checked this in a scratch copy: with CustomHTTPParameterType* and CustomHTTPToolMethod* names, the regenerated client keeps every base constant.

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.

Fixed in 0a50128: both properties set x-enum-varnames (CustomHTTPToolMethod*, CustomHTTPParameterType*). I regenerated openapi.yaml, Go and Python. .NET, Rust, Ruby, PHP, JS and Swift generate no change. generated.go keeps Array, Boolean, Null, Number, Object and String as on the base. Tests: TestInvocationArgumentTypeKeepsItsConstantNames and TestCustomHTTPToolMethodNamesItsConstants in sdks/go/acceleration/enums_test.go. If either extension is dropped and the client regenerated, the test no longer compiles.

Comment thread CHANGELOG.md Outdated

### The Go SDK's `CustomConnectorRequest.Endpoint` is a pointer

`POST /v1/agents/connectors` now takes either an MCP `endpoint` or an `http` block with a `base_url` and its tools, so `endpoint` is optional and the generated Go type `CustomConnectorRequest.Endpoint` is now `*string`. Set it with a pointer (for example `Endpoint: &url`); a caller that set a plain string no longer compiles. The other SDKs are unchanged for existing callers (AI-3676).

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.

[Should fix] R1.2 "The other SDKs are unchanged for existing callers" is not true:

  • Rust: CustomConnectorRequest.endpoint is now Option<String> (sdks/rust/src/types.rs:5291), so a struct literal or a read of a String no longer compiles.
  • PHP: the constructor moves $endpoint from the first positional argument to after $schemes.
  • Python: the attrs class does the same.

Fix: name Rust, and positional PHP and Python callers, in this entry and in .claude/skills/sdk/notes/2026-11-24-ai-3676.md. If R1.1 is not fixed, add the renamed InvocationArgumentType constants as well.

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.

Fixed in 72ad6ec: the Breaking Changes entry now lists Go (*string), Rust (Option<String>, set with Some(url)), and positional PHP and Python callers (endpoint now comes after schemes). The SDK note 2026-11-24-ai-3676.md says the same. This is a docs change, so it has no test.

parameters[name] = core.HTTPParameter{Type: parameter.Type, Description: parameter.Description, Required: parameter.Required}
}
tools = append(tools, core.HTTPTool{Name: tool.Name, Description: tool.Description, Method: tool.Method,
Path: tool.Path, Parameters: parameters, ReadOnly: tool.ReadOnly})

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.

[Should fix] R1.3 The mutant ReadOnly: tool.ReadOnly || tool.Method == "GET" survives all touched suites, because no test has a GET tool without read_only. Such a mutant would mark a GET tool as read-only when the file never said so.

Test row (I checked it: it passes on the head and fails under the mutant): in ConnectorsSuite/TestAConnectionToAnHTTPConnectorListsItsReadOnlyTool, add the tool {"name": "list_notes", "description": "Lists the notes.", "method": "GET", "path": "/v1/notes"} and expect {"get_forecast": true, "add_note": false, "list_notes": false}.

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.

Fixed in 639bbdb: ConnectorsSuite/TestAConnectionToAnHTTPConnectorListsItsReadOnlyTool has list_notes (GET, no read_only) and expects it to be false. The mutant ReadOnly: tool.ReadOnly || tool.Method == "GET" fails it.

kanat and others added 7 commits November 24, 2026 10:14
… (S1.1)

An import has no request schema, so it could store an http connector the API would refuse.
Manifest.Validate now caps each parameter's description at 1000 bytes and the http source's
endpoint at 2048, the caps the API's schema has, so create and import share them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (S1.2)

core.CheckBaseURL holds a base URL to the endpoint rules Manifest.Validate has for an http
custom connector (its cap, https://, no {name}) and to egress, with one sentence for every
refusal. Create and import both run it before CustomManifest and AsCustom, so an imported
http:// base URL and a {name} in one no longer get core's own words.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ction (S1.3)

Checking an imported http definition resolves its base URL's host. applyChanges ran that
lookup inside its transaction, bounded only by the request. importableRow now checks each
definition before the transaction opens, and ImportRow runs it before importRow, so no
lookup happens while a transaction is open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…R1.1)

CustomHTTPParameterType shares string, number and boolean with InvocationArgumentType, so
oapi-codegen prefixed both enums' constants and renamed the released Go SDK's Array, Boolean,
Null, Number, Object and String. Both new enums now name their constants with
x-enum-varnames, as ConnectionOwnerType does, and enums_test.go pins the old names and the
new method ones. Go and Python clients regenerated; the other generators emit no change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…int breaks (R1.2)

Rust's CustomConnectorRequest.endpoint is now Option<String>, and PHP's constructor and
Python's attrs class take endpoint after schemes, so a positional call no longer matches.
The Breaking Changes entry and the SDK note said the other SDKs were unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…1.3)

TestAConnectionToAnHTTPConnectorListsItsReadOnlyTool now has a GET tool that does not say
read_only, so marking every GET tool read-only fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ttern (R1.4)

The doc text stated 1 to 128 tools, the 63-character name pattern, 1000 for a description,
2048 for a path and 64 parameters, which only core enforced. The schema now has them as
minItems, maxItems, pattern, maxLength and maxProperties, so what validates the request also
documents it. An empty tool list is now a validation failure before core's rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@kanat kanat left a comment

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.

VERDICT: NO-GO

Delta round 1, head 977f372, merged onto base 5a798ad (the head already contains it). Unit, vet (both tags) and the touched integration suites pass on a fresh test database; the draft has no go/integration CI.

Prior findings, each fix mutation-checked:

  • S1.1 fixed: the parameter description cap and the base URL cap in core are pinned (caps off: tests fail).
  • S1.2 / R1.5 fixed: one core.CheckBaseURL, one fixed answer, used by create and import; each clause mutated and killed except the cap boundary (R2.1).
  • S1.3 fixed: importRow reaches no egress lookup; the check runs in ImportRow (no transaction) and before RunInTx in applyChanges. Moving the check into the loop fails TestAChangesDefinitionsAreCheckedBeforeItsTransactionOpens.
  • R1.1 fixed: no exported const, func or type of sdks/go/acceleration at v0.5.1 is removed or renamed on this head (Array, Boolean, Null, Number, Object, String keep InvocationArgumentType; new CustomHTTPParameterType* and CustomHTTPToolMethod* only). Dropping the varnames and regenerating breaks enums_test.go. Every other client's regeneration is clean (Go, JS, Python, Swift check, .NET, Rust, Ruby, PHP).
  • R1.2 fixed: Go, Rust, PHP and Python named; Rust Option<String> and the PHP/Python argument order checked against the base.
  • R1.3 fixed: the || Method == "GET" mutant fails the read-only listing test.
  • R1.4 fixed: each of the seven schema tags, mutated one step, fails TestAnHTTPToolTheSchemaRefusesIsAValidationFailure.

New finding:

  • R2.1 [Should fix]: three mutants of delta code survive. (a) datamove.go:1968, dropping changes[i].Payload = payload: a change set's definition is stored without the normalization an import gets. (b) manifest.go:836 and (c) custom.go:44 with the cap at 2049 instead of 2048: no row sits on the boundary. Ready rows, each checked to pass on this head and fail under its mutant: below.
    • core/http_tools_test.go, in TestAnHTTPSourceBreakingARuleIsRefused: "a base_url of 2049": Endpoints[SourceKindHTTP] = "https://api.example.com/" + strings.Repeat("a", 2025), expecting endpoints.http: is over 2048 bytes.
    • store/datamove_unit_test.go, in TestAnHTTPConnectorWhoseAPIIsNotPublicIsRefused's list of bases: "https://8.8.8.8/" + strings.Repeat("a", 2033) (2049 bytes).
    • store/datamove_test.go, new DataMoveSuite test (see the inline comment)..

No new problem in the trust boundary: base_url is checked (https prefix, no braces, cap, public address) before AsCustom on both paths, with one message.

if err != nil {
return err
}
changes[i].Payload = payload

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.

Mutant: _ = payload here survives every test. Row (passes on this head, fails under the mutant), in DataMoveSuite:

func (s *DataMoveSuite) TestAChangesDefinitionArrivesWithoutAFieldThisReleaseDoesNotRead() {
	id := "custom_" + newID()
	manifest := strings.Replace(customManifestWith(`"later": {"env": "GOOGLE"}`), "custom_acme", id, 1)

	err := s.destination.ApplyChanges(s.ctx, "moved", []DataChange{{Table: "connector_definitions", Op: ChangeInsert,
		Payload: json.RawMessage(`{"id": "` + id + `", "revision": 1, "name": "Acme", "category": "", "description": "", "created_at": "2026-11-01T00:00:00Z", "manifest": ` + manifest + `}`)}})

	s.Require().NoError(err)
	var stored string
	s.Require().NoError(s.destination.GlobalDB().QueryRowContext(s.ctx,
		"SELECT manifest FROM connector_definitions WHERE customer_id = 'moved' AND id = ?", id).Scan(&stored))
	var manifestStored map[string]any
	s.Require().NoError(json.Unmarshal([]byte(stored), &manifestStored))
	s.NotContains(manifestStored, "later")
}

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.

Fixed in be026ba: DataMoveSuite.TestAChangesDefinitionArrivesWithoutAFieldThisReleaseDoesNotRead (store/datamove_test.go). Mutant changes[i].Payload = payload dropped: the test fails ("should not contain "later""); passes on the head. The two cap rows (a base_url of 2049 in manifest_test, a 2049-byte base in TestAnHTTPConnectorWhoseAPIIsNotPublicIsRefused) also fail under maxHTTPPath+1 at core/manifest.go:836 and core/custom.go:44.

…s at the boundary (R2.1)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@kanat kanat left a comment

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.

VERDICT: GO

Delta round 2 on PR #2344 (AI-3676). Head be026ba, previous reviewed head 977f372. Merged onto base 5a798ad: no merge needed, the base is an ancestor of the head.

The delta is one commit (be026ba) and touches only three test files (+27/-1): core/http_tools_test.go, store/datamove_test.go, store/datamove_unit_test.go. No production line changed.

Prior findings

  • R2.1(a) fixed: store/datamove.go:1968 with changes[i].Payload = payload replaced by _, _ = i, payload: DataMoveSuite/TestAChangesDefinitionArrivesWithoutAFieldThisReleaseDoesNotRead fails (the stored manifest keeps "later"). Passes on head.
  • R2.1(b) fixed: core/manifest.go:836 cap maxHTTPPath+1: HTTPSourceSuite/TestAnHTTPSourceBreakingARuleIsRefused, row "a base_url of 2049", fails (no error returned). Passes on head.
  • R2.1(c) fixed: core/custom.go:44 cap maxHTTPPath+1: ImportableDefinitionSuite/TestAnHTTPConnectorWhoseAPIIsNotPublicIsRefused fails on the 2049-byte base (the cap message is replaced by the base_url message). Passes on head.
  • Earlier findings S1.1, S1.2/R1.5, S1.3, R1.1 to R1.4: untouched by this delta, status as in delta-1.

New findings

  • [Should fix] (unchanged code) core/manifest.go:836 and core/custom.go:44 — the lower side of the cap is not pinned. >= maxHTTPPath survives TestHTTPSourceSuite and TestImportableDefinitionSuite. A base_url of exactly 2048 bytes is accepted on head, and the mutant refuses it (probes below). Fix: two rows, each checked by a probe in this review.
    • core, HTTPSourceSuite success case: m := httpManifest(forecast()), endpoint "https://api.example.com/" + strings.Repeat("a", 2024) (2048 bytes), s.NoError(m.Validate()). Head passes; the >= mutant fails.
    • store, ImportableDefinitionSuite: importedHTTP with base "https://8.8.8.8/" + strings.Repeat("a", 2032) (2048 bytes), importableDefinition returns no error. Head passes; the >= mutant at custom.go:44 fails with the base_url message.
    • Policy: ticket (default for unchanged code). It does not block this verdict.

Mutations

5 checked, 2 survived. The 3 R2.1 mutants are killed (above). The 2 survivors are the >= lower-side mutants at manifest.go:836 and custom.go:44; each is killed by the probe row above and by neither existing test.

Runs (head be026ba)

  • go test ./internal/connectors/... ./internal/store/: all packages ok.
  • go test -count=1 -tags integration -run TestDataMoveSuite ./internal/store/: ok (fresh test database).
  • go vet ./internal/connectors/... ./internal/store/ and go vet -tags integration ./internal/store/: ok.
  • Each mutant was reverted with git checkout after its run; the probe files were deleted.

CI

gh pr checks 2344: the PR is a draft, so go, unit, integration and sdks are skipping. labeler and GitGuardian pass. A draft runs no CI, which is not a failure.

Unverified

  • Findings S1.1, S1.2/R1.5, S1.3, R1.1 to R1.4 were not re-run this round; the diff does not touch their code.

}
checkHTTPSource(fail, field, source)
// An import has no request schema to cap it (maxLength on CustomHTTPAPI.base_url).
if endpoint := m.Endpoints[source.Endpoint]; len(endpoint) > maxHTTPPath {

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.

[Should fix] (unchanged code) The lower side of this cap is not pinned: >= maxHTTPPath survives. A base_url of exactly 2048 bytes is accepted on head. Ready row: HTTPSourceSuite success case with endpoint "https://api.example.com/" + strings.Repeat("a", 2024), expect Validate() to return no error. Same gap at core/custom.go:44; see the body. Policy: ticket.

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.

Fixed in ed754e9: HTTPSourceSuite/TestAValidHTTPSourceIsAccepted row "a base_url of 2048 bytes" and ImportableDefinitionSuite/TestAnHTTPConnectorAndAnMCPOneAreKept (2048-byte base_url, kept as stored). Both pass on the head and fail under >= maxHTTPPath at core/manifest.go:836 and core/custom.go:44. Test-only change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@kanat kanat left a comment

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.

VERDICT: GO

Delta round 3 on PR #2344 (AI-3676). Head ed754e9, previous reviewed head be026ba. Merged onto base 5a798ad (feature/ai-3669-http-connectors, unchanged): no merge needed, the base is an ancestor of the head.

The delta is one commit, ed754e9 (R2.2). It touches two test files (+8/-1) and no production line:

  • acceleration/internal/connectors/core/http_tools_test.go: row "a base_url of 2048 bytes" in TestAValidHTTPSourceIsAccepted.
  • acceleration/internal/store/datamove_unit_test.go: third row, a 2048-byte import, in TestAnHTTPConnectorAndAnMCPOneAreKept.

Prior findings

  • R2.2 fixed. Both new rows fail under their >= mutant and pass on head (see MUTATIONS).
  • R2.1(a), (b), (c): not touched by this delta. Status as in delta-2; the mutants were not re-run this round.
  • S1.1, S1.2/R1.5, S1.3, R1.1 to R1.4: not touched by this delta. Status as in delta-1; not re-run this round.

New findings

None. Both rows sit at the cap: the lengths are 2048 bytes (core: 24 + 2024; store: 16 + 2032, counted with python3), so they pin the lower side of maxHTTPPath, and the 2049 rows from R2.1 pin the upper side.

Mutations

2 checked, 0 survived.

  1. core/manifest.go:836 len(endpoint) > maxHTTPPath changed to >=. Fails: TestHTTPSourceSuite/TestAValidHTTPSourceIsAccepted, row "a base_url of 2048 bytes" (error "endpoints.http: is over 2048 bytes"). Also fails: TestImportableDefinitionSuite/TestAnHTTPConnectorAndAnMCPOneAreKept. Head: passes.
  2. core/custom.go:44 len(baseURL) > maxHTTPPath changed to >=. Fails: TestImportableDefinitionSuite/TestAnHTTPConnectorAndAnMCPOneAreKept, the 2048-byte row (error "base_url must be a public https URL without userinfo, query or fragment"). The core suite still passes, as expected: it does not reach custom.go. Head: passes.
    Each mutant was reverted with git checkout; the worktree was clean afterwards.

Runs (head ed754e9, unit only)

  • go test -count=1 ./internal/connectors/... ./internal/store/: every package ok (store 8.7 s).
  • go vet ./internal/connectors/... ./internal/store/: exit 0.
  • gofmt -l on the two test files: no output.
  • No integration run. The changed store file has no build tag, so the unit run covers it. No integration suite touched by this delta.

CI

gh pr checks 2344: the PR is a draft, so go, unit, integration and sdks skip. labeler and GitGuardian pass. A draft runs no CI, which is not a failure.

@kanat
kanat marked this pull request as ready for review November 25, 2026 03:55
@kanat
kanat merged commit aed810a into feature/ai-3669-http-connectors Nov 25, 2026
20 of 21 checks passed
@kanat
kanat deleted the connectors/http-api branch November 25, 2026 03:56
kanat added a commit that referenced this pull request Nov 25, 2026
Targets the feature branch `feature/ai-3669-http-connectors`, not
`main`. Fix leaf of AI-3669 (umbrella AI-3870).

## Why

With http connectors stored, `GET /v1/agents/connectors[/{id}]` answered
a `Connector` with no source kind, so the CLI could not tell an http
custom connector from an MCP one. The cli#128 review showed it: `agents
mcp list` lists http connectors as MCP servers, and `agents mcp update
<http one> <mcp url>` with no local file turned an http connector into
an MCP one. The CLI already decodes `sources: [{kind}]` (GetStream/cli
`internal/agents/connectors.go:21`); this makes the router answer it.

## How it works

```
Connector (GET /v1/agents/connectors, /{id}, the create's answer)
└─ sources: one entry per manifest source, in order, kind only
   ├─ custom, made from `endpoint`  -> [{"kind":"mcp"}]
   ├─ custom, made from `http`      -> [{"kind":"http"}]
   ├─ built-in                      -> its own kinds (slack: [{"kind":"mcp"}])
   └─ never a URL, base_url, path, headers or tool
```

`kind` is the named enum `ConnectorSourceKind` (`mcp` | `http`), with
`x-enum-varnames` so the Go SDK gets `ConnectorSourceKindMCP` and
`ConnectorSourceKindHTTP` and a later enum holding `mcp` or `http`
renames nothing (as #2344 did for `CustomHTTPToolMethod`). `sources` is
always an array, `nullable: false`.

## Changes

| Change | Test that proves it |
| --- | --- |
| `Connector.sources` built from `manifest.Sources` by kind
(`connectors.go` `connectorOf`) | `TestConnectorSourcesSuite` (order,
empty list is `[]`, nothing but kind);
`TestAConnectorShowsItsSourceKindAndNoAddress` (create, read, list of an
http and an MCP custom connector, and slack; no `base_url`, `endpoint`,
address, path or tool name in the answer) |
| Two controls that listed the keys of a connector answer gain `sources`
| `TestAnMCPConnectorIsAnsweredAsBefore`,
`TestABuiltInReadsAsBeforeOnARouterWithoutAPublicURL`;
`TestWhatTheRouterReadsToConnectIsNeverShown` no longer withholds
`sources` but asserts it is `[{kind: mcp}]` |
| `openapi.yaml` and the clients regenerated | Go, JS, Python
(`plugins/stream`), .NET, Ruby, Rust and PHP changed; Kotlin, Swift and
Dart checked, unchanged (`Connector` is not client-accessible) |
| Go constant names pinned | `TestConnectorSourceKindNamesItsConstants`
(`sdks/go/acceleration/enums_test.go`) |
| SDK note appended | `.claude/skills/sdk/notes/2026-11-24-ai-3676.md` |

## Validation

- `go test ./internal/api/` (unit) and, on my own test DB, `go test
-tags integration -run
'TestConnectorsSuite|TestAuthorizationsSuite|TestConnectionsSuite|TestConnectionProxySuite|TestConnectorProviderAppsSuite|TestConnectorEventsSuite|TestDataMoveSuite|TestOAuthClientsSuite|TestConfigsSuite'
./internal/api/` pass; `go vet` with and without `-tags integration`
clean; `go test ./acceleration/` in `sdks/go` passes.
- Mutations: loop body dropped, kind hardcoded, nil instead of empty
list, endpoint appended to the kind, reversed order (each killed by
`TestConnectorSourcesSuite`); enum value dropped, varnames dropped,
`nullable:"false"` dropped (each killed by `TestPostureSuite`, the spec
check; the varnames one also fails `enums_test.go` after `go generate`).
- Not run here: the full integration run, Swift/Kotlin/Dart tests, the
CLI side (cli#128).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
kanat added a commit that referenced this pull request Nov 25, 2026
…871 (#2480)

Targets `feature/ai-3669-http-connectors`, not main. Two small leftovers
of AI-3669; tests and docs only, no router code changes.

```
acceleration/internal/api/child_agents_sensitive_test.go   +TestADelegationJudgesAnHTTPToolReadOnlyOnlyAtTheDigestItsGrantPins
.claude/skills/sdk/notes/2026-11-24-ai-3676.md             Connector sentence true again
.claude/skills/sdk/notes/2026-11-25-ai-3871.md             new: the AI-3871 `sources` note, moved here
```

## 1. Delegation judges an http tool by its pinned digest
`bindingSendsOut` (`sensitive.go`) calls `GrantSendsOut`, which judges
an http tool at the digest its grant pins. Replacing that call with
`manifest.SendsOutTool(tool.Name)` passed every ChildAgentsSuite test.
The new test wires, past the API, a parent and a child with nessy
(sensitive) and an http connector whose latest revision has `get`, a
read-only GET:

| grant | sensitive parent, http child | sensitive child, http parent |
|---|---|---|
| pins the digest | runs | runs |
| pins none | refused | refused |
| pins another digest | refused | refused |

Mutants (one script, `mutate.sh`): `bindingSendsOut` -> `SendsOutTool`,
`digest != grant.SchemaDigest` -> `digest == ""` and `-> digest ==
grant.SchemaDigest` each fail the test; the head passes.

## 2. SDK notes
#2464 appended the AI-3871 part to the AI-3676 note; `notes/README.md`
asks one file per change, and the AI-3676 note said the `Connector` is
unchanged. The AI-3871 paragraph is now `2026-11-25-ai-3871.md`
unchanged; the AI-3676 note is back as #2344 wrote it, except that its
`Connector` sentence says "unchanged by this change" and points to the
new note.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
kanat added a commit that referenced this pull request Nov 26, 2026
Feature branch for [AI-3669](https://linear.app/stream/issue/AI-3669):
the router gets an `http` tool source. A file
`connectors/http/<name>.yaml` names a public https base URL and
read-only tools. Once synced, an agent calls those tools with a user's
credential.

## What it does

```
connectors/http/<name>.yaml
  │  CLI sync
  v
POST /v1/agents/connectors   (http block)
  │
  v
manifest, sources/http
  │  agent session offers the tool
  v
session tool call -> base_url + path, with the connection's credential
```

Safety rules. Each is checked when the connector is saved, at each call,
or both:

| Rule | Effect | Checked |
|---|---|---|
| Public https only | `base_url` goes through the egress check; private
and plain-http hosts are refused | save (`CheckBaseURL`), and every
call, as the connection's client is the egress client |
| `read_only` GET and HEAD | other methods are refused on `read_only`
tools | save. A tool whose definition changed since its grant is not
offered (the grant pins a digest of method, path and `read_only`) |
| Override args refused | the model cannot change the method, host or
headers | save refuses a parameter or header named like a method
override; a call refuses an argument the tool does not declare, before
anything is sent |
| Path segments escaped | `..%2Fadmin` stays one segment | every call |
| Size caps | 4 MiB read from the provider, 32 KiB to the model (with a
marker) | every call |
| Egress limits | the same egress client and the same 4 MiB read cap as
the MCP source, and #2430's import limits | every call; import |

## Pieces

All merged into this branch, each reviewed on its own PR. Three commits
on the branch itself follow the last main sync: the feature's caps
become core's after #2430, a subtest split of #2480's test, and a test
that an http custom connector meets an MCP one's limits.

| Piece | Ticket | PR | Merge commit |
|---|---|---|---|
| Manifest model for http tools | AI-3673 |
[#2303](#2303) | 7d1d6b7 |
| `sources/http` tool source | AI-3674 |
[#2316](#2316) | 2a29dac |
| Call-time safety | AI-3675 |
[#2324](#2324) | 5a798ad |
| API accepts http connectors (keystone) | AI-3676 |
[#2344](#2344) | aed810a |
| A connector's answer names its source kind | AI-3871 |
[#2464](#2464) | c72f50f |
| Pin delegation's digest check; own SDK note | AI-3870 |
[#2480](#2480) | 73e80f2 |
| Fake provider's CodeQL alert; SDK skill names http connectors |
AI-3870 | [#2483](#2483) |
469960b |

Main was merged into the branch 9 times; the last is main `f58ff6eb3`.
An earlier one, main `c4119ba23`, carries
[#2430](#2430 import limits.
Imported http connectors are held to the same limits.

The merge of main `8232d25af` brings in two changes that touch http
connectors:
- [#2485](#2485) refuses
imported agent configs that break the sensitive-connector rule. An http
connector's tools are weighed by their own rule: a tool that is not
read-only, or a read-only tool granted without its digest, is refused. A
test covers this
(`TestAnImportedHTTPConnectorAnAgentBindsBesideASensitiveOneIsWeighedByItsTools`).
- [#2434](#2434) adds
`check_changes` to a custom connector create. An http connector takes
the same path as an MCP one, and a test covers the http case
(`TestACheckedSyncOfAnHTTPConnectorIsRefusedOnlyOverAnEditNoSyncWrote`).

## Acceptance

AC-1..AC-9 are frozen in the epic. The staging window was opened twice
on the branch build, then staging was restored.

| AC | Result | Checked |
|---|---|---|
| AC-1 | pass | staging windows 1 and 2 (router part). The CLI line
(first sync prints the connector id) is in
[GetStream/cli#128](GetStream/cli#128) |
| AC-2 | pass | staging window 1 and 2 |
| AC-3 | pass | staging window 1 and 2: one tool call, the agent
answered from it |
| AC-4 | pass | staging window 1 and 2 |
| AC-5 | pass | staging window 1 and 2 |
| AC-6 | pass | local router: override args refused, the fake provider
saw 0 requests |
| AC-7 | pass | staging, by API and by CLI |
| AC-8 | pass | staging window 1 and 2: a JSON body comes back as
`application/json` |
| AC-9 | pass | local router: 100 KiB cut to 32768 B with a marker, 5
MiB cut at the 4 MiB read cap |

Rulings by Kanat (2026-11-25):

- AC-4: the "no token" clause is read as a wrong token. A wrong token
gives a tool error 401. A connection with no token at all stays
`not_connected` and its tool is not offered, as before.
- AC-5: the CLI refuses a `read_only` POST or DELETE locally, before any
request. The router refuses the same with a 400 on a direct POST.

## Gates for the merge into main

| Gate | What |
|---|---|
| a | Done: [#2481](#2481)
merged into main (`96d535d9d`), which fixed main's integration build at
`scheduled_unpaid_test.go:814`. This branch builds and vets with the
integration tag merged onto main `aa4c2d4d9` |
| b | Full CI green once this PR leaves draft (a draft runs none of the
go or integration jobs) |
| c | [GetStream/cli#128](GetStream/cli#128)
merges after this is deployed, then the docs leaf AI-3678 |
| d | SDK releases that carry `Connector.sources` go out only after the
router deploy: the generated Python and Rust clients cannot parse a
connector from an older router |
| e | No migration, no flag. A rollback to the previous build fails
closed: an http binding is unavailable, and every http tool counts as
sending out |

## Breaking change

From `CHANGELOG.md` on the branch, under Unreleased, Breaking Changes:
**`CustomConnectorRequest`'s endpoint is optional in the Go, Rust, PHP
and Python SDKs**

- Go: `CustomConnectorRequest.Endpoint` is now `*string`. Set it with a
pointer (for example `Endpoint: &url`); a caller that set a plain string
no longer compiles.
- Rust: `CustomConnectorRequest.endpoint` is now `Option<String>`. Set
it with `Some(url)`; a struct literal with a plain `String`, or a read
of one, no longer compiles.
- PHP: the `CustomConnectorRequest` constructor takes `$endpoint` after
`$schemes`, not first. A positional call no longer matches; named
arguments work as before.
- Python (`plugins/stream`): the generated `CustomConnectorRequest`
takes `endpoint` after `schemes`, not first. A positional call no longer
matches; keyword arguments work as before.

## Rollout

```
merge this PR -> deploy to staging
  -> recheck AC-3 and AC-8 live -> merge cli#128 -> docs (AI-3678)
  -> SDK releases with Connector.sources
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant