Skip to content

fix(examples): sync AgentRuntime SDK example name#329

Open
mrinalchaturvedi27 wants to merge 1 commit into
volcano-sh:mainfrom
mrinalchaturvedi27:sync-agent-runtime
Open

fix(examples): sync AgentRuntime SDK example name#329
mrinalchaturvedi27 wants to merge 1 commit into
volcano-sh:mainfrom
mrinalchaturvedi27:sync-agent-runtime

Conversation

@mrinalchaturvedi27
Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:

This makes the Python SDK AgentRuntime example use the same name as the sample YAML.

Before this change, the YAML created simple-agentruntime, but the Python example used my-agent.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

This is only an example-name fix.

Does this PR introduce a user-facing change?:

NONE

What I fixed

I fixed a small mismatch in the AgentRuntime examples.

The YAML example creates an AgentRuntime named simple-agentruntime, but the Python SDK example was still using my-agent. Now the Python example uses simple-agentruntime too.

How I found it

I checked the two files from the report. The names did not match, and nearby examples did not show a larger change was needed.

What I changed

  • Added AGENT_NAME = "simple-agentruntime" in sdk-python/examples/agent_runtime_usage.py.
  • Used that value in both AgentRuntimeClient calls.

Why this is legit

This is a real example bug. If someone applies the YAML and then runs the Python example, both should point to the same AgentRuntime.

I only changed the Python example because the YAML name already looked correct for this example.

Validation

  • ../.venv/bin/python -m pytest tests/test_agent_runtime.py -q from sdk-python/ - Passed, 7 tests.
  • ../.venv/bin/python -m ruff check examples/agent_runtime_usage.py tests/test_agent_runtime.py --config ../pyproject.toml from sdk-python/ - Passed.
  • .venv/bin/python -m ruff check . --config pyproject.toml from repo root - Passed.
  • git diff --check -- sdk-python/examples/agent_runtime_usage.py - Passed.

Signed-off-by: Mrinal Chaturvedi <mrinal.chaturvedi27@gmail.com>
Copilot AI review requested due to automatic review settings May 13, 2026 10:31
@volcano-sh-bot volcano-sh-bot added the kind/bug Something isn't working label May 13, 2026
@volcano-sh-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign acsoto for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Python SDK AgentRuntime usage example so it references the same AgentRuntime resource name as the sample YAML (simple-agentruntime), avoiding a mismatch when users apply the YAML and run the example.

Changes:

  • Introduced a single AGENT_NAME = "simple-agentruntime" constant in sdk-python/examples/agent_runtime_usage.py.
  • Updated both AgentRuntimeClient instantiations to use AGENT_NAME instead of the previous hard-coded "my-agent".

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the agent_runtime_usage.py example by introducing an AGENT_NAME constant to replace hardcoded strings in AgentRuntimeClient instantiations. The feedback suggests adding verbose=True to the second client instance for consistency with the first, ensuring uniform logging behavior throughout the example.

# second time: it will try to reuse the pod created before
agent_client_v2 = AgentRuntimeClient(
agent_name="my-agent",
agent_name=AGENT_NAME,
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.

medium

For consistency with the first AgentRuntimeClient instantiation (line 20), consider setting verbose=True here as well. This ensures that debug logs are available for both the initial bootstrapping and the subsequent session reuse, providing a consistent and informative experience for users running the example.

Suggested change
agent_name=AGENT_NAME,
agent_name=AGENT_NAME,
verbose=True,

Copy link
Copy Markdown
Author

@mrinalchaturvedi27 mrinalchaturvedi27 May 13, 2026

Choose a reason for hiding this comment

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

@gemini-code-assist verbose=True is already present in this client initialization below session_id, so I’m leaving this unchanged to avoid duplicating the keyword argument.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.12%. Comparing base (524e55e) to head (0e41f50).
⚠️ Report is 54 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #329      +/-   ##
==========================================
+ Coverage   47.57%   49.12%   +1.55%     
==========================================
  Files          30       30              
  Lines        2819     2858      +39     
==========================================
+ Hits         1341     1404      +63     
+ Misses       1338     1301      -37     
- Partials      140      153      +13     
Flag Coverage Δ
unittests 49.12% <ø> (+1.55%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mrinalchaturvedi27
Copy link
Copy Markdown
Author

Hi @LiZhenCheng9527 @YaoZengzeng quick ping for this PR :)

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

Labels

kind/bug Something isn't working size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants