@posthog/agent 2.1.62 → 2.1.67
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/dist/{agent-9gv5HohC.d.ts → agent-DK1apkaG.d.ts} +0 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +8 -5
- package/dist/agent.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/server/agent-server.js +7 -2
- package/dist/server/agent-server.js.map +1 -1
- package/dist/server/bin.cjs +7 -2
- package/dist/server/bin.cjs.map +1 -1
- package/package.json +1 -1
- package/src/adapters/claude/claude-agent.ts +9 -2
- package/src/agent.ts +1 -3
package/package.json
CHANGED
|
@@ -48,7 +48,7 @@ import { fetchMcpToolMetadata } from "./mcp/tool-metadata.js";
|
|
|
48
48
|
import { canUseTool } from "./permissions/permission-handlers.js";
|
|
49
49
|
import { getAvailableSlashCommands } from "./session/commands.js";
|
|
50
50
|
import { parseMcpServers } from "./session/mcp-config.js";
|
|
51
|
-
import { toSdkModelId } from "./session/models.js";
|
|
51
|
+
import { DEFAULT_MODEL, toSdkModelId } from "./session/models.js";
|
|
52
52
|
import {
|
|
53
53
|
buildSessionOptions,
|
|
54
54
|
buildSystemPrompt,
|
|
@@ -162,6 +162,8 @@ export class ClaudeAcpAgent extends BaseAcpAgent {
|
|
|
162
162
|
});
|
|
163
163
|
|
|
164
164
|
const input = new Pushable<SDKUserMessage>();
|
|
165
|
+
// Pass default model at construction to avoid expensive post-hoc setModel IPC
|
|
166
|
+
options.model = DEFAULT_MODEL;
|
|
165
167
|
const q = query({ prompt: input, options });
|
|
166
168
|
|
|
167
169
|
const session = this.createSession(
|
|
@@ -191,7 +193,12 @@ export class ClaudeAcpAgent extends BaseAcpAgent {
|
|
|
191
193
|
this.deferBackgroundFetches(q, sessionId, mcpServers);
|
|
192
194
|
|
|
193
195
|
session.modelId = modelOptions.currentModelId;
|
|
194
|
-
|
|
196
|
+
// Only call setModel if the resolved model differs from the default we
|
|
197
|
+
// already baked into the query options — avoids a ~2s IPC round-trip.
|
|
198
|
+
const resolvedSdkModel = toSdkModelId(modelOptions.currentModelId);
|
|
199
|
+
if (resolvedSdkModel !== DEFAULT_MODEL) {
|
|
200
|
+
await this.trySetModel(q, modelOptions.currentModelId);
|
|
201
|
+
}
|
|
195
202
|
|
|
196
203
|
const configOptions = await this.buildConfigOptions(modelOptions);
|
|
197
204
|
|
package/src/agent.ts
CHANGED
|
@@ -18,12 +18,10 @@ export class Agent {
|
|
|
18
18
|
private acpConnection?: InProcessAcpConnection;
|
|
19
19
|
private taskRunId?: string;
|
|
20
20
|
private sessionLogWriter?: SessionLogWriter;
|
|
21
|
-
public debug: boolean;
|
|
22
21
|
|
|
23
22
|
constructor(config: AgentConfig) {
|
|
24
|
-
this.debug = config.debug || false;
|
|
25
23
|
this.logger = new Logger({
|
|
26
|
-
debug:
|
|
24
|
+
debug: config.debug || false,
|
|
27
25
|
prefix: "[PostHog Agent]",
|
|
28
26
|
onLog: config.onLog,
|
|
29
27
|
});
|