Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ describe("getEnvironmentDetails", () => {
expect(result).toContain("# VSCode Visible Files")
expect(result).toContain("# VSCode Open Tabs")
expect(result).toContain("# Current Time")
expect(result).toContain("# Current Context Size (Tokens)")
expect(result).toContain("# Current Cost")
expect(result).toContain("# Current Mode")
expect(result).toContain("<model>test-model</model>")
Expand Down
7 changes: 1 addition & 6 deletions src/core/environment/getEnvironmentDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,8 @@ export async function getEnvironmentDetails(cline: Task, includeFileDetails: boo

// Add context tokens information.
const { contextTokens, totalCost } = getApiMetrics(cline.clineMessages)
const { id: modelId, info: modelInfo } = cline.api.getModel()
const contextWindow = modelInfo.contextWindow
const { id: modelId } = cline.api.getModel()

const contextPercentage =
contextTokens && contextWindow ? Math.round((contextTokens / contextWindow) * 100) : undefined

details += `\n\n# Current Context Size (Tokens)\n${contextTokens ? `${contextTokens.toLocaleString()} (${contextPercentage}%)` : "(Not available)"}`
details += `\n\n# Current Cost\n${totalCost !== null ? `$${totalCost.toFixed(2)}` : "(Not available)"}`

// Add current mode and any mode-specific warnings.
Expand Down
Loading