alfin06/swegent-issues-filtered huggingface dataset:
Detecting tool support in OpenRouter

### 📦 Platform

Official Cloud, Self hosting Docker

### 📦 Deploymenet mode

client db (lobe-chat image)

### 📌 Version

1.136.4

### 💻 Operating System

Windows

### 🌐 Browser

Firefox

### 🐛 Bug Description

I believe there's an issue with the way tool support is determined for OpenRouter models.

It seems we currently use the API at `https://openrouter.ai/api/frontend/models` to get the models.
This endpoint is undocumented and it appears that OpenRouter use it specifically for their website's [model comparator](https://openrouter.ai/compare).
Lobe Chat uses a field from this API called `supports_tool_parameters` to determine if tools are supported in a model:

```json
"endpoint": {
  "supports_tool_parameters": false
}
```

But the issue is that the `endpoint` field only returns capabilities of the first provider for a model.

For example, the first provider for `deepseek-r1-0528` is _Chutes_ and it doesn't support tools for the model.
But the forth provider for `deepseek-r1-0528` is _SiliconFlow_ and is does support tools for the same model.

The result is that `deepseek-r1-0528` is detected in Lobe Chat as a model without tool support (unless a user manually re-enable it).

---

However OpenRouter actually provides a documented API for this exact purpose.
It's located at `https://openrouter.ai/api/v1/models` and documented [here](https://openrouter.ai/docs/api-reference/list-available-models).
It also doesn't require authentication to use.

This API is well aware that `deepseek-r1-0528` support tools:

```json
"supported_parameters": [
  "frequency_penalty",
  "include_reasoning",
  "logit_bias",
  "logprobs",
  "max_tokens",
  "min_p",
  "presence_penalty",
  "reasoning",
  "repetition_penalty",
  "response_format",
  "seed",
  "stop",
  "structured_outputs",
  "temperature",
  "tool_choice",
  "tools",
  "top_k",
  "top_logprobs",
  "top_p"
]
```

The `tools` parameter indicates that the model support tools.
This is actually specifically called out in the docs:

> Note: `supported_parameters` is a union of all parameters supported by all providers for this model.

I think this API is the suitable source to get this kind of data instead of what's currently used.

### 📷 Recurrence Steps

Fetch up-to-date models from OpenRouter.

### 🚦 Expected Behavior

Models would be tagged with their actual capabilities supported on OpenRouter.

### 📝 Additional Information

_No response_

Labels: released, unconfirm
State: closed
Reuse container ID for Anthropic Code execution

### Description

No reference to container ID in https://ai-sdk.dev/providers/ai-sdk-providers/anthropic#code-execution

This is key for being able to reuse container from previous turns and access files in the container without having to download/upload manually:
https://docs.claude.com/en/docs/agents-and-tools/tool-use/code-execution-tool#container-reuse


### AI SDK Version

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Labels: feature, provider/anthropic
State: closed
Support ANTHROPIC_BASE_URL env variables

### Description

https://github.com/vercel/ai/blob/f0071177de16c15914308bb2b9e8abc856b6e257/packages/anthropic/src/anthropic-provider.ts#L69

### AI SDK Version

lastest

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Labels: ai/provider, support, provider/anthropic
State: closed
[Bug]: token_count_utils.py does not list new OpenAI models

### Describe the bug

Recent models are missing from the token_count_utils.py listing. Missing models include:

gpt-4-1106-preview
gpt-4-vision-preview
and 
gpt-3.5-turbo-1106






### Steps to reproduce

Call `get_max_token_limit`, `token_left` or `percentile_used` with any of these models. It will throw an exception.

### Expected Behavior

It should report the correct values and not throw an exception.

### Screenshots and logs

_No response_

### Additional Information

_No response_

Labels: good first issue
State: closed
agent_graph.py broken due to missing await

Async function build_graph is not awaited when called recursively for the sub agents. This breaks the graph rendering in the web UI.

for sub_agent in agent.sub_agents:
    await build_graph(graph, sub_agent, highlight_pairs) # add missing await
    draw_edge(agent.name, sub_agent.name)

State: closed
`max_tokens` must be greater than `thinking.budget_tokens`

### Description

Since upgrading to the latest version of ai-sdk v5, I've been getting this error.

Here's the configuration I have:
```  const result = streamText({
    messages: modelMessagesWithSystemPrompt,
    model: anthropic("claude-4-sonnet-20250514"),
    headers: {
      "anthropic-beta": "extended-cache-ttl-2025-04-11",
    },
   tools: [REDACTED]
    maxOutputTokens: 42_000,
    providerOptions: {
      anthropic: {
        thinking: { type: "enabled", budgetTokens: 12000 },
      },
    },
    prepareStep: async (step) => {
      if (step.stepNumber === 0) {
        const usefulContextMessage = await enrichUserMessageWithIntent(
          lastUserMessageText ?? "",
        );
        if (!usefulContextMessage) {
          return step;
        }

        return {
          ...step,
          messages: [
            ...step.messages,
            {
              content: `${usefulContextMessage} \n\n The user message is below:\n${lastUserMessageText}`,
              role: "user" as const,
            },
          ],
        };
      }

      return step;
    },
    stopWhen: stepCountIs(30),
    onFinish: async (finishResult) => {
      await sandbox.betaPause();
      logger.log(
        `Usage: ${finishResult.usage.inputTokens} input tokens, \n ${finishResult.usage.outputTokens} output tokens, \n cached: ${finishResult.usage.cachedInputTokens} cached input tokens. \n ${finishResult.usage.totalTokens} total tokens.`,
      );
    },
    onError: async (error) => {
      logger.error(JSON.stringify(error, null, 2));
      await sandbox.betaPause();
    },
    experimental_repairToolCall: async ({ toolCall, tools, inputSchema }) =>
      repairToolCall(toolCall, tools, inputSchema),
  });
```

### AI SDK Version

```
 "@ai-sdk/anthropic": "^2.0.35",
 "@ai-sdk/openai": "^2.0.53",
"ai": "^5.0.76",  
```


### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Labels: bug, ai/core, ai/provider, provider/anthropic
State: closed
[BUG] LiteLLM Model Does Not Throw ContextWindowOverflowException

### Checks

- [x] I have updated to the lastest minor and patch version of Strands
- [x] I have checked the documentation and this is not expected behavior
- [x] I have searched [./issues](./issues?q=) and there are no duplicates of my issue

### Strands Version

1.8.0

### Python Version

3.13.1

### Operating System

macOS 15.7

### Installation Method

pip

### Steps to Reproduce

```
from strands import Agent
from strands.models.litellm import LiteLLMModel
from strands.types.exceptions import ContextWindowOverflowException

model = LiteLLMModel(model_id="litellm_proxy/us.anthropic.claude-3-7-sonnet-20250219-v1:0", params={
    "api_base": "http://0.0.0.0:4000",
    "api_key": "key"
})
agent = Agent(model=model)

try:
    agent("Hi"*1000000)
except ContextWindowOverflowException as e:
    print(f"Caught context window overflow exception: {e}")
except Exception as e:
    print(f"Did not catch context window overflow exception: {e}")
```

### Expected Behavior

Caught context window overflow exception: ...

### Actual Behavior

Did not catch context window overflow exception: litellm.ContextWindowExceededError: litellm.BadRequestError: Error code: 400 - {'error': {'message': 'litellm.ContextWindowExceededError: litellm.BadRequestError: BedrockException: Context Window Error - {"message":"The model returned the following errors: Input is too long for requested model."}\nmodel=us.anthropic.claude-3-7-sonnet-20250219-v1:0. context_window_fallbacks=None. fallbacks=None.\n\nSet \'context_window_fallback\' - https://docs.litellm.ai/docs/routing#fallbacks. Received Model Group=us.anthropic.claude-3-7-sonnet-20250219-v1:0\nAvailable Model Group Fallbacks=None', 'type': None, 'param': None, 'code': '400'}}

### Additional Context

This is useful for conversation management and automatic handling / pruning.

### Possible Solution

Implement model client exception handling similar to bedrock model: https://github.com/strands-agents/sdk-python/blob/08dc4aeaad6e75dc273d41a9898e0d08df09863b/src/strands/models/bedrock.py#L713C1-L715C63

### Related Issues

_No response_

Labels: bug, ready for contribution
State: closed
"AI Service Provider" 里模型能力与实际使用时模型能力不一致

### 📦 Platform

Self hosting Docker

### 📦 Deploymenet mode

server db(lobe-chat-database image)

### 📌 Version

1.138.2

### 💻 Operating System

Other

### 🌐 Browser

Chrome

### 🐛 Bug Description

如图：Provider 里 GPT-5 是有搜索能力的，但实际对话中选择 GPT-5 确没有“模型自带搜索”能力

GPT-5 为 OpenAI 官 KEY

<img width="1088" height="587" alt="Image" src="https://github.com/user-attachments/assets/75ce1829-5963-4dba-9673-4c2f8f8d6937" />
<img width="526" height="819" alt="Image" src="https://github.com/user-attachments/assets/ccc861f3-790d-4d3d-93ea-cc8065be691c" />
<img width="483" height="292" alt="Image" src="https://github.com/user-attachments/assets/af3365fa-0b3f-4c22-8fe5-9ab1fc18dbb2" />

### 📷 Recurrence Steps

_No response_

### 🚦 Expected Behavior

_No response_

### 📝 Additional Information

_No response_

Labels: released, Model Provider, deployment:server, docker, priority:medium, feature:settings, provider:openai, platform:web, hosting:self-host
State: closed
Not able to use tools with strucutred output in anthropic provider

### Description

When using output with tools in anthropic, it ignores tools and just passes json response tool to get the structured output, why is this like this ?

<img width="720" height="289" alt="Image" src="https://github.com/user-attachments/assets/bd9071a9-d1ef-47a1-8185-973d60520791" />

### AI SDK Version

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Labels: feature, ai/provider, provider/anthropic
State: closed
[BUG] Passing SageMakerAIEndpointConfig additional_args raises error

### Checks

- [x] I have updated to the lastest minor and patch version of Strands
- [x] I have checked the documentation and this is not expected behavior
- [x] I have searched [./issues](./issues?q=) and there are no duplicates of my issue

### Strands Version

1.10

### Python Version

3.13.3

### Operating System

macOS 15.7

### Installation Method

pip

### Steps to Reproduce

1. Create a Strands `SageMakerAIModel` with a dict of `additional_args` in the endpoint config, for example:

```python
model = SageMakerAIModel(
    endpoint_config={
        "endpoint_name": "{your-endpoint}",
        "additional_args": {
            "TargetContainerHostname": "my-cool-container",
        },
    },
)
```

2. Try to invoke the model (either direct or via an agent)

### Expected Behavior

The `additional_args` should be passed through to the SageMaker AI endpoint.

### Actual Behavior

