镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Send agent enum for agent-shim telemetry events - #7019

Open
rclarey wants to merge 3 commits into
mainfrom
enum-for-agent-shim-agent
Open

rclarey wants to merge 3 commits into
mainfrom
enum-for-agent-shim-agent

Conversation

@rclarey

@rclarey rclarey commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Changes

Replace agent_name with agent and make the values match JSON->proto deserialization for enums (e.g. "CLAUDE_CODE" instead of "claude")

Why

The original PR to add this event didn't follow telemetry best practices, this PR fixes that

Tests

automated tests pass

@rclarey
rclarey requested review from a team as code owners October 12, 2026 11:36
@rclarey
rclarey requested review from chrisst, denik and rauchy October 12, 2026 11:36
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 584355c

Run: 38248733205

Env 🔄​flaky ✅​pass 🙈​skip Time
🔄​ aws linux-2core-8gb 2 274 16 5:54
✅​ aws-windows-latest-4core-16gb 278 14 3:25
✅​ azure linux-2core-8gb 275 16 5:57
✅​ azure-windows-latest-4core-16gb 277 14 4:04
✅​ gcp linux-2core-8gb 276 16 5:39
✅​ gcp-windows-latest-4core-16gb 278 14 4:02
Test Name aws linux-2core-8gb
🔄​ TestFsCpDirToDirWithOverwriteFlag 🔄​f
🔄​ TestFsCpDirToDirWithOverwriteFlag/dbfs_to_uc-volumes 🔄​f
Top 6 slowest tests (at least 2 minutes):
duration env testname
4:00 azure-windows-latest-4core-16gb TestAccept
3:59 gcp-windows-latest-4core-16gb TestAccept
3:54 gcp linux-2core-8gb TestAccept
3:53 azure linux-2core-8gb TestAccept
3:48 aws linux-2core-8gb TestAccept
3:15 aws-windows-latest-4core-16gb TestAccept

}

func agentNameToAgentEnum(agentName string) protos.SshAgentShimAgent {
switch agentName {

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.

[nice to have] The switch in agentNameToAgentEnum repeats the literals "claude" and "codex" from supportedAgents. The style guide asks for a named constant when a value is used in more than one place. If someone renames an agent in only one place, the event reports TYPE_UNSPECIFIED. Define package-level constants for the agent names and use them in both places, like agentType in cmd/aitools/telemetry.go. Another option: add a telemetryAgent protos.SshAgentShimAgent field to agentSpec, and use agentByName to find it.

SshAgentShimErrorCategoryUnknown SshAgentShimErrorCategory = "UNKNOWN"
)

// The agent for an `ssh agent-shim <agent>` command invocation. Values are in

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.

[nit] Start the type comment with the type name, as SshAgentShimErrorCategory does. For example: "SshAgentShimAgent mirrors SshAgentShimAgentType.Type in the databricks_cli lumberjack proto." The comment says "JSON->proto serialization", but this step is deserialization. Remove the extra space in // The agent the user asked to launch. Add a doc comment to agentNameToAgentEnum that starts with the function name.

}

func TestBuildAgentShimEvent(t *testing.T) {
for _, agent := range supportedAgents {

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.

[nit] The loop only checks that each supported agent maps to a value other than SshAgentShimAgentUnspecified. No test covers the default branch. Add one case: an unknown name, such as "foo", maps to SshAgentShimAgentUnspecified.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants