Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(agent): map the new claude startup failure reasons (#126187)

Alessandro Pogliaghi7856eb27f8a0
diff --git a/packages/agent/packages/agent-contracts/src/startup-failure.ts b/packages/agent/packages/agent-contracts/src/startup-failure.ts
index 4e1adff84b12..6416659ddfe3 100644
--- a/packages/agent/packages/agent-contracts/src/startup-failure.ts
+++ b/packages/agent/packages/agent-contracts/src/startup-failure.ts
@@ -23,6 +23,10 @@ export const startupFailureSchema = z.object({
"worktree_unverified",
"cli_version_too_old",
"bypass_root",
+ "sandbox_required_unavailable",
+ "provider_not_allowed",
+ "org_config_required_unavailable",
+ "org_config_refused",
])
.nullable(),
retryability: z.enum(["requires_action", "transient", "unknown"]),
diff --git a/packages/agent/packages/agent/package.json b/packages/agent/packages/agent/package.json
index c7c3f569319d..e7787949967d 100644
--- a/packages/agent/packages/agent/package.json
+++ b/packages/agent/packages/agent/package.json
@@ -178,7 +178,7 @@
},
"dependencies": {
"@agentclientprotocol/sdk": "1.1.0",
- "@anthropic-ai/claude-agent-sdk": "0.3.280",
+ "@anthropic-ai/claude-agent-sdk": "0.3.314",
"@anthropic-ai/sdk": "0.109.0",
"@earendil-works/pi-agent-core": "catalog:",
"@earendil-works/pi-ai": "catalog:",
diff --git a/packages/agent/packages/agent/src/adapters/claude/session/initialization.test.ts b/packages/agent/packages/agent/src/adapters/claude/session/initialization.test.ts
index 2173073e983e..1e359dffaab3 100644
--- a/packages/agent/packages/agent/src/adapters/claude/session/initialization.test.ts
+++ b/packages/agent/packages/agent/src/adapters/claude/session/initialization.test.ts
@@ -141,6 +141,10 @@ describe("SessionInitialization", () => {
["proxy_invalid", "requires_action"],
["worktree_unverified", "transient"],
["org_verify_failed", "unknown"],
+ ["sandbox_required_unavailable", "requires_action"],
+ ["provider_not_allowed", "requires_action"],
+ ["org_config_required_unavailable", "unknown"],
+ ["org_config_refused", "requires_action"],
["future_provider_reason", "unknown"],
[null, "unknown"],
])(
diff --git a/packages/agent/packages/agent/src/adapters/claude/session/initialization.ts b/packages/agent/packages/agent/src/adapters/claude/session/initialization.ts
index 35d8c737d960..774987b81791 100644
--- a/packages/agent/packages/agent/src/adapters/claude/session/initialization.ts
+++ b/packages/agent/packages/agent/src/adapters/claude/session/initialization.ts
@@ -42,6 +42,10 @@ const startupRetryability = {
worktree_unverified: "transient",
cli_version_too_old: "requires_action",
bypass_root: "requires_action",
+ sandbox_required_unavailable: "requires_action",
+ provider_not_allowed: "requires_action",
+ org_config_required_unavailable: "unknown",
+ org_config_refused: "requires_action",
} satisfies Record<SDKStartupFailureReason, StartupFailure["retryability"]>;
const startupResultSchema = z.object({
diff --git a/packages/agent/pnpm-lock.yaml b/packages/agent/pnpm-lock.yaml
index cc85b02194dc..8a0dd9e9f8d8 100644
--- a/packages/agent/pnpm-lock.yaml
+++ b/packages/agent/pnpm-lock.yaml
@@ -68,8 +68,8 @@ importers:
specifier: 1.1.0
version: 1.1.0([email protected])
'@anthropic-ai/claude-agent-sdk':
- specifier: 0.3.280
- version: 0.3.280(@anthropic-ai/[email protected]([email protected]))(@modelcontextprotocol/[email protected]([email protected]))([email protected])
+ specifier: 0.3.314
+ version: 0.3.314(@anthropic-ai/[email protected]([email protected]))(@modelcontextprotocol/[email protected]([email protected]))([email protected])
'@anthropic-ai/sdk':
specifier: 0.109.0
version: 0.109.0([email protected])
@@ -298,53 +298,53 @@ packages:
peerDependencies:
zod: 4.4.3
- '@anthropic-ai/[email protected]':
- resolution: {integrity: sha512-Yws14X5g5hgDtF565Tld/+dILAhH9QZpundjKMyO3dFasq9miXZlhU0NwXqwTO2xP0jDjJ54zduIiJwkcfcvGw==}
+ '@anthropic-ai/[email protected]':
+ resolution: {integrity: sha512-EuJVa9XPNEji/IniFzvkUcRNWG/fmiNpOfz0LN5+MxaB7BRtkgYFqhzXDcgqvRDUtTd2sP+Na3mppyuJtBMeNA==}
cpu: [arm64]
os: [darwin]
- '@anthropic-ai/[email protected]':
- resolution: {integrity: sha512-B1eLx/oZ5RL1c3a13nQ4cRUksWyhGcVNS5vbCHnOVu4Pz+dH0moZ+iY8VaE6FvikVAQwFEW6VDU00b6m3tYdsQ==}
+ '@anthropic-ai/[email protected]':
+ resolution: {integrity: sha512-iEduedfFdJe/c7Hs59PllTbYOa0aESjMWCqdJhGt1tO9uP5TYXQMt7iJ5hJANm98xxYoKbj3g3nZZVd/mqkuGg==}
cpu: [x64]
os: [darwin]
- '@anthropic-ai/[email protected]':
- resolution: {integrity: sha512-uDh+Ggjb36l+jcVgaYxSziGHmBSSR3clqvGlQ0Bgc1v5dLF4igwqZ6ZPW/hS9dArG27fislIOetH1waEgIr+GA==}
+ '@anthropic-ai/[email protected]':
+ resolution: {integrity: sha512-OS77SA8YV9CPYIEQwrpklVJkj1tIuf6gVHEwhd7Dk/VtjlZCXnylAg+hraWD3UdhcDX0VZf41Wm9SNwmZR9eUg==}
cpu: [arm64]
os: [linux]
libc: [musl]
- '@anthropic-ai/[email protected]':
- resolution: {integrity: sha512-6s96OIvBHT2817hCFLIZ421JBpQnvrmZucpjlWsyCODKmwGsSxiEhlWqK2h5Q7lwS6F7bzeAhqjGvC7FzDl9Rw==}
+ '@anthropic-ai/[email protected]':
+ resolution: {integrity: sha512-Y/dgU0Sc0s9J2pzI6eC0Uj2ttXyIgJJVrnRa3Wyu58viUe0w9DNIlF/G1tjOs1fke2TGp/dW1aVd6zXv9a8zbw==}
cpu: [arm64]
os: [linux]
libc: [glibc]
- '@anthropic-ai/[email protected]':
- resolution: {integrity: sha512-IVbIgvi5C0sdLg/p9hpiVvAQ/ikvTKwOOEy5C1aT7w8XLqBgfpJbzzVuk06df1Q0HlILUmf63EKPmq48lbxtqA==}
+ '@anthropic-ai/[email protected]':
+ resolution: {integrity: sha512-h7bU2ANKvSjQaxitB9V+TyBWzSOQx/M3Lbd3dmNPIqBnqNHRWcFsGEayn/PEUP4Gf1yK3GFduvHssl6FYPV6Bw==}
cpu: [x64]
os: [linux]
libc: [musl]
- '@anthropic-ai/[email protected]':
- resolution: {integrity: sha512-vpPyxYLy+zNc7LwQDWsZf0GZtTYa0PJLxzuv2vK9iV2dG+hrbRNTl35NSKKRR9rMj6RpKz0i2NLyVQ+D4mREgw==}
+ '@anthropic-ai/[email protected]':
+ resolution: {integrity: sha512-phMmzcO9VN+95CmQ03eOm3qxGwNC3QViY+mzowwJpSZS4vQqzMpgqg1Ttfy0hgB7fH6letYv4yBn//HakO9Tew==}
cpu: [x64]
os: [linux]
libc: [glibc]
- '@anthropic-ai/[email protected]':
- resolution: {integrity: sha512-heTflHwciJF+Hrf7v0J53QBzD+9mxN9gt2VVmEJAN0+ejbPcOcqnGGZHvyc9aZUuGh5INN0ECaiL4Fn1X2vXQQ==}
+ '@anthropic-ai/[email protected]':
+ resolution: {integrity: sha512-MYcAgnbmeSlbHRA5GhRPj7tWdUwgtmS1uZIPc4TPu6WWnU1/TXd55A7dq4vPeBtqm/bTOEowqp0eey5BxbSgfQ==}
cpu: [arm64]
os: [win32]
- '@anthropic-ai/[email protected]':
- resolution: {integrity: sha512-N+Y1zJb19nx0oPTvzkl/E3ng9AtWGW+K4hySmSHCgYSsgIwfs1YzDj/F5eHDMrxgklTuzFp76TvL3S75z5ge+g==}
+ '@anthropic-ai/[email protected]':
+ resolution: {integrity: sha512-h0tOC5gCFeuzViqvrkChM4BoMB8WMDi75hQD1XAVwYVopqYzA9+THjwlJ+5oqcKtkmao7zKdPd/qpGJeXldf5Q==}
cpu: [x64]
os: [win32]
- '@anthropic-ai/[email protected]':
- resolution: {integrity: sha512-aIQSTKcCJcOgi125GAGQaNZUYgxbEBQwV2Ac+Utp0+gGUjIEWjTqz4B8kXr9XjkcCTYiRUMTDsXPAUfIcBDjnw==}
- engines: {node: '>=18.0.0'}
+ '@anthropic-ai/[email protected]':
+ resolution: {integrity: sha512-NxKq4U+/UlPO1muxcYo1iTftjacLdo2SUcrNLitsi9WBARRejvM0biCwUpNrZVbRDPY4Gj59NsB+cH/YuR5EsQ==}
+ engines: {node: '>=18.14.0'}
peerDependencies:
'@anthropic-ai/sdk': '>=0.93.0'
'@modelcontextprotocol/sdk': ^1.29.0
@@ -3126,44 +3126,44 @@ snapshots:
dependencies:
zod: 4.4.3
- '@anthropic-ai/[email protected]':
+ '@anthropic-ai/[email protected]':
optional: true
- '@anthropic-ai/[email protected]':
+ '@anthropic-ai/[email protected]':
optional: true
- '@anthropic-ai/[email protected]':
+ '@anthropic-ai/[email protected]':
optional: true
- '@anthropic-ai/[email protected]':
+ '@anthropic-ai/[email protected]':
optional: true
- '@anthropic-ai/[email protected]':
+ '@anthropic-ai/[email protected]':
optional: true
- '@anthropic-ai/[email protected]':
+ '@anthropic-ai/[email protected]':
optional: true
- '@anthropic-ai/[email protected]':
+ '@anthropic-ai/[email protected]':
optional: true
- '@anthropic-ai/[email protected]':
+ '@anthropic-ai/[email protected]':
optional: true
dependencies:
'@anthropic-ai/sdk': 0.109.0([email protected])
'@modelcontextprotocol/sdk': 1.29.0([email protected])
zod: 4.4.3
optionalDependencies:
- '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.280
- '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.280
- '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.280
- '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.280
- '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.280
- '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.280
- '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.280
- '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.280
+ '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.314
+ '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.314
+ '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.314
+ '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.314
+ '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.314
+ '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.314
+ '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.314
+ '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.314
dependencies: