@hienlh/ppm 0.8.6 → 0.8.7

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.7] - 2026-03-23
4
+
5
+ ### Fixed
6
+ - **Env var diagnostics in timeout/error messages**: When SDK hangs or returns `unknown` error, error message now guides user to check `ANTHROPIC_API_KEY`/`ANTHROPIC_BASE_URL` env vars (stale/invalid keys cause silent hang) with exact debug commands
7
+ - **Shell env logging**: Log when shell environment has `ANTHROPIC_API_KEY`/`ANTHROPIC_BASE_URL` set — helps diagnose SDK hangs in server logs
8
+
3
9
  ## [0.8.6] - 2026-03-23
4
10
 
5
11
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hienlh/ppm",
3
- "version": "0.8.6",
3
+ "version": "0.8.7",
4
4
  "description": "Personal Project Manager — mobile-first web IDE with AI assistance",
5
5
  "author": "hienlh",
6
6
  "license": "MIT",
@@ -82,6 +82,12 @@ export class ClaudeAgentSdkProvider implements AIProvider {
82
82
  account: { id: string; accessToken: string } | null,
83
83
  ): Record<string, string | undefined> {
84
84
  const base = { ...process.env, ...this.getProjectEnvOverrides(projectPath) };
85
+ // Log if shell env has Anthropic vars — helps diagnose hanging SDK
86
+ for (const key of this.SENSITIVE_ENV_KEYS) {
87
+ if (process.env[key]) {
88
+ console.log(`[sdk] Shell env has ${key} set (length=${process.env[key]!.length})`);
89
+ }
90
+ }
85
91
  if (!account) return base;
86
92
  const isOAuthToken = account.accessToken.startsWith("sk-ant-oat");
87
93
  if (isOAuthToken) {
@@ -813,7 +819,7 @@ export class ClaudeAgentSdkProvider implements AIProvider {
813
819
  rate_limit: "Rate limited by the API. Please wait and try again.",
814
820
  invalid_request: "Invalid request sent to the API.",
815
821
  server_error: "Anthropic API server error. Try again shortly.",
816
- unknown: `API error in project "${effectiveCwd}". Debug: run \`cd ${effectiveCwd} && claude -p "hi"\` in your terminal. If that also fails, the issue is Claude CLI auth or project config (.claude/ folder). Try: 1) \`claude login\`, 2) Remove .claude/settings.local.json, 3) Create a new chat session.`,
822
+ unknown: `API error in project "${effectiveCwd}". Debug:\n1. Run: \`cd ${effectiveCwd} && claude -p "hi"\`\n2. Check env: \`echo $ANTHROPIC_API_KEY $ANTHROPIC_BASE_URL\` stale/invalid keys cause this\n3. Try: \`ANTHROPIC_API_KEY="" ANTHROPIC_BASE_URL="" claude -p "hi"\`\n4. Refresh auth: \`claude login\``,
817
823
  };
818
824
  const hint = errorHints[assistantError] ?? `API error: ${assistantError}`;
819
825
  yield { type: "error", message: hint };
@@ -138,7 +138,7 @@ async function runStreamLoop(sessionId: string, providerId: string, content: str
138
138
  const debugCmd = projectPath ? `cd ${projectPath} && claude -p "hi"` : `claude -p "hi"`;
139
139
  safeSend(sessionId, {
140
140
  type: "error",
141
- message: `Claude SDK timed out after ${elapsed}s for project "${projectPath || "(no project)"}".${wslHint}\n\nDebug steps:\n1. Run in your terminal: \`${debugCmd}\`\n2. Check for hanging hooks/MCP servers: \`cat ${projectPath}/.claude/settings.local.json\`\n3. Try removing project Claude config: \`mv ${projectPath}/.claude ${projectPath}/.claude.bak\`\n4. If none of the above helps, try: \`claude login\` to refresh auth`,
141
+ message: `Claude SDK timed out after ${elapsed}s for project "${projectPath || "(no project)"}".${wslHint}\n\nDebug steps:\n1. Run: \`${debugCmd}\` — if it also hangs, the issue is your Claude CLI environment\n2. Check env vars: \`echo $ANTHROPIC_API_KEY $ANTHROPIC_BASE_URL\` — stale/invalid keys cause silent hang\n3. Try with env cleared: \`ANTHROPIC_API_KEY="" ANTHROPIC_BASE_URL="" ${debugCmd}\`\n4. Check hooks/MCP: \`cat ${projectPath}/.claude/settings.local.json\`\n5. Refresh auth: \`claude login\``,
142
142
  });
143
143
  abortController.abort();
144
144
  return;