Skip to content

Comments

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

Merged
chrarnoldus merged 6 commits intodevfrom
revert-415-revert-331-session/agent_8ba846fa-10ac-4d6d-a61a-d26dd567770c
Feb 19, 2026
Merged

feat: add X-KiloCode-MachineId header to API requests#417
chrarnoldus merged 6 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

@kiloconnect
Copy link
Contributor

kiloconnect bot commented Feb 18, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (5 files)
  • packages/kilo-gateway/src/api/constants.ts — Added HEADER_MACHINEID constant
  • packages/kilo-gateway/src/headers.ts — Added machineId option to buildKiloHeaders, new X_KILOCODE_MACHINEID export, cleaned up kilocode_change markers
  • packages/kilo-gateway/src/index.ts — Re-exported HEADER_MACHINEID, cleaned up kilocode_change markers
  • packages/kilo-telemetry/src/identity.ts — Changed getMachineId() return type to string | undefined, added early return when dataPath is not configured (prevents writing telemetry-id to CWD)
  • packages/opencode/src/session/llm.ts — Extracted isKilo variable, added machineId resolution via Identity.getMachineId(), sends X-KILOCODE-MACHINEID header for kilo provider requests

kiloconnect bot and others added 3 commits February 18, 2026 14:31
… 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.
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
@vercel
Copy link

vercel bot commented Feb 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kilo-ui-storybook Ready Ready Preview, Comment Feb 19, 2026 10:26am

Request Review

@chrarnoldus chrarnoldus merged commit 6e4c6a3 into dev Feb 19, 2026
9 checks passed
@chrarnoldus chrarnoldus deleted the revert-415-revert-331-session/agent_8ba846fa-10ac-4d6d-a61a-d26dd567770c branch February 19, 2026 10:54
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.

2 participants