Skip to content

Conversation

@major
Copy link
Contributor

@major major commented Jan 7, 2026

Description

Remove calls to AsyncAgent.initialize() in get_agent() and get_temp_agent() functions. This method does not exist in llama-stack-client 0.3.5 and causes AttributeError at runtime.

The agent does not require explicit initialization - create_session() works without it.

Type of change

  • Bug fix

Tools used to create PR

  • Assisted-by: Claude
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue # N/A

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  1. Start lightspeed-stack with llama-stack as library mode
  2. Make a request to any endpoint that uses get_agent() or get_temp_agent()
  3. Verify no AttributeError: 'AsyncAgent' object has no attribute 'initialize' is raised

Summary by CodeRabbit

  • Refactor
    • Optimized internal agent initialization process for improved efficiency.

✏️ Tip: You can customize this high-level summary in your review settings.

The AsyncAgent class in llama-stack-client 0.3.5 does not have an
initialize() method. These calls were causing AttributeError at runtime.

The agent does not require explicit initialization - create_session()
works without it.

Signed-off-by: Major Hayden <major@redhat.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 7, 2026

Walkthrough

Removes explicit asynchronous initialization calls (await agent.initialize()) from two agent construction code paths in the endpoints utility: get_agent and get_temp_agent. Public signatures and control flow remain unchanged.

Changes

Cohort / File(s) Summary
Agent initialization removal
src/utils/endpoints.py
Eliminates await agent.initialize() calls after AsyncAgent construction in get_agent and get_temp_agent code paths

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing non-existent AsyncAgent.initialize() calls from the codebase. It is concise, specific, and directly reflects the bug fix being implemented.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2adb747 and 2c573be.

📒 Files selected for processing (1)
  • src/utils/endpoints.py
💤 Files with no reviewable changes (1)
  • src/utils/endpoints.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: E2E: server mode / ci
  • GitHub Check: E2E: library mode / ci
  • GitHub Check: build-pr

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link

openshift-ci bot commented Jan 7, 2026

Hi @major. Thanks for your PR.

I'm waiting for a lightspeed-core member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@tisnik
Copy link
Contributor

tisnik commented Jan 8, 2026

/ok-to-test

Copy link
Contributor

@asimurka asimurka left a comment

Choose a reason for hiding this comment

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

LGTM

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants