Skip to content

[ENG-3850] Use a member's custom connections on their cloud turns - #777

Open
tino097 wants to merge 28 commits into
stagingfrom
tino097/eng-3850-use-a-members-custom-connector-on-their
Open

tino097 wants to merge 28 commits into
stagingfrom
tino097/eng-3850-use-a-members-custom-connector-on-their

Conversation

@tino097

@tino097 tino097 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

https://linear.app/mindsdb/issue/ENG-3850

What changed

  • Read the custom API block of a cloud turn: connection ids, versions and names only, parsed exactly, the turn key kept out of the request's repr
  • Add call_minds_api(connection_id, path, query=None, headers=None): one GET through the mindshub_inference gateway, sent with the turn key; the gateway places the member's key, which never enters the pod
  • Relay only the gateway's closed error codes; an answer that is not the contract's, or does not echo this call's connection, is invalid_custom_api_response
  • Tell the model about its custom connections, with their usage notes kept apart as data
  • Require a check when Anton builds a connector template, and say what to do when a check cannot place the key

Notes for the reviewer

Ships with

Checks

Check Observed result
uv run pytest at 1055772 12923 passed; 10 e2e tests timed out under load and passed when rerun alone

🤖 Generated with Claude Code

tino097 and others added 11 commits November 10, 2026 17:14
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…te flagged

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tino097
tino097 marked this pull request as ready for review November 11, 2026 11:57
Base automatically changed from tino097/eng-3838-custom-connectors-in-org-mode-store-definitions-per to staging November 12, 2026 21:56
tino097 and others added 7 commits November 12, 2026 23:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…from the path

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t apart as data

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and drop the dead overlay copy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tino097 and others added 6 commits November 13, 2026 13:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asic and without_missing

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

@ZoranPandovski ZoranPandovski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Requesting changes mainly for the description. It still describes fetching field values into the pod as DS_C... variables, but 0782d74 replaced that with call_minds_api through the gateway, and the test run it cites (ecbc434) predates that change. Please rewrite it for the gateway design and rerun the full suite on the current head; the linked issue needs the same update.

The optional key, public check and required check changes in connector_auth_rules.py and connector_draft.py are a separate feature shared with cowork-server and inference, and would be easier to review as their own PR.

"""Parse the optional ``custom_api`` block exactly, or refuse the request."""
if value is None:
return None
if not isinstance(value, dict) or set(value) != {"turn_key", "connections"}:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The block has no protocol_version and refuses any extra key, so if cowork-server ever adds a field, every turn with custom connections fails on pods running this version. Adding a version now, or dropping the block with a log line instead of failing the turn, would avoid that.

credential_version: int


@dataclass(frozen=True, repr=False)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TurnRequestV1 is a plain dataclass whose repr still shows the turn key through llm and oauth, so this does not keep the key out of a printed request. Also, turn_key here must equal llm.api_key and the helper never reads it, so it could be dropped.

assert ' - 3: "Ops desk" (beta_api)\n' in block
assert ' - 5: "Prod" (acme_crm)\n' in block
assert "`call_minds_api(connection_id, path, query=None, headers=None)`" in block
assert "The user typed only the API's host." in block

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These assert exact prompt phrases, so any wording change breaks them. The structural asserts above (connection lines, escaping) are enough.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tino097 and others added 2 commits November 16, 2026 15:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…asic and without_missing

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

[ENG-3850] Let a connector template mark its key optional and name a public check path

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants