@hienlh/ppm 0.8.47 → 0.8.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/src/providers/claude-agent-sdk.ts +7 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.8.48] - 2026-03-25
|
|
4
|
+
|
|
5
|
+
### Fixed
|
|
6
|
+
- **Account auth errors**: Use cooldown instead of permanent disable on `authentication_failed` / 401 — auth issues can be transient (subscription lapse, org changes, API hiccups)
|
|
7
|
+
- **SDK refresh safety**: Pass `disableOnFail=false` in SDK error handlers — prevents `refreshAccessToken` from disabling accounts as side effect during auto-retry
|
|
8
|
+
|
|
3
9
|
## [0.8.47] - 2026-03-25
|
|
4
10
|
|
|
5
11
|
### Fixed
|
package/package.json
CHANGED
|
@@ -611,7 +611,7 @@ export class ClaudeAgentSdkProvider implements AIProvider {
|
|
|
611
611
|
if (assistantError === "authentication_failed" && account && !authRetried) {
|
|
612
612
|
authRetried = true;
|
|
613
613
|
try {
|
|
614
|
-
await accountService.refreshAccessToken(account.id);
|
|
614
|
+
await accountService.refreshAccessToken(account.id, false);
|
|
615
615
|
console.log(`[sdk] session=${sessionId} OAuth token refreshed for ${account.id} — retrying`);
|
|
616
616
|
// Re-build env with refreshed token
|
|
617
617
|
const refreshedAccount = accountService.getWithTokens(account.id);
|
|
@@ -628,10 +628,9 @@ export class ClaudeAgentSdkProvider implements AIProvider {
|
|
|
628
628
|
}
|
|
629
629
|
} catch (refreshErr) {
|
|
630
630
|
console.error(`[sdk] session=${sessionId} OAuth refresh failed:`, refreshErr);
|
|
631
|
-
//
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
}
|
|
631
|
+
// Cooldown instead of permanent disable — auth issues can be transient
|
|
632
|
+
// (subscription lapse, org changes, API hiccups)
|
|
633
|
+
accountSelector.onRateLimit(account.id);
|
|
635
634
|
}
|
|
636
635
|
}
|
|
637
636
|
|
|
@@ -702,13 +701,11 @@ export class ClaudeAgentSdkProvider implements AIProvider {
|
|
|
702
701
|
} else if (errCode === 401) {
|
|
703
702
|
// Try refresh once
|
|
704
703
|
try {
|
|
705
|
-
await accountService.refreshAccessToken(account.id);
|
|
704
|
+
await accountService.refreshAccessToken(account.id, false);
|
|
706
705
|
console.log(`[sdk] 401 on account ${account.id} — token refreshed`);
|
|
707
706
|
} catch {
|
|
708
|
-
//
|
|
709
|
-
|
|
710
|
-
accountSelector.onAuthError(account.id);
|
|
711
|
-
}
|
|
707
|
+
// Cooldown instead of permanent disable — auth issues can be transient
|
|
708
|
+
accountSelector.onRateLimit(account.id);
|
|
712
709
|
}
|
|
713
710
|
} else {
|
|
714
711
|
accountSelector.onSuccess(account.id);
|