Invocation fails with error at [this line](https://github.com/strands-agents/sdk-python/blob/776fd93751cc26e3d535776b17612c2e3068cc2b/src/strands/models/sagemaker.py#L285):

```
AttributeError: 'dict' object has no attribute '__dict__'
```

### Additional Context

(At least in CPython 3.12 and 3.13 on macOS), it seems that dictionary objects **don't have** a `__dict__` property. Maybe there are some other versions or platforms where this is/was working? I couldn't tell for sure from the Python docs.

The [equivalent section in Strands BedrockModel](https://github.com/strands-agents/sdk-python/blob/776fd93751cc26e3d535776b17612c2e3068cc2b/src/strands/models/bedrock.py#L275) is **not** broken, because it just directly passes through the `self.config["additional_args"]` rather than attempting to fetch `.__dict__` of it.

### Possible Solution

Since additional_args is [type-hinted as a Python dictionary](https://github.com/strands-agents/sdk-python/blob/776fd93751cc26e3d535776b17612c2e3068cc2b/src/strands/models/sagemaker.py#L133), I suggest the fix should be to remove the unnecessary `.__dict__` accessor and just stick with:

```python
# Add additional args if provided
if self.endpoint_config.get("additional_args"):
    request.update(self.endpoint_config["additional_args"])
```

### Related Issues

_No response_

Labels: bug
State: closed
Add support for MPT-7B.

https://huggingface.co/mosaicml/mpt-7b-storywriter

The model appears to be a great alternative to LLaMA from surface observations, particularly for commercial use. I expect many groups to build upon this foundation going forward if it does hold up.

Can someone perhaps look into adding support for this model?

Labels: good first issue
State: closed
[BUG] SageMaker payload additional_args being ignored

### Checks

- [x] I have updated to the lastest minor and patch version of Strands
- [x] I have checked the documentation and this is not expected behavior
- [x] I have searched [./issues](./issues?q=) and there are no duplicates of my issue

### Strands Version

1.10.0

### Python Version

3.13.3

### Operating System

macOS 15.7

### Installation Method

pip

### Steps to Reproduce

1. Create a Strands `SageMakerAIModel` with a dict of additional_args in the payload config, for example:

```python
model = SageMakerAIModel(
    endpoint_config={
        "endpoint_name": "{your-endpoint}",
    },
    payload_config={
        "additional_args": {
            "logprobs": True,
        },
    }
)
```

2. Invoke the model (either direct or via an agent) and check the generated payload (or just call the `model.format_request(...)` method to check it out)


### Expected Behavior

The extra parameters provided in payload_config.additional_args should be added to the `Body` of every request.

### Actual Behavior

The `additional_args` are ignored because:
1. This key of payload_config is (correctly) skipped over when directly adding config keys to the payload [here](https://github.com/strands-agents/sdk-python/blob/776fd93751cc26e3d535776b17612c2e3068cc2b/src/strands/models/sagemaker.py#L237)... but
2. Nothing after that actually unpacks the *contents* of additional_args to the payload as expected. Only the endpoint_config.additional args are addressed ([here](https://github.com/strands-agents/sdk-python/blob/776fd93751cc26e3d535776b17612c2e3068cc2b/src/strands/models/sagemaker.py#L283C9-L285C77)) which are different because those are actual boto3 parameters, not components within the payload.

### Additional Context

As far as I can tell (since some docs are missing), it seems like the intention in the current implementation was for:
- `SageMakerAIEndpointConfig.additional_args` to allow inserting additional top-level SageMaker boto3 `invoke_endpoint(...)` or `invoke_endpoint_with_response_stream(...)` [arguments](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sagemaker-runtime/client/invoke_endpoint.html) (presumably for features like `EnableExplanations`, TargetContainerName`, or etc)
- `SageMakerAIPayloadSchema.additional_args` to allow inserting additional fields to the actual body of your requests to the model (like requesting logprobs, setting non-standard hyperparameters, or etc).

### Possible Solution

Assuming the above interpretation is correct, I think we just need to add a step in `format_request()` to update the `payload` with the `self.payload_config["additional_args"]`, where they're present?

### Related Issues

Found during investigation of #982

Labels: bug
State: closed
feature request: add output to StreamTextResult

### Description

would be nice to have `output: Promise<PartialObject<OUTPUT>>` on `StreamTextResult` similar to `text` and `reasoning`.

e.g.
```ts
  const { output } = streamText({
    model: openai('gpt-5'),
    output: Output.object({
      schema: z.object({ /* schema definition */}),
    }),
    prompt: 'Generate an example person for testing.',
  });
```

### AI SDK Version

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Labels: feature, ai/core
State: closed
Support custom provider name for anthropic and google provider

### Description

With the `baseURL` of `createAnthropic` and `createGoogleGenerativeAI`, we can use some providers that offer Anthropic or Gemini-compatible APIs. Therefore, we hope to pass in a custom provider name to make it easier to identify specific providers in logging and error tracking.

### AI SDK Version

- ai: 5.0

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Labels: ai/provider, support, provider/anthropic, provider/community
State: closed
MCP Prompts Support in MCPClient

### Description

Continuation to #6294, we need to add support for prompts that the MCP server is surfacing.

[Reference docs here](https://modelcontextprotocol.io/specification/2025-06-18/server/prompts)

### AI SDK Version

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Labels: ai/mcp
State: closed
Checking OpenAI API key having full permission and worked in Wren AI at launch stage

**Is your feature request related to a problem? Please describe.**
Seeing users (for example: #998 ) encountered issues when asking questions without knowing it's OpenAI API key issues.

**Describe the solution you'd like**
We probably want to make a hello request to OpenAI API to make sure that the key is valid and credit balance is positive at launch stage of launcher.

**Describe alternatives you've considered**
We probably want to make the error like `insufficient quota` more clear on UI as well.

Error example
```
openai.RateLimitError: Error code: 429 - {'error': {'message': 'You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.', 'type': 'insufficient_quota', 'param': None, 'code': 'insufficient_quota'}}
```

Labels: good first issue, feature-request
State: closed