-
Notifications
You must be signed in to change notification settings - Fork 247
DRIVERS-3529 Add env.agent to handshake metadata for agentic client identification #1967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aclark4life
wants to merge
5
commits into
mongodb:master
Choose a base branch
from
aclark4life:DRIVERS-3529
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8c1e1f0
DRIVERS-3529 Add env.agent to handshake metadata for agentic client i…
aclark4life 8e7ea81
DRIVERS-3529 Address review: renumber agent prose test to Test 3, ref…
aclark4life 0821be0
DRIVERS-3529 Use "" for empty string in agent prose test table
aclark4life 4b5c160
DRIVERS-3529 Replace empty table with prose in "no agent variables" test
aclark4life feaec8d
DRIVERS-3529 Fix subject-verb agreement in handshake prose test intros
aclark4life File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,7 +74,67 @@ the following sets of environment variables: | |
| | `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` | `1024` | | ||
| | `KUBERNETES_SERVICE_HOST` | `1` | | ||
|
|
||
| ### Test 2: Test that the driver accepts an arbitrary auth mechanism | ||
| ### Test 2: Test that agent metadata is properly captured | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this should be added as Test 3, to prevent drivers from having to change existing test code |
||
|
|
||
| Drivers that capture values for `client.env` should test that a connection and hello command succeeds in the presence of | ||
| the following sets of environment variables, and that `client.env.agent` is populated (or omitted) as described. | ||
|
|
||
| 1. Generic agent via `AI_AGENT`. `client.env.agent` MUST equal `custom-agent`. | ||
|
|
||
| | Environment Variable | Value | | ||
| | -------------------- | -------------- | | ||
| | `AI_AGENT` | `custom-agent` | | ||
|
|
||
| 2. Generic agent via `AGENT`. `client.env.agent` MUST equal `custom-agent`. | ||
|
|
||
| | Environment Variable | Value | | ||
| | -------------------- | -------------- | | ||
| | `AGENT` | `custom-agent` | | ||
|
|
||
| 3. Known agent. `client.env.agent` MUST equal `claude-code`. | ||
|
|
||
| | Environment Variable | Value | | ||
| | -------------------- | ----- | | ||
| | `CLAUDECODE` | `1` | | ||
|
|
||
| 4. Precedence - generic wins over known. `client.env.agent` MUST equal `custom-agent` (the value of `AI_AGENT`), not | ||
| `claude-code`. | ||
|
|
||
| | Environment Variable | Value | | ||
| | -------------------- | -------------- | | ||
| | `AI_AGENT` | `custom-agent` | | ||
| | `CLAUDECODE` | `1` | | ||
|
|
||
| 5. Precedence - first known wins. `client.env.agent` MUST equal `cursor`. | ||
|
|
||
| | Environment Variable | Value | | ||
| | -------------------- | ----- | | ||
| | `CURSOR_AGENT` | `1` | | ||
| | `GEMINI_CLI` | `1` | | ||
|
|
||
| 6. Empty value is treated as unset. `client.env.agent` MUST be omitted. If no other `client.env` fields are populated, | ||
| `client.env` MUST be entirely omitted. | ||
|
|
||
| | Environment Variable | Value | | ||
| | -------------------- | ------------------- | | ||
| | `AI_AGENT` | \`\` (empty string) | | ||
|
aclark4life marked this conversation as resolved.
Outdated
|
||
|
|
||
| 7. No agent variables. `client.env.agent` MUST be omitted. | ||
|
|
||
| | Environment Variable | Value | | ||
| | -------------------- | ----- | | ||
| | | | | ||
|
|
||
| 8. Agent alongside FaaS. This test MUST verify that both the AWS Lambda metadata and `client.env.agent` (equal to | ||
| `claude-code`) are present in `client.env`. | ||
|
|
||
| | Environment Variable | Value | | ||
| | -------------------- | ------------------ | | ||
| | `AWS_EXECUTION_ENV` | `AWS_Lambda_java8` | | ||
| | `AWS_REGION` | `us-east-2` | | ||
| | `CLAUDECODE` | `1` | | ||
|
|
||
| ### Test 3: Test that the driver accepts an arbitrary auth mechanism | ||
|
|
||
| 1. Mock the server response in a way that `saslSupportedMechs` array in the `hello` command response contains an | ||
| arbitrary string. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The word wrapping here feels unnatural. I suggest either a soft-fixed length or sentence per line