Skip to content

feat: one search tool and one execute tool spanning the account scope (ENG-3175) - #389

Merged
willleeney merged 3 commits into
mainfrom
will/eng-3175-single-search-execute
Oct 29, 2026
Merged

willleeney merged 3 commits into
mainfrom
will/eng-3175-single-search-execute

Conversation

@willleeney

@willleeney willleeney commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Part of ENG-3175. Draft: depends on the server serving the trio to API keys (unified-cloud-api#9417 (merged)) and on StackOneHQ/sdk-conformance#9. The Python counterpart is StackOneHQ/stackone-ai-python#231.

Changes behaviour for 3.0.0 callers. In toolMode: 'search_execute' the SDK now gives a model one stackone_search_actions and one stackone_execute_action (with stackone_list_accounts) across every account in scope, instead of one pair per account. Released as 3.1.0, not 4.0.0, since 3.0.0 is days old: the commits are feat: with a Release-As: 3.1.0 footer, and the changes for 3.0.0 callers are listed in their bodies rather than as BREAKING CHANGE: footers. Keep the PR title feat: when squash-merging.

  • Listing: one MCP request for the whole scope, with the account ids as repeated x-account-id query parameters and recorded end users as repeated x-end-user-id.
  • search(): one call. Hits carry available_accounts instead of account_id.
  • execute(): one call. A single id in accountIds becomes stackone_account_id. An ambiguous action is refused by the server and throws StackOneAPIError; before, the SDK threw ToolSetConfigError.
  • Removed: the per-connector fan-out, connector routing and the failed-account retry.
  • Mock server, tests, README and the search-and-execute example updated; vectors vendored from sdk-conformance@65e1286.

Checks: 1267 tests pass (4 skipped); tsc clean; oxfmt 0.68 clean; the sdk-conformance suite passes. oxlint was not run locally: CI installs it from Nix, and the npm build of the same version rejects .oxlintrc.jsonc. CI's run is the check.

Release order: the server change renames the tools Node 3.0.0 looks up, so this must ship before the server change reaches production.

Update: on the merged server (unified-cloud-api#9417)

Stu's #9417 is merged and replaces unified-cloud-api#9398. It takes the accounts as a comma-separated x-account-id, serves the trio for two or more, and serves the account's own pair (<provider>_<accountId>_search_actions / _execute_action) for one, capped at 50. So now:

  • Listing: one comma-separated x-account-id query value (sorted, deduped) instead of repeated parameters; end users stay repeated x-end-user-id.
  • One account: the served pair is presented as stackone_search_actions / stackone_execute_action. Served names are rewritten in descriptions, schemas, results and error text, and hits gain available_accounts and provider. A stackone_account_id or provider naming that account is dropped (null too); any other raises ToolArgumentsError (account-outside-scope, provider-outside-scope) before any call. No stackone_list_accounts is invented.
  • More than 50 accounts in scope: too-many-accounts config error before any request.

The full sdk-conformance suite passes against both SDK branches, cross-SDK wire equality included; so do the sdk / pydantic / adk smoke scripts.

@willleeney
willleeney force-pushed the will/eng-3175-single-search-execute branch from fc32cc7 to 16a3dad Compare October 21, 2026 17:38
@willleeney willleeney changed the title feat!: one search tool and one execute tool spanning the account scope (ENG-3175) feat: one search tool and one execute tool spanning the account scope (ENG-3175) Oct 21, 2026
@willleeney
willleeney force-pushed the will/eng-3175-single-search-execute branch from 16a3dad to e5ad279 Compare October 28, 2026 15:36
… (ENG-3175)

search_execute mode now lists StackOne's stackone_search_actions /
stackone_execute_action / stackone_list_accounts once for the whole account scope,
naming every account as a repeated x-account-id query parameter, instead of a pair per
account. search() and execute() make one call each: hits name their accounts in
available_accounts rather than one hit per account, and the server, not the SDK,
refuses an action whose connector is linked on several accounts. The per-connector
merge, connector routing and failed-account retry are gone.

Changes for 3.0.0 callers: toolMode 'search_execute' serves the trio, not a pair per account;
search() hits carry available_accounts instead of account_id; an ambiguous execute()
throws StackOneAPIError from the server rather than ToolSetConfigError.

Follows unified-cloud-api#9417. A search_execute listing names its accounts as one
comma-separated x-account-id query value, and a scope of more than 50 accounts throws
ToolSetConfigError (too-many-accounts) before any request.

For one account the server serves <provider>_<accountId>_search_actions and
_execute_action rather than the trio. The SDK presents them as stackone_search_actions
and stackone_execute_action: the served names read as those names in descriptions,
schemas and result strings; a stackone_account_id or provider naming the account or its
connector is dropped, any other throws ToolArgumentsError (account-outside-scope,
provider-outside-scope); search hits gain provider and available_accounts. search(),
execute(), submitFeedback() and fetchTools() look the same for one or many accounts.

Changes for 3.0.0 callers: x-account-id is sent as one comma-separated value; search_execute
scopes are capped at 50 accounts; SearchHitAccount.name is optional.

Rebased onto main after #392 and #391; written in their lint style (oxlint 1.88).

Release-As: 3.1.0
@willleeney
willleeney force-pushed the will/eng-3175-single-search-execute branch from e5ad279 to 099fd1e Compare October 28, 2026 15:37
@pkg-pr-new

pkg-pr-new Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@389

commit: 3103b91

@pkg-pr-new

pkg-pr-new Bot commented Oct 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/StackOneHQ/stackone-ai-node/@stackone/ai@389

commit: e5ad279

… its matching PR (#231)

Both SDKs' conformance runs grade the pair together, and the new contract needs both on it.
The Python pin moves to its merge commit once #231 lands.
…packageManager

sdk-conformance moved to pnpm 11.17.0 (#12), and pnpm/action-setup refuses a version key that
disagrees with package_json_file. Each SDK checkout still runs its own pnpm 10.26.0: pnpm
switches to a project's packageManager version.
@willleeney
willleeney marked this pull request as ready for review October 29, 2026 09:06
Copilot AI balanced review requested due to automatic review settings October 29, 2026 09:06
@willleeney
willleeney requested a review from a team as a code owner October 29, 2026 09:06
@cubic-dev-ai

cubic-dev-ai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Running ultrareview automatically — this PR appears to change a public API contract, where a missed bug can break the clients and integrations that depend on it, so a deeper multi-pass review is worth running. I'll post findings when complete.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@willleeney
willleeney merged commit 8836040 into main Oct 29, 2026
30 of 31 checks passed
@willleeney
willleeney deleted the will/eng-3175-single-search-execute branch October 29, 2026 09:12
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