Skip to content

feat: add X-KiloCode-MachineId header to API requests#417

Open
chrarnoldus wants to merge 2 commits intodevfrom
revert-415-revert-331-session/agent_8ba846fa-10ac-4d6d-a61a-d26dd567770c
Open

feat: add X-KiloCode-MachineId header to API requests#417
chrarnoldus wants to merge 2 commits intodevfrom
revert-415-revert-331-session/agent_8ba846fa-10ac-4d6d-a61a-d26dd567770c

Conversation

@chrarnoldus
Copy link
Contributor

@chrarnoldus chrarnoldus commented Feb 18, 2026

Reverts #415

Fix: Prevent telemetry-id file from being written to working directory

When dataPath is not configured (empty string), path.join("", "telemetry-id") resolves to "telemetry-id" — a relative path that causes the file to be written to the user's current working directory. This results in random telemetry-id files appearing in project directories.

Change: In Identity.getMachineId(), return undefined when dataPath is not set instead of falling through to write a file in the CWD. All callers already handle undefined gracefully.


Built for Christiaan by Kilo for Slack

@@ -237,10 +239,9 @@ export namespace LLM {
...(input.model.api.npm === "@kilocode/kilo-gateway" && input.agent.name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Missed isKilo refactor — this line still uses the inline input.model.api.npm === "@kilocode/kilo-gateway" check instead of the newly extracted isKilo variable used on lines 243-244.

Suggested change
...(input.model.api.npm === "@kilocode/kilo-gateway" && input.agent.name
...(isKilo && input.agent.name

@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 18, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
packages/opencode/src/session/llm.ts 239 Missed isKilo refactor — still uses inline input.model.api.npm === "@kilocode/kilo-gateway" check instead of the extracted isKilo variable
Files Reviewed (5 files)
  • packages/kilo-gateway/src/api/constants.ts - 0 issues
  • packages/kilo-gateway/src/headers.ts - 0 issues
  • packages/kilo-gateway/src/index.ts - 0 issues
  • packages/kilo-telemetry/src/identity.ts - 0 issues
  • packages/opencode/src/session/llm.ts - 1 issue

Fix these issues in Kilo Cloud

… is not set

When dataPath is empty (not configured), path.join('', 'telemetry-id')
resolves to a relative path, causing the telemetry-id file to be written
to the user's current working directory. This results in random
telemetry-id files appearing in project directories.

Return undefined instead of persisting when no data path is available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant