File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 11import { randomUUID } from "node:crypto" ;
2+ import { rmSync } from "node:fs" ;
23import { join } from "node:path" ;
34import { Agent , PermissionMode } from "@posthog/agent" ;
45import {
@@ -86,6 +87,22 @@ export function registerAgentIpc(
8687 process . env . POSTHOG_API_KEY = apiKey ;
8788 process . env . POSTHOG_API_HOST = apiHost ;
8889
90+ // Workaround for claude-agent-sdk bug where cached tool definitions include input_examples
91+ // Clear the statsig cache to force regeneration without input_examples
92+ // See: https://github.com/anthropics/claude-code/issues/11678
93+ try {
94+ const claudeConfigDir =
95+ process . env . CLAUDE_CONFIG_DIR || join ( app . getPath ( "home" ) , ".claude" ) ;
96+ const statsigPath = join ( claudeConfigDir , "statsig" ) ;
97+ rmSync ( statsigPath , { recursive : true , force : true } ) ;
98+ console . log (
99+ "[agent] Cleared statsig cache to work around input_examples bug" ,
100+ ) ;
101+ } catch ( error ) {
102+ // Ignore errors if the folder doesn't exist
103+ console . warn ( "[agent] Could not clear statsig cache:" , error ) ;
104+ }
105+
89106 const taskId = randomUUID ( ) ;
90107 const channel = `agent-event:${ taskId } ` ;
91108
You can’t perform that action at this time.
0 commit comments