From d250d6efa7a4b7b4ced5b9d83b64709d872a1850 Mon Sep 17 00:00:00 2001 From: leo-jiqimao Date: Sun, 15 Mar 2026 08:18:26 +0800 Subject: [PATCH] fix: address Codex review feedback (3 issues) - Fix SDK check to verify local node_modules instead of global npm - Align monitor metrics documentation with CLI flags (CPU/Memory) - Add pagination support for instance listing (--page, --page-size) --- PR_DESCRIPTION.md | 38 ++++++++++++++++++++++++ skills/aliyun-ecs-skill/SKILL.md | 14 ++++----- skills/aliyun-ecs-skill/scripts/setup.sh | 8 ++--- skills/aliyun-ecs-skill/src/index.js | 17 +++++++++-- 4 files changed, 61 insertions(+), 16 deletions(-) create mode 100644 PR_DESCRIPTION.md diff --git a/PR_DESCRIPTION.md b/PR_DESCRIPTION.md new file mode 100644 index 00000000000..5c0228e4308 --- /dev/null +++ b/PR_DESCRIPTION.md @@ -0,0 +1,38 @@ +# PR Description + +## What & Why + +Improved the "good first issue" link in CONTRIBUTING.md to directly filter issues with the label, making it easier for new contributors to find entry points. + +### Before +``` +Check the [GitHub Issues](https://github.com/openclaw/openclaw/issues) for "good first issue" labels! +``` +- Required manual filtering +- Extra step for newcomers + +### After +``` +Check the [good first issues](https://github.com/openclaw/openclaw/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) to get started! +``` +- One-click access to filtered issues +- Better newcomer experience + +## Type of Change +- [ ] Bug fix +- [ ] New feature +- [ ] Breaking change +- [x] Documentation improvement + +## Testing +- [x] Verified the link works correctly +- [x] Checked markdown rendering + +## Checklist +- [x] Change is focused (single concern) +- [x] Description explains what & why +- [ ] ~~Screenshots included~~ (N/A - text change only) + +--- + +**Note:** This is my first contribution to OpenClaw. Excited to be part of the community! 🦞 diff --git a/skills/aliyun-ecs-skill/SKILL.md b/skills/aliyun-ecs-skill/SKILL.md index c202f3be0ad..db842c14127 100644 --- a/skills/aliyun-ecs-skill/SKILL.md +++ b/skills/aliyun-ecs-skill/SKILL.md @@ -122,15 +122,15 @@ aliyun-ecs restart --region cn-hangzhou --id i-xxxxxxxxxx ```bash # 获取监控数据(CPU、内存、网络) -aliyun-ecs monitor --region cn-hangzhou --id i-xxxxxxxxxx --metrics CPUUtilization,MemoryUtilization +aliyun-ecs monitor --region cn-hangzhou --id i-xxxxxxxxxx --metrics CPU,Memory # 支持的监控指标: -# CPUUtilization - CPU使用率 -# MemoryUtilization - 内存使用率 -# InternetInRate - 公网入带宽 -# InternetOutRate - 公网出带宽 -# DiskReadIOPS - 磁盘读IOPS -# DiskWriteIOPS - 磁盘写IOPS +# CPU - CPU使用率 +# Memory - 内存使用率 +# InternetIn - 公网入带宽(Kbps) +# InternetOut - 公网出带宽(Kbps) +# IntranetIn - 内网入带宽(Kbps) +# IntranetOut - 内网出带宽(Kbps) ``` ### 快照管理 diff --git a/skills/aliyun-ecs-skill/scripts/setup.sh b/skills/aliyun-ecs-skill/scripts/setup.sh index e671bd6ceb7..014484c48e5 100755 --- a/skills/aliyun-ecs-skill/scripts/setup.sh +++ b/skills/aliyun-ecs-skill/scripts/setup.sh @@ -32,16 +32,12 @@ node_check() { # 检查阿里云SDK sdk_check() { - if npm list -g @alicloud/openapi-client &> /dev/null; then + # 优先检查本地 node_modules(skill 运行时从这里加载) + if [ -d "$SCRIPT_DIR/../node_modules/@alicloud/openapi-client" ] && [ -d "$SCRIPT_DIR/../node_modules/@alicloud/ecs20140526" ]; then echo -e "${GREEN}✓ 阿里云SDK已安装${NC}" return 0 fi - if npm list @alicloud/openapi-client &> /dev/null 2>&1; then - echo -e "${GREEN}✓ 阿里云SDK已安装(本地)${NC}" - return 0 - fi - echo -e "${YELLOW}⚠ 阿里云SDK未安装${NC}" return 1 } diff --git a/skills/aliyun-ecs-skill/src/index.js b/skills/aliyun-ecs-skill/src/index.js index 2b47f1c9e1f..c68d7aebe45 100755 --- a/skills/aliyun-ecs-skill/src/index.js +++ b/skills/aliyun-ecs-skill/src/index.js @@ -136,10 +136,20 @@ async function main() { console.error('错误: 请提供 --region 参数'); process.exit(1); } - const instances = await ecs.describeInstances(options.region); - console.log(`\n地域 ${options.region} 的实例列表:\n`); + const pageSize = parseInt(options['page-size']) || 20; + const pageNumber = parseInt(options.page) || 1; + const listOptions = { + pageSize: pageSize, + pageNumber: pageNumber, + }; + const instances = await ecs.describeInstances(options.region, listOptions); + console.log(`\n地域 ${options.region} 的实例列表 (第${pageNumber}页, 每页${pageSize}条):\n`); if (instances.length === 0) { - console.log('暂无实例'); + if (pageNumber > 1) { + console.log('该页无实例,可能是已到达末尾'); + } else { + console.log('暂无实例'); + } } else { console.log(formatTable(instances.map(inst => ({ ...inst, @@ -152,6 +162,7 @@ async function main() { { key: 'instanceType', header: '类型' }, { key: 'ip', header: 'IP地址' }, ])); + console.log(`\n提示: 使用 --page N 查看下一页,--page-size N 调整每页数量`); } break; }