Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/services/clients/claude/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ export class Claude {
if (!sessionKey) {
throw new Error('Session key required')
}
if (!sessionKey.startsWith('sk-ant-sid01')) {
throw new Error('Session key invalid: Must be in the format sk-ant-sid01-*****')
if (!sessionKey.startsWith('sk-ant-sid')) {
throw new Error('Session key invalid: Must be in the format sk-ant-sid01-***** or sk-ant-sid02-*****')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The logic has been updated to generically accept any session key starting with sk-ant-sid, which is a good improvement for future-proofing. However, the error message still explicitly lists only sid01 and sid02. If Anthropic releases a sid03 format in the future, this message will become misleading to users because the code would actually accept the key, but the error message would imply it is unsupported. It is better to use a more generic error message that matches the implementation's flexibility.

Suggested change
if (!sessionKey.startsWith('sk-ant-sid')) {
throw new Error('Session key invalid: Must be in the format sk-ant-sid01-***** or sk-ant-sid02-*****')
if (!sessionKey.startsWith('sk-ant-sid')) {
throw new Error('Session key invalid: Must be in the format sk-ant-sid...')
}

Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
}
if (fetch) {
this.fetch = fetch
Expand Down