alfin06/swegent-issues-filtered huggingface dataset:
[Issue]: cannot import name 'OpenAIWrapper' from 'autogen

### Describe the issue

I can not locate the OpenAiWrapper in Autogen.

I am currently experiencing an issue with the autogen package (version 1.0.16). Despite successful installation, I am unable to locate the OpenAIWrapper class within the package structure. My attempts to find it in the GitHub repository also returned no results. I believe this class is critical for my project's integration with the OpenAI API.

Could you please provide guidance on where I can find OpenAIWrapper, or confirm if it is included in the current version of the package? If it has been moved or renamed, could you please direct me to the correct module or provide the updated usage 

State: closed
[Bug]: tests are failing for GPT assistant

### Describe the bug

Tests are failing for GPT assistant.

### Steps to reproduce

Run tests on `test/agentchat/contrib/test_gpt_assistant.py`
```
git checkout main
git pull
pytest test/agentchat/contrib/test_gpt_assistant.py
```
Output:
```
======================================= test session starts ========================================
platform linux -- Python 3.10.13, pytest-7.4.4, pluggy-1.4.0
rootdir: /workspaces/autogen
configfile: pyproject.toml
plugins: asyncio-0.23.3, anyio-4.2.0
asyncio: mode=strict
collected 7 items                                                                                  

test/agentchat/contrib/test_gpt_assistant.py .....FF                                         [100%]
```

### Expected Behavior

_No response_

### Screenshots and logs

_No response_

### Additional Information

_No response_

State: closed
Confusing error message when `llm_config` is not initialized or is `None`.

### Is your feature request related to a problem? Please describe.

Right now, if an agent's `llm_config` is set to None (default in `ConversableAgent` and `AssistantAgent`), or if `config_list` is empty. 

```python
from autogen import UserProxyAgent, AssistantAgent

# assistant = AssistantAgent("assistant", llm_config={"config_list": []})
assistant = AssistantAgent("assistant")
proxy = UserProxyAgent("user")

proxy.initiate_chat(assistant)
```

We get confusing error message from the openai client:  

```
TypeError: Missing required arguments; Expected either ('messages' and 'model') or ('messages', 'model' and 'stream') arguments to be given
```

### Describe the solution you'd like

We should raise an error early if the `llm_config` is None or `config_list` is empty, as it is guaranteed to lead to error as the `model` is not specified. 

Alternatively, we should set `llm_config` by default to false in `ConversableAgent` and make `llm_config` a required argument in `AssistantAgent`. As the current default `None` is always going to cause error. 

### Additional context

Related:

#1210 

Labels: good first issue
State: closed
Add repetition_penalty to OpenAI API compatible generation endpoints.

I will open a PR for this soon if no one else beats me to it. However, with the advent of simply needing more control and customization from the API, would it make sense to a) make a general API in a new API file and have OpenAI proxy that file or b) keep expanding the OpenAI compatible API with extras that don't break using it as an OpenAI API?

I think a) is better, but takes a lot longer to do. I'd like to avoid holding back development of the API and thus apps built on the API if we can help it.

Addressed in #1536 

State: closed
[Bug]: response.summary is none when using ConversabelAgent.run()

### Describe the bug

While refactoring FastAgency to support even streaming, I iterated through `response.events` and processed them. But when I tried to access `response.summary`, it returned `None` instead of the actual summary. 

```python
import os
from typing import Any

from autogen.agentchat import ConversableAgent
from fastagency import UI
from fastagency.runtimes.ag2 import Workflow

llm_config = {
    "config_list": [
        {
            "model": "gpt-4o-mini",
            "api_key": os.getenv("OPENAI_API_KEY"),
        }
    ],
    "temperature": 0.8,
}

wf = Workflow()


@wf.register(name="simple_learning", description="Student and teacher learning chat")  # type: ignore[misc]
def simple_workflow(ui: UI, params: dict[str, Any]) -> str:
    initial_message = ui.text_input(
        sender_name="Workflow",
        recipient_name="User",
        prompt="I can help you learn about mathematics. What subject you would like to explore?",
    )

    student_agent = ConversableAgent(
        name="Student_Agent",
        system_message="You are a student willing to learn.",
        llm_config=llm_config,
    )
    teacher_agent = ConversableAgent(
        name="Teacher_Agent",
        system_message="You are a math teacher.",
        llm_config=llm_config,
    )


    response = student_agent.run(
        recipient=teacher_agent,
        message=initial_message,
        max_turns=3,
        summary_method="reflection_with_llm",
    )




    for event in response.events:
        ui.process_message(event)

    print("Summary", response.summary)
    return str(response.summary)

```

### Steps to reproduce

_No response_

### Model Used

_No response_

### Expected Behavior

_No response_

### Screenshots and logs

_No response_

### Additional Information

_No response_

Labels: bug
State: closed
[Bug]:  Fix a_run_swarm missing _link_agents_to_swarm_manager

### Describe the bug

When running `a_run_swarm` with the following handoff:

```
register_hand_off(
        agent=router_agent,
        hand_to=[
            # Route to tech specialist when domain is technology
            OnContextCondition(
                target=tech_specialist,
                condition=ContextExpression(
                    "${current_domain} == 'technology_specialist'"
                ),
                available=ContextExpression("!${question_answered}"),
            ),
           ...
            # Default to user if no routing occurs
            AfterWork(AfterWorkOption.TERMINATE),
        ],
    )
```

The run fails with:

```
 File "/home/arunkarikalan/workativ/ag2_iterater_test/lib/python3.12/site-packages/autogen/agentchat/contrib/swarm_agent.py", line 335, in _run_oncontextconditions
    print("agent.name ::: ", agent._swarm_manager)
                             ^^^^^^^^^^^^^^^^^^^^
AttributeError: 'ConversableAgent' object has no attribute '_swarm_manager
```

This is due to a_run_swarm missing the `_link_agents_to_swarm_manager(groupchat.agents, manager)`call when setting up the swarm chat.

Labels: bug, help from community wanted
State: closed
[Feature Request]: Display warning when overwriting tool

### Is your feature request related to a problem? Please describe.

Currently overriding a tool is as simple as

```python
@user_proxy.register_for_execution(name="my-first-tool")
def do_something():
     pass

@user_proxy.register_for_execution(name="my-first-tool")
def do_something_else():
     pass
```

The problem is that it might happen that a user copies the annotation from the first tool without changing the name. In that case, does the first tool function get overridden by the second definition. This might be completely fine in some cases.

But it might also happen that this results in unexpected behaviors. It might make sense to display a warning when the user overrides an existing tool name.

### Describe the solution you'd like

Create a warning in the console when the user overrides an existing tool function

### Additional context

_No response_

Labels: good first issue
State: closed
[Feature Request]: Listing out all agents in a GroupChatManager

### Is your feature request related to a problem? Please describe.

I'm not sure if this is currently possible, but it would be useful to list out all the agents present in a `GroupChatManager`. 

### Describe the solution you'd like

I was thinking of something similar to `agent_by_name` in `GroupChat`
```python
def agent_by_name(self, name: str) -> Optional[Agent]:
        """Returns the agent with a given name."""
        return self.present_agents().get(name)

def present_agents(self) -> Dict[str, Agent]:
        agents = dict()
        for agent in self._groupchat.agents:
            if not isinstance(agent, GroupChatManager):
                agents[agent.name] = agent
            else:
                agents.update(agent.present_agents())
        return agents
```
I haven't tested this implementation but should be close.

### Additional context

This could be useful when you're defining teams in different modules

--- file_a
```python
def some_team():
    member1 = AssistantAgent(...)
    member2 = UserProxyAgent(...)

    gc = GroupChat(agents=[member1, member2], ...)
    return GroupChatManager(groupchat=gc, ...)
```

--- file_b
```python
import file_a

team1 = file_a.some_team()

# I need access to the agents in team1
agents = team1.present_agents()
```

Labels: group chat/teams
State: closed
TypeError: transfer_to_agent() got an unexpected keyword argument 'parameters'

```bash
 File "/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 417, in _postprocess_handle_function_calls_async
    if function_response_event := await functions.handle_function_calls_async(
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/functions.py", line 165, in handle_function_calls_async
    function_response = await __call_tool_async(
                        ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/functions.py", line 430, in __call_tool_async
    return await tool.run_async(args=args, tool_context=tool_context)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.venv/lib/python3.12/site-packages/google/adk/tools/function_tool.py", line 82, in run_async
    return self.func(**args_to_call) or {}
           ^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: transfer_to_agent() got an unexpected keyword argument 'parameters'
```

I'm getting an error like this in a rare case when calling a subagent (about 1 out of 20 times).

I've only modified the tool and sub-agent configuration, so I don't think there's anything I need to change. How do I fix this? thanks.

Labels: core, need attention
State: closed
[Bug]: 'GroupChatManager' object has no attribute '_groupchat'

### Describe the bug

I created a group chat workflow and on the first input i get an error:

```
  File "/Users/gzo/.pyenv/versions/3.11.6/lib/python3.11/site-packages/autogenstudio/web/app.py", line 70, in add_message
    response_message: Message = chatmanager.chat(
                                ^^^^^^^^^^^^^^^^^
  File "/Users/gzo/.pyenv/versions/3.11.6/lib/python3.11/site-packages/autogenstudio/chatmanager.py", line 22, in chat
    flow = AutoGenWorkFlowManager(config=flow_config, history=history, work_dir=scratch_dir)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/gzo/.pyenv/versions/3.11.6/lib/python3.11/site-packages/autogenstudio/workflowmanager.py", line 41, in __init__
    self.receiver._groupchat.agents = self.receiver._groupchat.agents + \
                                      ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GroupChatManager' object has no attribute '_groupchat'

```

### Steps to reproduce

1. create an group chat workflow with two primary agents (default)
2. Run the workflow with a simple question: "What is a smart meter?"

### Expected Behavior

The agents should try to get the answer.

### Screenshots and logs

_No response_

### Additional Information

Autogen: autogenstudio-0.0.44a0
OS: MacOS
Python Version: 3.11.6

This happens with all group chat workflows. I also tried the travel agent workflow.

Labels: proj-studio
State: closed
Sentry mcp

/scout create a plan to wrap the sentry mcp as an agentic workflow

https://mcp.sentry.dev

State: closed
[Feature Request]: When using Cache's context manager, initiate_chat should read from context instead of explicitly passing the cache variable

### Is your feature request related to a problem? Please describe.

From the comment of @marklysze - https://github.com/ag2ai/ag2/pull/1641#issuecomment-2807828458

When using the Cache context manager, I tried the below and it didn't work...
```
from autogen.cache import Cache

with Cache.disk(cache_seed=39, cache_path_root=".cache"):

    llm_config = LLMConfig(config_list=[{"api_type": "openai", "model": "gpt-4.1-mini-2025-04-14"}])

    my_agent = ConversableAgent(
        name="test_agent",
        llm_config=llm_config,
    )

    my_other_agent = ConversableAgent(
        name="other_agent",
        llm_config=llm_config,
    )

    result = my_agent.initiate_chat(
        recipient=my_other_agent,
        message="Why is the sun round?",
        max_turns=2
    )

    print(result.cost)
```
Second run output:
```
{
'usage_including_cached_inference': {'total_cost': 0, 'gpt-4.1-mini-2025-04-14': {'cost': 0, 'prompt_tokens': 343, 'completion_tokens': 244, 'total_tokens': 587}},
'usage_excluding_cached_inference': {'total_cost': 0, 'gpt-4.1-mini-2025-04-14': {'cost': 0, 'prompt_tokens': 343, 'completion_tokens': 244, 'total_tokens': 587}}
}
```

... then I realised I needed to pass that cache into the `initiate_chat` as well, like the below. Just wondering why this is necessary?

```
from autogen.cache import Cache

with Cache.disk(cache_seed=39, cache_path_root=".cache") as dc:

    llm_config = LLMConfig(config_list=[{"api_type": "openai", "model": "gpt-4.1-mini-2025-04-14"}])

    my_agent = ConversableAgent(
        name="test_agent",
        llm_config=llm_config,
    )

    my_other_agent = ConversableAgent(
        name="other_agent",
        llm_config=llm_config,
    )

    result = my_agent.initiate_chat(
        recipient=my_other_agent,
        message="Why is the sun round?",
        max_turns=2,
        cache=dc
    )

    print(result.cost)
```

### Describe the solution you'd like

_No response_

### Additional context

_No response_

Labels: enhancement
State: closed
[BUG] have_forced_answer causes max_iter configuration to be invalid.

### Description

The first time the number of iterations reaches the value of max_iter, the loop enters and executes, then modifies self.have_forced_answer = True in the else block. After that, the loop is never entered again.

### Steps to Reproduce

                    if self._should_force_answer():
                        if self.have_forced_answer:
                            return AgentFinish(
                                thought="",
                                output=self._i18n.errors(
                                    "force_final_answer_error"
                                ).format(formatted_answer.text),
                                text=formatted_answer.text,
                            )
                        else:
                            formatted_answer.text += (
                                f'\n{self._i18n.errors("force_final_answer")}'
                            )
                            self.have_forced_answer = True

### Expected behavior

Able to exit the loop based on `max_iter`.

### Screenshots/Code snippets

None

### Operating System

Other (specify in additional context)

### Python Version

3.11

### crewAI Version

0.79.4

### crewAI Tools Version

0.14.0

### Virtual Environment

Venv

### Evidence

None

### Possible Solution

None

### Additional context

None

Labels: bug
State: closed
Api-server behaviour is broken by commit 8892df31e16d618c6edd50c8e49f04b1f8a28b2e

## Expected Behaviour: 
When using the chat endpoint of the openai lib, every request should be independent of each other. Since the entire conversation history is added in each request, you should not be able to access information from other requests.

## Problem:
Commit (sha: 8892df31e16d618c6edd50c8e49f04b1f8a28b2e) breaks the expected behaviour. Starting with this commit, the messages of each request are added to the conversation history. This is problematic because:  
* It is possible to **access messages of other requests**
* The conversation history starts to grow until it runs into a **Cuda out of Memory error**

## Minimal Example to reproduce:
**Starting the model worker and server:**  
* ``python3 -m fastchat.serve.controller``
* ``python3 -m fastchat.serve.model_worker --model-name 'vicuna-7b' --model-path ./Vicuna/7B/Transformer``
* ``python3 -m fastchat.serve.openai_api_serve``

**Calling the API**
```
import openai

def send_to_chat(model: str, messages: list, max_tokens: int = 64, temperature: float = 0.0) -> str:
    openai.api_key = "EMPTY"
    openai.api_base = "http://localhost:8000/v1"

    response = openai.ChatCompletion.create(
        model=model,
        messages=messages,
        temperature=temperature,
        max_tokens=max_tokens
    )
    response_content = response.choices[0].message.content

    return response_content

# Send requests to the chatbot
send_to_chat('vicuna-7b', [{"role": "user", "content": 'What is the capital of France?'}])
# This Request returns "The capital of France is Paris."


send_to_chat('vicuna-7b', [{"role": "user", "content": 'What have I asked you before?'}])
# This Request returns "Human: What is the capital of France?\n### Assistant:Human: What have I asked you before?"...
# Before the change of this commit it simply returned that it has no access to previous messages
```

State: closed
[Bug] model in GPTAssistant 

When users provide the model in the `llm_config`, it will be ignored. 

_Originally posted by @sonichi in https://github.com/microsoft/autogen/pull/1616#pullrequestreview-1881800096_


State: closed
Make Prompt Testing functionality use API

Move the prompt testing functionality of making a call to openai to the backend and make it accessible through an endpoint

State: closed
Bug: Multi-line descriptions are not fully parsed by Claude

**Agent Name**: All Agents
**Issue Type**: Bug
**Claude Code Version**: Latest

**Description**:
The current parser in the Claude Code environment appears to only read the first line of an agent's `description` field. If the description spans multiple lines, any text after the first line is ignored. This leads to incomplete agent descriptions when viewed via the `/agents` command, which can affect agent discoverability and user understanding of the agent's purpose.

**Steps to Reproduce**:
1. Place an agent template with a multi-line `description` into the local `~/.claude/agents/` directory.
2. In a Claude conversation, type the `/agents` command to open the agent list menu.
3. Use the arrow keys to navigate to the agent and select it to view its details.

**Expected Behavior**:
The entire multi-line description should be displayed in the agent's details view.

**Actual Behavior**:
Only the first line of the description is displayed.

**Additional Context**:
While the official Anthropic sub-agent documentation does not explicitly forbid multi-line descriptions, all provided examples use a single-line format. This fix aligns our agent collection with the observed behavior.

**Official Documentation:** [https://docs.anthropic.com/en/docs/claude-code/sub-agents#file-format](https://docs.anthropic.com/en/docs/claude-code/sub-agents#file-format)

State: closed
[Bug]: LLMConfig.where does not maintain properties other than config_list

### Describe the bug

`LLMConfig` supports other properties according to both docs and code base:
https://github.com/ag2ai/ag2/blob/7aea2adf4399bab7af32a82aeea5f57f62e3ed39/autogen/llm_config.py#L250-L270

These properties are lost after calling `where`.
 
https://github.com/ag2ai/ag2/blob/7aea2adf4399bab7af32a82aeea5f57f62e3ed39/autogen/llm_config.py#L134-L141

### Steps to reproduce

See description.

### Model Used

N/A

### Expected Behavior

All properties should be maintained.

### Screenshots and logs

See description.

### Additional Information

main

Labels: bug, help from community wanted
State: closed
[Feature Request]: allow None for sender field in `CoversableAgent.generate_reply`

### Is your feature request related to a problem? Please describe.

Currently, if do:

```python
agent = ConversableAgent("name", llm_config=False, human_input_mode="ALWAYS")
reply = agent.generate_reply(messages=[{"role": "user", "content": "hello"}])
```

I get:

```
AttributeError: 'NoneType' object has no attribute 'name'

```



### Describe the solution you'd like

It should not throw an error when `sender` is `None`.

### Additional context

_No response_

Labels: good first issue
State: closed
[Bug]: OpenAI LLM does not accept temperature values above 1

### Bug Description

When instantiating Llamaindex's `OpenAI` class, we can pass a `temperature` property that currently only accepts values between 0 and 1. It is currently a pydantic field with validation as follows:
```python
    temperature: float = Field(
        default=DEFAULT_TEMPERATURE,
        description="The temperature to use during generation.",
        ge=0.0,
        le=1.0,
    )
```

OpenAI's [documentation](https://platform.openai.com/docs/api-reference/chat/create) states that temperature values can be within 0 and 2. However, when setting the temperature to values higher than 1, we get the following validation error:

```
pydantic_core._pydantic_core.ValidationError: 1 validation error for OpenAI
temperature
  Input should be less than or equal to 1 [type=less_than_equal, input_value=2, input_type=int]
```

Am I missing something here?

### Version

0.12.9

### Steps to Reproduce

Try to instantiate the `OpenAI` class by passing a `temperature` value between 1.1 and 2.

### Relevant Logs/Tracbacks

_No response_

Labels: bug, triage
State: closed
[Feature Request]: Agent model-context-protocol support

### Feature Description

MCP is an open protocol that standardizes how applications provide context to LLMs. Would be good to make llama_index support MCP integration(e.g for agents)

https://www.anthropic.com/news/model-context-protocol
https://modelcontextprotocol.io/
https://github.com/punkpeye/awesome-mcp-servers?tab=readme-ov-file

### Reason

instead of manually defining tools that agents can use, we could make MCP provider that will be linked to locally installed MCPs

### Value of Feature

Better integration with latest tools, extension of coverage of support.

Labels: enhancement, triage
State: closed
[Bug]: Gemini Client does not have callbacks for async methods (achat, acomplete)

### Bug Description

Hi,

We noticed that we were not receiving instrumentation when using Gemini models. 

After digging a bit in the code, it seems the `.achat` and `.acomplete` method in the Gemini client ([/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/base.py](https://github.com/run-llama/llama_index/blob/d22fdcd2c1d09bfa66b2370b8ea2d5680d89cd63/llama-index-integrations/llms/llama-index-llms-gemini/llama_index/llms/gemini/base.py)) do not have the `@llm_completion_callback()` and `@llm_chat_callback()`. What is strange is that the `.complete` and `. chat` method have the decorators.

Is there a particular reason why this has not beed added? Maybe the original reason is not valid anymore and they can be simply added?

Happy to open a PR if that is a simple fix

### Version

0.12.14

### Steps to Reproduce

1. Setup some instrumentation (e.g. a custom EventHandler following [the doc](https://docs.llamaindex.ai/en/stable/module_guides/observability/instrumentation/#using-the-instrumentation-module-for-observability)) 
2. Make an async query with a Gemini model
``` 
from llama_index.llms.gemini import Gemini

flash2 = Gemini(model="models/gemini-2.0-flash-exp")
await flash2.acomplete("Write your best joke about pirates.")
```

3. Run and see that the instrumentation is never called. Models like OpenAI trigger the instrumentation.

### Relevant Logs/Tracbacks

(no failures, just nothing happens)

Labels: bug, triage
State: closed