Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# Python
__pycache__
.venv/

# Build
/typeagent.egg-info
Expand Down
68 changes: 68 additions & 0 deletions docs/VSCode-Setup-Pluging-Pyright.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# VSCode Plugin Setup for Pyright/Pylance

This document describes how to manually install specific versions of the Pylance and Pyright VSCode plugins.

## Background

There is a known issue with pyright version 1.1.407 that causes false positive errors with pydantic dataclasses (see [issue #149](https://github.com/microsoft/typeagent-py/issues/149)). The errors manifest as incorrect warnings like:

- `No parameter named "text"` (reportCallIssue)
- `Expected 0 positional arguments` (reportCallIssue)
- `Cannot access attribute "..." for class "PydanticDataclass"` (reportAttributeAccessIssue)

To avoid these false errors in VSCode, you need to use plugin versions that include pyright 1.1.406.

## Required Plugin Versions

The following VSCode plugin versions use pyright 1.1.406 internally:

### Pylance Plugin

- **Identifier:** `ms-python.vscode-pylance`
- **Required Version:** 2025.9.1 (21 October 2025)
- **Changelog:** https://marketplace.visualstudio.com/items/ms-python.vscode-pylance/changelog

### Pyright Plugin

- **Identifier:** `ms-pyright.pyright`
- **Required Version:** 1.1.406 (Oct 1, 2025)
- **Changelog:** https://marketplace.visualstudio.com/items/ms-pyright.pyright/changelog
- **Release Notes:** https://github.com/microsoft/pyright/releases/tag/1.1.406

## How to Manually Install a Specific Plugin Version

1. **Open the Extensions view** in VSCode (`Ctrl+Shift+X` or `Cmd+Shift+X` on macOS)

2. **Search for the extension** by name (e.g., "Pylance" or "Pyright")

3. **Click on the extension** to open its details page

4. **Click the gear icon** (⚙️) next to the "Uninstall" button

5. **Select "Install Another Version..."** from the dropdown menu

6. **Choose the required version** from the list:
- For Pylance: select version `2025.9.1`
- For Pyright: select version `1.1.406`

7. **Disable automatic updates** for the extension (optional but recommended):
- Click the gear icon again
- Select "Ignore Updates" to prevent VSCode from auto-updating to a newer (potentially broken) version

8. **Restart VSCode** to ensure the changes take effect

## Plugin Version Screenshots

### Pylance Plugin (Version 2025.9.1)

![VSCode Pylance Plugin 2025.9.1](images/VSCode-Setup-Plugin-Pylance-2025-9-1.png)

### Pyright Plugin (Version 1.1.406)

![VSCode Pyright Plugin 1.1.406](images/VSCode-Setup-Plugin-Pyright-1.1.406.png)

## Notes

- You typically only need **one** of these plugins (Pylance or Pyright), not both
- Pylance is the more full-featured option and includes Pyright internally
- Make sure your `.venv` is properly configured and selected in VSCode's Python interpreter picker (shown in the status bar at the bottom)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ known_local_folder = ["conftest"]
[dependency-groups]
dev = [
"isort>=7.0.0",
"pyright==1.1.406",
]
2 changes: 1 addition & 1 deletion src/typeagent/aitools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def reindent(text: str) -> str:


def load_dotenv() -> None:
"""Load environment variables from '<repo_root>/ta/.env'."""
"""Load environment variables from '<repo_root>/.env'."""
# Look for ".env" in current directory and up until root.
cur_dir = os.path.abspath(os.getcwd())
while True:
Expand Down
6 changes: 5 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.