refactor: remove timezone from editor context prompt options

This commit is contained in:
Mark IJbema
2026-03-17 15:09:39 +01:00
parent f46b733585
commit 2ddf739cd3
8 changed files with 5 additions and 32 deletions
-4
View File
@@ -2334,15 +2334,11 @@ export class KiloProvider implements vscode.WebviewViewProvider, TelemetryProper
// Shell
const shell = vscode.env.shell || undefined
// Timezone
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone || undefined
return {
...(visibleFiles.length > 0 ? { visibleFiles } : {}),
...(openTabs.length > 0 ? { openTabs } : {}),
...(activeFile ? { activeFile } : {}),
...(shell ? { shell } : {}),
...(timezone ? { timezone } : {}),
}
}
@@ -113,6 +113,4 @@ export interface EditorContext {
activeFile?: string
/** User's default shell (from vscode.env.shell) */
shell?: string
/** User's timezone (e.g. "Europe/Amsterdam") */
timezone?: string
}
@@ -3,7 +3,6 @@ export interface EditorContext {
openTabs?: string[]
activeFile?: string
shell?: string
timezone?: string
}
/**
@@ -12,15 +11,7 @@ export interface EditorContext {
* so they benefit from prompt caching.
*/
export function staticEnvLines(ctx?: EditorContext): string[] {
const now = new Date()
const lines = [` Today's date: ${now.toDateString()}`]
if (ctx?.timezone) {
const offset = -now.getTimezoneOffset()
const sign = offset >= 0 ? "+" : "-"
const hours = Math.floor(Math.abs(offset) / 60)
const mins = Math.abs(offset) % 60
lines.push(` User timezone: ${ctx.timezone}, UTC${sign}${hours}:${mins.toString().padStart(2, "0")}`)
}
const lines = [` Today's date: ${new Date().toDateString()}`]
if (ctx?.shell) {
lines.push(` Default shell: ${ctx.shell}`)
}
@@ -375,7 +375,6 @@ export namespace MessageV2 {
openTabs: z.array(z.string()).optional(),
activeFile: z.string().optional(),
shell: z.string().optional(),
timezone: z.string().optional(),
})
.optional(),
// kilocode_change end
-1
View File
@@ -131,7 +131,6 @@ export namespace SessionPrompt {
openTabs: z.array(z.string()).optional(),
activeFile: z.string().optional(),
shell: z.string().optional(),
timezone: z.string().optional(),
})
.optional(),
// kilocode_change end
-2
View File
@@ -1943,7 +1943,6 @@ export class Session2 extends HeyApiClient {
openTabs?: Array<string>
activeFile?: string
shell?: string
timezone?: string
}
parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
},
@@ -2083,7 +2082,6 @@ export class Session2 extends HeyApiClient {
openTabs?: Array<string>
activeFile?: string
shell?: string
timezone?: string
}
parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
},
-3
View File
@@ -143,7 +143,6 @@ export type UserMessage = {
openTabs?: Array<string>
activeFile?: string
shell?: string
timezone?: string
}
}
@@ -3428,7 +3427,6 @@ export type SessionPromptData = {
openTabs?: Array<string>
activeFile?: string
shell?: string
timezone?: string
}
parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
}
@@ -3668,7 +3666,6 @@ export type SessionPromptAsyncData = {
openTabs?: Array<string>
activeFile?: string
shell?: string
timezone?: string
}
parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
}
+4 -9
View File
@@ -3186,9 +3186,6 @@
},
"shell": {
"type": "string"
},
"timezone": {
"type": "string"
}
}
},
@@ -3696,9 +3693,6 @@
},
"shell": {
"type": "string"
},
"timezone": {
"type": "string"
}
}
},
@@ -8581,9 +8575,6 @@
},
"shell": {
"type": "string"
},
"timezone": {
"type": "string"
}
}
}
@@ -12027,6 +12018,10 @@
"description": "Enable the batch tool",
"type": "boolean"
},
"codebase_search": {
"description": "Enable AI-powered codebase search",
"type": "boolean"
},
"openTelemetry": {
"description": "Enable telemetry. Set to false to opt-out.",
"default": true,