@posthog/agent 2.1.106 → 2.1.111

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posthog/agent",
3
- "version": "2.1.106",
3
+ "version": "2.1.111",
4
4
  "repository": "https://github.com/PostHog/twig",
5
5
  "description": "TypeScript agent framework wrapping Claude Agent SDK with Git-based task execution for PostHog",
6
6
  "exports": {
@@ -71,12 +71,12 @@
71
71
  "tsx": "^4.20.6",
72
72
  "typescript": "^5.5.0",
73
73
  "vitest": "^2.1.8",
74
- "@twig/git": "1.0.0",
75
- "@posthog/shared": "1.0.0"
74
+ "@posthog/shared": "1.0.0",
75
+ "@twig/git": "1.0.0"
76
76
  },
77
77
  "dependencies": {
78
78
  "@agentclientprotocol/sdk": "^0.14.0",
79
- "@anthropic-ai/claude-agent-sdk": "0.2.42",
79
+ "@anthropic-ai/claude-agent-sdk": "0.2.59",
80
80
  "@anthropic-ai/sdk": "^0.71.0",
81
81
  "@hono/node-server": "^1.19.9",
82
82
  "@modelcontextprotocol/sdk": "^1.25.3",
@@ -33,7 +33,7 @@ import { v7 as uuidv7 } from "uuid";
33
33
  import packageJson from "../../../package.json" with { type: "json" };
34
34
  import type { SessionContext } from "../../otel-log-writer.js";
35
35
  import type { SessionLogWriter } from "../../session-log-writer.js";
36
- import { withTimeout } from "../../utils/common.js";
36
+ import { unreachable, withTimeout } from "../../utils/common.js";
37
37
  import { Logger } from "../../utils/logger.js";
38
38
  import { Pushable } from "../../utils/streams.js";
39
39
  import { BaseAcpAgent } from "../base-acp-agent.js";
@@ -646,9 +646,9 @@ export class ClaudeAcpAgent extends BaseAcpAgent {
646
646
  return null;
647
647
 
648
648
  default:
649
- this.logger.warn("Unhandled message type", {
650
- type: (message as { type: string }).type,
651
- });
649
+ // SDKMessage union includes undefined types (SDKRateLimitEvent, SDKPromptSuggestionMessage)
650
+ // that resolve to `any`, preventing exhaustive narrowing
651
+ unreachable(message as never, this.logger);
652
652
  return null;
653
653
  }
654
654
  }
@@ -88,7 +88,8 @@ function buildEnvironment(): Record<string, string> {
88
88
  ...process.env,
89
89
  ELECTRON_RUN_AS_NODE: "1",
90
90
  CLAUDE_CODE_ENABLE_ASK_USER_QUESTION_TOOL: "true",
91
- ENABLE_EXPERIMENTAL_MCP_CLI: "true",
91
+ // Offload all MCP tools by default
92
+ ENABLE_TOOL_SEARCH: "auto:0",
92
93
  };
93
94
  }
94
95
 
package/src/agent.ts CHANGED
@@ -69,7 +69,7 @@ export class Agent {
69
69
  options: TaskExecutionOptions = {},
70
70
  ): Promise<InProcessAcpConnection> {
71
71
  const gatewayConfig = this._configureLlmGateway(options.adapter);
72
-
72
+ this.logger.info("Configured LLM gateway", options);
73
73
  this.taskRunId = taskRunId;
74
74
 
75
75
  let allowedModelIds: Set<string> | undefined;