Skip to content

fix(ci): repair main after the nix flake input update - #392

Merged
willleeney merged 7 commits into
mainfrom
s2d2/fix-main-after-flake-update
Oct 28, 2026
Merged

willleeney merged 7 commits into
mainfrom
s2d2/fix-main-after-flake-update

Conversation

@glebedel

@glebedel glebedel commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Main has been red since the nix flake update in #313 (merged by the scheduled workflow, so CI never ran on it). #391 was the first PR to run on top of it and failed on two things this fixes:

  • flake.nix: typescript-go -> typescript. nixpkgs replaced the alias with a throw ('typescript-go' has been renamed to/replaced by 'typescript', aliases.nix, added 2026-09-08), so nix develop no longer evaluates and dry-publish fails. tsdown's tsgo resolves @typescript/native-preview from node_modules, so the build does not depend on the nix package.
  • .oxlintrc.jsonc: import/consistent-type-specifier-style top-level -> prefer-top-level. The oxlint now in the shell rejects the old variant name (unknown variant top-level, expected one of prefer-top-level, prefer-inline, ...), so pnpm lint fails to parse the config. Same rule behaviour.
  • src/toolsets.search-execute.test.ts, src/vectors.test.ts: reformatted with the oxfmt 0.68.0 now in the shell (lint:oxfmt flagged both). Whitespace only.

Requested by guillaume@stackone.com in Slack (follow-up to SEC-104 Node pinning).

🤖 Generated with Claude Code

The flake update in #313 moved nixpkgs past two breaking changes, and CI
had not run on main since, so the first PR on top of it went red:

- nixpkgs removed the typescript-go alias ("renamed to/replaced by
  typescript"), so every nix develop failed to evaluate. tsdown's tsgo
  comes from @typescript/native-preview in node_modules, not from nix.
- the newer oxlint only accepts prefer-top-level for
  import/consistent-type-specifier-style, so lint failed to parse the
  config. prefer-top-level is the same behaviour under its current name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@glebedel
glebedel requested a review from a team as a code owner October 26, 2026 17:49
Copilot AI balanced review requested due to automatic review settings October 26, 2026 17:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T17:50:26.018947Z 0238dd5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@pkg-pr-new

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

Copy link
Copy Markdown

Open in StackBlitz

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

commit: 4465e6c

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.

cubic-dev-ai[bot]
cubic-dev-ai Bot previously approved these changes Oct 26, 2026

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Fixes broken CI/dev environment after nixpkgs and oxlint updates: uses the canonical typescript package name and the renamed oxlint option with identical behavior. Config-only changes with no product, rollout, or operational impact.

View guided diff | Turn on auto-fix | Re-trigger cubic

s2d2-s1 and others added 4 commits October 26, 2026 17:52
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt's safe fixes

oxlint reads .oxlintrc.jsonc only from 1.52.0, so until the flake update this config was
never loaded and CI linted with oxlint's 104 default rules. 1.88 applies it as written. The
pedantic and style categories are turned off until they are adopted on their own; the rules
named one by one still apply. oxlint --fix applied the safe fixes.
….88 reports

Type guards and narrowing in place of casts, explicit nullish checks, hoisted closures,
named no-ops and a sorted() helper (ES2022 has no toSorted). Where a cast or an awaited
loop is the point, a one-line oxlint-disable-next-line says why. No behaviour change.
…on their declarations

Review of the lint pass: where a truthiness test met values a plain JavaScript caller can make
falsy in ways the types forbid (null filters, a null tool mode, stored OpenAI tool calls, a
null schema type), the explicit comparisons accepted or rejected different values. An
isTruthy() guard tests exactly what the old truthiness test did. The StackOneToolSet and
toArray JSDoc blocks are back on their declarations.
@willleeney

Copy link
Copy Markdown
Contributor

I pushed three commits here to get lint green, so this can merge and #391 after it.

Why lint fails with your two fixes in place. oxlint only reads .oxlintrc.jsonc from 1.52.0 (changelog, "Add .oxlintrc.jsonc config file support"). On 1.42, what CI used until #313, the file was never loaded: main's last green run linted "with 104 rules", which is oxlint's default set, and 1.42 run locally without -c gives the same 104. 1.88 is the first version to apply the config as written: 452 rules, 4,262 findings, mostly from the pedantic and style categories in code that was never held to them.

What the commits do:

  • a65e079: pedantic and style set to off, with a comment saying why; the rules named one by one still apply. Then oxlint --fix's safe fixes.
  • b00989f: the remaining 404 findings from correctness, suspicious, perf and the named rules. Mostly type guards instead of casts, explicit checks for strict-boolean-expressions, hoisted closures, and a sorted() helper, since ES2022 has no toSorted. 52 oxlint-disable-next-line comments, each with its reason, where a cast or a sequential await is intended.
  • e82d525: review fixes. An isTruthy() guard keeps the old falsy-value handling exactly where plain-JS callers can pass values the types forbid. Two JSDoc blocks are back on their declarations.

No behaviour change is intended; a reviewer checked the source diff for one. Locally, with oxlint 1.88.0 and tsgolint 7.0.2003 pinned to match the nix shell: lint 0 findings, tsc clean, vitest 1288 passed, build and oxfmt clean.

Adopting pedantic/style (about 4,000 findings, roughly 1,500 auto-fixable) is left for its own PR.

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 40 files (changes from recent commits).

Confidence score: 3/5

  • In examples/anthropic-integration.ts, an explicitly empty STACKONE_ACCOUNT_ID becomes undefined, bypassing the constructor’s validation and exposing tools for every active account. Pass accountId through so the constructor can reject the empty value.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="examples/anthropic-integration.ts">

<violation number="1" location="examples/anthropic-integration.ts:23">
P2: This converts an explicitly empty `STACKONE_ACCOUNT_ID` to `undefined`, bypassing the constructor’s `ToolSetConfigError` and widening the toolset to every active account. Pass `accountId` through so the constructor rejects the empty value.

(Based on your team's feedback about empty account IDs.)</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread examples/search-and-execute.ts Resolved
// without one, the toolset uses every active shared account linked to the key
const toolset = new StackOneToolSet({ accountId: process.env.STACKONE_ACCOUNT_ID || undefined });
const accountId = process.env.STACKONE_ACCOUNT_ID;
const toolset = new StackOneToolSet({ accountId: accountId === '' ? undefined : accountId });

@cubic-dev-ai cubic-dev-ai Bot Oct 28, 2026 •

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.

P2: This converts an explicitly empty STACKONE_ACCOUNT_ID to undefined, bypassing the constructor’s ToolSetConfigError and widening the toolset to every active account. Pass accountId through so the constructor rejects the empty value.

(Based on your team's feedback about empty account IDs.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At examples/anthropic-integration.ts, line 23:

<comment>This converts an explicitly empty `STACKONE_ACCOUNT_ID` to `undefined`, bypassing the constructor’s `ToolSetConfigError` and widening the toolset to every active account. Pass `accountId` through so the constructor rejects the empty value.

(Based on your team's feedback about empty account IDs.) </comment>

<file context>
@@ -7,19 +7,20 @@ import Anthropic from '@anthropic-ai/sdk';
 	// without one, the toolset uses every active shared account linked to the key
-	const toolset = new StackOneToolSet({ accountId: process.env.STACKONE_ACCOUNT_ID || undefined });
+	const accountId = process.env.STACKONE_ACCOUNT_ID;
+	const toolset = new StackOneToolSet({ accountId: accountId === '' ? undefined : accountId });
 
 	// Filter for any relevant tools
</file context>
Suggested change
const toolset = new StackOneToolSet({ accountId: accountId === '' ? undefined : accountId });
const toolset = new StackOneToolSet({ accountId });
Fix with cubic

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.

Not a change: before this PR the line was accountId: process.env.STACKONE_ACCOUNT_ID || undefined, which also turns an empty value into undefined. The rewrite keeps that behaviour exactly; changing what the example does with an empty variable is out of scope for a lint repair.

Comment thread src/utils/error-stackone-api.ts Resolved
Comment thread src/headers.ts Resolved
Comment thread src/utils/type.ts Resolved
@cubic-dev-ai
cubic-dev-ai Bot dismissed their stale review October 28, 2026 11:43

Dismissed because Cubic found issues in a newer review.

@cubic-dev-ai cubic-dev-ai Bot 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.

0 issues found across 1 file (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 5 unresolved issues from previous reviews.

View guided diff | Turn on auto-fix | Re-trigger cubic

cubic's review of the lint pass: ten checks rewritten to isNonEmpty treated false and 0 as
present, which a plain JavaScript caller can pass (endUserId: false sent x-end-user-id:
false), and isTruthy narrowed broad types wrongly in its false branch. isTruthy is now a
plain boolean, isTruthyString narrows strings while testing exactly what if (value) did,
providerErrors is null-safe again, and the example keeps its Number() coercion. Tests pin
both helpers to a bare truthiness test.

@cubic-dev-ai cubic-dev-ai Bot 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.

0 issues found across 9 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: CI repair disables oxlint pedantic/style and bundles large src/mock/example refactors beyond the described flake update; truncated diff prevents verifying the refactors are behavior-preserving, so the lint-policy relaxation and runtime changes need human sign-off.

View guided diff | Turn on auto-fix | Re-trigger cubic

@willleeney
willleeney merged commit 51ffccd into main Oct 28, 2026
39 of 42 checks passed
@willleeney
willleeney deleted the s2d2/fix-main-after-flake-update branch October 28, 2026 14:24
willleeney added a commit that referenced this pull request Oct 28, 2026
… (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.

Release-As: 3.1.0

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 added a commit that referenced this pull request Oct 28, 2026
… (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 added a commit that referenced this pull request Oct 29, 2026
… (ENG-3175) (#389)

* feat: one search tool and one execute tool spanning the account scope (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

* ci(ENG-3175): pin sdk-conformance at #9's merge and the Python SDK at 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.

* ci(ENG-3175): take the conformance job's pnpm from sdk-conformance's 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.
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.

4 participants