Skip to content

agent: Remove duplicated description from tool schema#52678

Merged
bennetbo merged 1 commit intomainfrom
remove-duplicate-description-from-tool
Mar 29, 2026
Merged

agent: Remove duplicated description from tool schema#52678
bennetbo merged 1 commit intomainfrom
remove-duplicate-description-from-tool

Conversation

@bennetbo
Copy link
Copy Markdown
Member

@bennetbo bennetbo commented Mar 29, 2026

Turns out we were including the description of a tool inside the schema again, which I don't think is needed.
Before:

LanguageModelRequestTool {
    name: "web_search",
    description: "Search the web for information using your query.\nUse this when you need real-time information, facts, or data that might not be in your training.\nResults will include snippets and links from relevant web pages.",
    input_schema: Object {
        "required": Array [
            String("query"),
        ],
        "description": String("Search the web for information using your query.\nUse this when you need real-time information, facts, or data that might not be in your training.\nResults will include snippets and links from relevant web pages."),
        "type": String("object"),
        "properties": Object {
            "query": Object {
                "description": String("The search term or question to query on the web."),
                "type": String("string"),
            },
        },
        "additionalProperties": Bool(false),
    },
    use_input_streaming: false,
},

After:

LanguageModelRequestTool {
    name: "web_search",
    description: "Search the web for information using your query.\nUse this when you need real-time information, facts, or data that might not be in your training.\nResults will include snippets and links from relevant web pages.",
    input_schema: Object {
        "required": Array [
            String("query"),
        ],
        "type": String("object"),
        "properties": Object {
            "query": Object {
                "description": String("The search term or question to query on the web."),
                "type": String("string"),
            },
        },
        "additionalProperties": Bool(false),
    },
    use_input_streaming: false,
},

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content is consistent with the UI/UX checklist
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Closes #45315

Release Notes:

  • agent: Reduced amount of tokens consumed by tool descriptions

@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Mar 29, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label Mar 29, 2026
@bennetbo bennetbo marked this pull request as ready for review March 29, 2026 18:52
@zed-codeowner-coordinator zed-codeowner-coordinator Bot requested review from a team, benbrandt and mikayla-maki and removed request for a team March 29, 2026 18:52
@bennetbo bennetbo merged commit 46a0262 into main Mar 29, 2026
49 checks passed
@bennetbo bennetbo deleted the remove-duplicate-description-from-tool branch March 29, 2026 18:59
piper-of-dawn pushed a commit to piper-of-dawn/zed that referenced this pull request Apr 25, 2026
…#52678)

Turns out we were including the description of a tool inside the schema
again, which I don't think is needed.
Before:
```
LanguageModelRequestTool {
    name: "web_search",
    description: "Search the web for information using your query.\nUse this when you need real-time information, facts, or data that might not be in your training.\nResults will include snippets and links from relevant web pages.",
    input_schema: Object {
        "required": Array [
            String("query"),
        ],
        "description": String("Search the web for information using your query.\nUse this when you need real-time information, facts, or data that might not be in your training.\nResults will include snippets and links from relevant web pages."),
        "type": String("object"),
        "properties": Object {
            "query": Object {
                "description": String("The search term or question to query on the web."),
                "type": String("string"),
            },
        },
        "additionalProperties": Bool(false),
    },
    use_input_streaming: false,
},
```



After:
```
LanguageModelRequestTool {
    name: "web_search",
    description: "Search the web for information using your query.\nUse this when you need real-time information, facts, or data that might not be in your training.\nResults will include snippets and links from relevant web pages.",
    input_schema: Object {
        "required": Array [
            String("query"),
        ],
        "type": String("object"),
        "properties": Object {
            "query": Object {
                "description": String("The search term or question to query on the web."),
                "type": String("string"),
            },
        },
        "additionalProperties": Bool(false),
    },
    use_input_streaming: false,
},
```


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes zed-industries#45315

Release Notes:

- agent: Reduced amount of tokens consumed by tool descriptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tools description duplication in LMstudio\OpenAI compatible

2 participants