Skip to content

Conversation

@OhYee
Copy link
Member

@OhYee OhYee commented Jan 30, 2026

Thank you for creating a pull request to contribute to Serverless Devs agentrun-sdk-python code! Before you open the request please answer the following questions to help it be more easily integrated. Please check the boxes "[ ]" with "[x]" when done too.
Please select one of the PR types below to complete


Fix bugs

Bug detail

The specific manifestation of the bug or the associated issue.

Pull request tasks

  • Add test cases for the changes
  • Passed the CI test

Update docs

Reason for update

Why do you need to update your documentation?

Pull request tasks

  • Update Chinese documentation
  • Update English documentation

Add contributor

Contributed content

  • Code
  • Document

Content detail

if content_type == 'code' || content_type == 'document':
    please tell us `PR url`,like: https://github.com/Serverless-Devs/agentrun-sdk-python/pull/1
else:
    please describe your contribution in detail

Others

Reason for update

Why do you need to update your documentation?

OhYee added 2 commits January 30, 2026 12:28
Adds a version check mechanism across all modules to ensure
compatibility and adds a build script to inject version checks
during build process. Removes old breaking changes warning
and implements global debug log prevention.

更新:在所有模块中添加版本检查机制以确保兼容性,
并在构建过程中添加注入版本检查的构建脚本。
移除旧的破坏性更改警告并实现全局调试日志预防。

BREAKING CHANGE: removes old breaking changes warning in favor
of new version check mechanism

重大变更:移除旧的破坏性更改警告,改为新的版本检查机制

Change-Id: Ia2dba4bca48c2e0bedd19c60c5467a790f11ad4a
Signed-off-by: OhYee <[email protected]>
adds prettier configuration and integrates it into the linting workflow to enforce consistent code style across the project. also updates eslint configuration to include prettier rules and adds format commands to package.json.

adds prettier 配置并将其集成到 linting 工作流程中,以在整个项目中强制执行一致的代码样式。还更新了 eslint 配置以包含 prettier 规则,并在 package.json 中添加了格式化命令。

Change-Id: I077c5695ff26d06b27fd983fbfaa212370180329
Signed-off-by: OhYee <[email protected]>
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request implements code formatting standardization using Prettier and refactors the SDK's version warning system. The PR transforms the codebase to follow consistent formatting rules and moves the breaking changes warning from src/index.ts to a new centralized version check module that is automatically imported across all entry points.

Changes:

  • Added Prettier configuration and integrated it with ESLint for automated code formatting
  • Refactored version warning system into a new src/utils/version-check.ts module with deduplication logic
  • Applied consistent code formatting across all TypeScript files (quote style, arrow functions, line breaks, trailing commas)

Reviewed changes

Copilot reviewed 144 out of 150 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
.prettierrc, .prettierignore New Prettier configuration with rules for consistent code formatting
.eslintrc.json Updated to integrate Prettier with ESLint for unified linting/formatting
package.json Added Prettier dependency, updated build and format scripts
src/utils/version-check.ts New module centralizing version warning with global deduplication
src/utils/log.ts Added deduplication for debug logging warning
src/index.ts Removed inline version warning code (moved to version-check module)
scripts/inject-version-check.mjs New script to auto-inject version check imports into all index.ts files
All */index.ts files Added import '@/utils/version-check' statement
Test files Applied consistent formatting (quotes, spacing, arrow functions, trailing commas)
Example files Applied consistent formatting
Documentation Updated formatting in README and templates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

) {
(globalThis as any)._AGENTRUN_VERSION_WARNING_SHOWN = true;
logger.warn(
`当前您正在使用 AgentRun Node.js SDK 版本 ${VERSION}。早期版本通常包含许多新功能,这些功能 可能引入不兼容的变更 。为避免潜在问题,我们强烈建议 将依赖锁定为此版本 。\nYou are currently using AgentRun Node.js SDK version ${VERSION}. Early versions often include many new features, which may introduce breaking changes. To avoid potential issues, we strongly recommend pinning the dependency to this version.\n npm install "@agentrun/sdk@${VERSION}"\n bun add "@agentrun/sdk@${VERSION}"\n\n增加 DISABLE_BREAKING_CHANGES_WARNING=1 到您的环境变量以关闭此警告。\nAdd DISABLE_BREAKING_CHANGES_WARNING=1 to your environment variables to disable this warning.\n\nReleases: https://github.com/Serverless-Devs/agentrun-sdk-nodejs/releases`
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The warning message on line 12 contains extra spaces in the Chinese text that appear to be formatting errors. The phrase "这些功能 可能引入不兼容的变更 。" has spaces before "可能引入不兼容的变更" and before the period, and "我们强烈建议 将依赖锁定为此版本 。" has spaces before "将依赖锁定为此版本" and before the period. These should be removed for proper Chinese grammar.

Copilot uses AI. Check for mistakes.

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const projectRoot = resolve(__dirname, '..');
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Unused variable projectRoot.

Suggested change
const projectRoot = resolve(__dirname, '..');

Copilot uses AI. Check for mistakes.
BackendType,
ModelType,
} from '../../../src/model';
import { ModelClient, ModelService, ModelProxy, BackendType, ModelType } from '../../../src/model';
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Unused imports BackendType, ModelClient.

Copilot uses AI. Check for mistakes.
ResourceNotExistError,
ResourceAlreadyExistError,
} from '../../../src/utils/exception';
import { ResourceNotExistError, ResourceAlreadyExistError } from '../../../src/utils/exception';
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

Unused import ResourceAlreadyExistError.

Copilot uses AI. Check for mistakes.
Change npm test command to make coverage for improved test reporting

  将 npm 测试命令更改为 make coverage,以改进测试报告

Change-Id: I25cf5b0c4b48bc4a2811fde07f7417e03577b001
Signed-off-by: OhYee <[email protected]>
@OhYee OhYee merged commit 5770fc9 into main Jan 30, 2026
9 checks passed
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