github / github/copilot-sdk

nodejs/cli-extension: resolving sdk paths and error log should be improved

未关闭
#946 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
10.5k
派生
1.5k
平均合并
1 天 14 小时
30 天内合并 PR
129

描述

1. Doing like this will result error: `Error: Cannot find package '@github/copilot-sdk' imported from ...`
```ts
import { joinSession } from "@github/copilot-sdk/extension.js";
```
instead of..
```ts
import { joinSession } from "@github/copilot-sdk/extension";
```
(`.js` difference)

2. Error handling should be more improved, at CLI `v1.0.12`, it shows only single line not stacktrace etc, so hard to debug. e.g:

```
[INFO] Launching extension: /tmp/copilot/test/.github/extensions/test/extension.mjs
[INFO] [extension:/tmp/copilot/test/.github/extensions/test/extension.mjs] [extension-bootstrap] Failed to load extension: SyntaxError: Unexpected token 'export'
[INFO] Extension exited: /tmp/copilot/test/.github/extensions/test/extension.mjs (code=1, signal=null)
[ERROR] Extension failed during startup: /tmp/copilot/test/.github/extensions/test/extension.mjs (code=1, signal=null)
```

```
[INFO] Found 1 extension(s), launching 1 (0 disabled)
[INFO] Launching extension: /tmp/copilot/test/.github/extensions/test/extension.mjs
[INFO] [extension:/tmp/copilot/test/.github/extensions/test/extension.mjs] [extension-bootstrap] Failed to load extension: Error: Invalid package config /tmp/copilot/test/.github/extensions/test/package.json.
[INFO] Extension exited: /tmp/copilot/test/.github/extensions/test/extension.mjs (code=1, signal=null)
[ERROR] Extension failed during startup: /tmp/copilot/test/.github/extensions/test/extension.mjs (code=1, signal=null)
```

贡献指南

打开贡献指南

调研方向

使用 issue 中的示例重现 SDK 导入失败和扩展启动错误。跟踪 CLI 的扩展路径解析和启动错误日志记录;完成标准是扩展导入无需 .js 后缀即可正常工作,并且启动失败会显示有用的堆栈跟踪,而不是只有一行摘要。

由索引模型根据 Issue 内容生成。

评估

技术栈
node.js, typescript
领域
cli, developer-experience
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。