Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agentplatform/_genai/sandbox_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _CreateSandboxEnvironmentTemplateRequestParameters_to_vertex(
)

if getv(from_object, ["display_name"]) is not None:
setv(parent_object, ["displayName"], getv(from_object, ["display_name"]))
setv(to_object, ["displayName"], getv(from_object, ["display_name"]))

return to_object

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ def test_sandbox_templates_byoc_create(client):
sandbox_template_operation, types.SandboxEnvironmentTemplateOperation
)

# Verify display_name is sent in the create request body. The replay client
# asserts the SDK's actual request matches this recorded request, so checking
# the recorded body confirms display_name is included rather than dropped
# (the behavior this CL fixes). interactions[0] is the create POST; later
# interactions are the operation polls from create() waiting on the LRO.
client._api_client._initialize_replay_session_if_not_loaded()
if client._api_client.replay_session:
create_request_body = client._api_client.replay_session.interactions[
0
].request.body_segments[0]
assert create_request_body["displayName"] == "Test Sandbox Template 1"


pytestmark = pytest_helper.setup(
file=__file__,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ def test_sandbox_templates_default_create(client):
sandbox_template_operation, types.SandboxEnvironmentTemplateOperation
)

# Verify display_name is sent in the create request body. The replay client
# asserts the SDK's actual request matches this recorded request, so checking
# the recorded body confirms display_name is included rather than dropped
# (the behavior this CL fixes).
client._api_client._initialize_replay_session_if_not_loaded()
if client._api_client.replay_session:
create_request_body = client._api_client.replay_session.interactions[
0
].request.body_segments[0]
assert create_request_body["displayName"] == "Test Sandbox Template 1"


pytestmark = pytest_helper.setup(
file=__file__,
Expand Down
Loading