Skip to content

Convey endpointUrl and machineId to extensions via LSTK_EXT_CONTEXT - #446

Open
carillan81 wants to merge 1 commit into
mainfrom
dpx-643-add-endpointURL-machineID-to-extensions-conveyor
Open

Convey endpointUrl and machineId to extensions via LSTK_EXT_CONTEXT#446
carillan81 wants to merge 1 commit into
mainfrom
dpx-643-add-endpointURL-machineID-to-extensions-conveyor

Conversation

@carillan81

Copy link
Copy Markdown
Contributor

Extensions gain two optional runtime-context fields: endpointUrl carries the resolved --endpoint-url / LSTK_ENDPOINT_URL / AWS_ENDPOINT_URL value verbatim (unvalidated and unprobed, omitted when no source is set), and machineId carries the anonymized machine id lstk stamps on its own telemetry, so an extension reports the same machine without re-deriving it (omitted together with sessionId when telemetry is disabled).

The machine-id derivation now lives in MachineID(ctx) behind the enabled guard, so a disabled client never dials Docker or persists a machine_id file, and the Docker lookup is bounded by a 3s timeout so an unreachable DOCKER_HOST cannot stall dispatch for the OS TCP connect timeout before the extension execs.

Co-Authored-By: Claude noreply@anthropic.com

@carillan81 carillan81 added semver: minor docs: skip Pull request does not require documentation changes labels Aug 11, 2026
@carillan81
carillan81 force-pushed the dpx-643-add-endpointURL-machineID-to-extensions-conveyor branch from 73a14eb to b91d41e Compare August 11, 2026 11:42
@carillan81
carillan81 marked this pull request as ready for review August 11, 2026 12:41
@carillan81
carillan81 requested a review from a team as a code owner August 11, 2026 12:41

@skyrpex skyrpex left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, let's wait for Shelton's decision.

@sheltongraves

Copy link
Copy Markdown

@peter-smith-phd This came up today and I can see it is connected to Doctor extension. Do you have any feedback before it merges?

@peter-smith-phd peter-smith-phd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, looks good to me. A lot of file changes, but this essentially just adds two necessary fields to the extension context.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cleanly conveys endpointUrl and machineId to extensions via LSTK_EXT_CONTEXT — I built the tree (go build ./...) and ran the telemetry/extension unit tests green, and confirmed machineId is the salted md5 hash (so nothing new is exposed) and no path routes extension traffic to real AWS.

  1. thought: on internal/telemetry/client.go — routing GetEnvironment through the new MachineID(ctx) also caps the telemetry event path at machineIDTimeout (3s), not just extension dispatch. Under Docker latency above 3s a run now falls through to the system/generated id, so the same machine can report a different (still anonymized) machine_id across runs — intentional and documented, just flagging that the timeout's blast radius now covers ordinary event emission too.
  2. praise: the tests earn their keep — asserting the conveyed machineId equals the id on the actual lstk_command event (not merely non-empty), and the per-source endpointUrl precedence table including verbatim passthrough of a malformed value, cover exactly the two things that could silently regress.

Automated review on behalf of @gtsiolis.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs: skip Pull request does not require documentation changes semver: minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants