Skip to content

V3 review fixes#234

Merged
DavyJohnes merged 15 commits intobetafrom
v3-review-fixes
Apr 16, 2026
Merged

V3 review fixes#234
DavyJohnes merged 15 commits intobetafrom
v3-review-fixes

Conversation

@DavyJohnes
Copy link
Copy Markdown
Contributor

No description provided.

DavyJohnes and others added 12 commits April 15, 2026 16:45
The condition `if (Message_MessageStatus.MESSAGE_STATUS_UNSPECIFIED)` was
checking the enum constant's truthy value instead of comparing it to
`message.status`. This caused the check to always pass, making the code
below unreachable (assistant run creation and listening).

Fixed by adding `=== message.status` comparison.

Also replaced all `throw 'string'` with `throw new Error('string')` to
preserve stack traces and enable proper `instanceof Error` checks in
catch blocks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Typo in public API method name: "Short" should be "Shot" (as in
few-shot classification). Since this is a public method that will become
part of the v3 API surface, fixing it now avoids a breaking change later.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PollOperationWasCanceled and PollOperationEmptyResponseForDecoder were
plain classes without Error inheritance. This means they had no stack
trace, failed `instanceof Error` checks, and behaved unexpectedly in
catch blocks.

Now both extend Error with proper name and message properties.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The polling function inside pollOperation() called this.get() without a
.catch() handler. If the gRPC call failed (network error, timeout, auth
failure), the promise rejection went unhandled and the polling silently
hung forever without resolving or rejecting the outer promise.

Added .catch(reject) to propagate errors to the caller.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
"is no defined" → "is not defined"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CodeQL flagged shell command injection: file paths from the filesystem
were interpolated into shell command strings passed to cp.execSync().
Although these are dev-only scripts and the risk is low, using
cp.execFileSync() with an argument array avoids shell interpretation
entirely and is the safer pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Previously, refreshData() set up a detached .then(updateData) chain
alongside a .finally() that nulled threadP. This created two issues:

1. The .then(updateData) was a separate promise chain from the one
   returned to callers, so errors in updateData went unhandled.
2. The .finally() nulling threadP could race with the detached .then(),
   leaving stale data if a new refresh was triggered immediately after.

Now updateData is chained inline before .finally(), ensuring a single
promise chain with predictable ordering.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove webpack, webpack-cli, ts-loader, @types/webpack,
@types/webpack-dev-server, @webpack-cli/generators, and
tsconfig-paths-webpack-plugin from devDependencies. No webpack config
file exists in the repository and nothing in the build/test pipeline
uses webpack.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Both .eslintrc.json and eslint.config.mjs existed, which causes
confusion — different ESLint versions pick up different config files.
The project uses ESLint 8.x with the traditional .eslintrc.json config,
so remove the flat config file (eslint.config.mjs) and its related
dependencies (@eslint/js, globals, typescript-eslint) that are only
needed for ESLint v9 flat config.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reflect dependency removals (webpack, ESLint flat config packages)
in the lockfile.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the src/sdk directory containing higher-level wrappers on top of
raw gRPC clients (AI assistants, AI files, AI foundation models, and
operation polling). The wrappers used fragile patterns (Promise mutation
via Object.assign for fluent APIs) and duplicated functionality that
consumers can build directly from the generated clients.

Also removes:
- The 4 example files that depended on this SDK layer:
  - examples/assistant-with-search-index.ts
  - examples/chat-with-assistant-sdk.ts
  - examples/generate-image-sdk.ts
  - examples/save-file-for-ai.ts
- The 4 corresponding package.json subpath exports:
  - ./sdk/ai-assistants-v1
  - ./sdk/ai-files-v1
  - ./sdk/ai-foundation_models-v1
  - ./sdk/operation
- The "SDK layer" section in CLAUDE.md.

BREAKING CHANGE: Consumers must use the generated gRPC clients
directly instead of initFileSdk/initAssistantSdk/etc. helpers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@GermanVor
Copy link
Copy Markdown
Contributor

Like

@DavyJohnes DavyJohnes merged commit 1769c87 into beta Apr 16, 2026
7 checks passed
@yandex-cloud-bot
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 3.0.0-beta.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@yandex-cloud-bot
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants