-
Notifications
You must be signed in to change notification settings - Fork 15
chore: migrate to claude agent sdk #2
base: master
Are you sure you want to change the base?
Conversation
* chore: migrate to claude agent sdk * feat: add CI workflow to build VSIX package
Reviewer's GuideThis PR migrates the extension from the deprecated ‘claude-code’ SDK to the new ‘claude-agent-sdk’, enriches session configuration and system message handling, and adds a CI workflow for building and packaging the VSIX extension. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
Blocking issues:
- An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload. (link)
General comments:
- Consider extracting the systemPrompt override logic into a dedicated helper to reduce nesting and improve readability in the session initialization.
- Add a guard or fallback for workspaceService.getWorkspaceFolders().at(0) returning undefined so cwd is never passed as undefined into the SDK options.
- Centralize the '@anthropic-ai/claude-agent-sdk' import path (and its CLI resolution) into a shared constant or config to simplify future SDK swaps and avoid duplication.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider extracting the systemPrompt override logic into a dedicated helper to reduce nesting and improve readability in the session initialization.
- Add a guard or fallback for workspaceService.getWorkspaceFolders().at(0) returning undefined so cwd is never passed as undefined into the SDK options.
- Centralize the '@anthropic-ai/claude-agent-sdk' import path (and its CLI resolution) into a shared constant or config to simplify future SDK swaps and avoid duplication.
## Individual Comments
### Comment 1
<location> `.github/workflows/build.yml:16` </location>
<code_context>
uses: pnpm/action-setup@v3
</code_context>
<issue_to_address>
**security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha):** An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
*Source: opengrep*
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
security (yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha): An action sourced from a third-party repository on GitHub is not pinned to a full length commit SHA. Pinning an action to a full length commit SHA is currently the only way to use an action as an immutable release. Pinning to a particular SHA helps mitigate the risk of a bad actor adding a backdoor to the action's repository, as they would need to generate a SHA-1 collision for a valid Git object payload.
Source: opengrep
chore: migrate to claude agent sdk
feat: add CI workflow to build VSIX package
Summary by Sourcery
Migrate the codebase from the deprecated claude-code SDK to the new claude-agent-sdk, add system prompt customization and enrich webview messages with metadata, and introduce a CI workflow to build and package the VSIX extension.
New Features:
Enhancements:
CI: