You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+63-1Lines changed: 63 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -136,6 +136,34 @@ libraries/
136
136
- MCP (Model Context Protocol) integration
137
137
- Framework-specific adapters for tool execution
138
138
139
+
### Centralized Dependency Version Management
140
+
141
+
This monorepo uses uv's `constraint-dependencies` feature to centralize version constraints:
142
+
143
+
**How it works:**
144
+
1.**Root pyproject.toml** defines version constraints for all external packages
145
+
2.**Package pyproject.toml** files declare dependencies by name only (no version)
146
+
3.**uv** applies root constraints during dependency resolution
147
+
148
+
**Adding a new dependency:**
149
+
1. Add the package name to your package's `dependencies` array
150
+
2. Add the version constraint to root `pyproject.toml``constraint-dependencies`
151
+
3. Run `uv lock && uv sync`
152
+
153
+
**Updating a dependency version:**
154
+
1. Edit the constraint in root `pyproject.toml` only
155
+
2. Run `uv lock && uv sync`
156
+
3. All packages automatically use the new version
157
+
158
+
**Internal workspace dependencies:**
159
+
- Package pyproject.toml files list internal deps by name only (e.g., `microsoft-agents-a365-runtime`)
160
+
- Root pyproject.toml `[tool.uv.sources]` maps them to `{ workspace = true }` for local development
161
+
- At build time, `setup.py` injects exact version matches (e.g., `== 1.2.3`) for published packages
162
+
- This ensures all SDK packages require the exact same version of each other
163
+
164
+
**CI Enforcement:** The `scripts/verify_constraints.py` script runs in CI to prevent
165
+
accidental reintroduction of version constraints in package files.
166
+
139
167
### Test Organization
140
168
141
169
Tests mirror the library structure:
@@ -168,11 +196,45 @@ Place it before imports with one blank line after.
168
196
169
197
### Python Conventions
170
198
171
-
- Type hints preferred (Pydantic models heavily used)
199
+
- Type hints required on all function parameters and return types
172
200
- Async/await patterns for I/O operations
173
201
- Use explicit `None` checks: `if x is not None:` not `if x:`
174
202
- Local imports should be moved to top of file
175
203
- Return defensive copies of mutable data to protect singletons
204
+
-**Async method naming**: Do NOT use `_async` suffix on async methods. The `_async` suffix is only appropriate when providing both sync and async versions of the same method. Since this SDK is async-only, use plain method names (e.g., `send_chat_history_messages` not `send_chat_history_messages_async`)
205
+
206
+
### Type Hints - NEVER Use `Any`
207
+
208
+
**CRITICAL: Never use `typing.Any` in this codebase.** Using `Any` defeats the purpose of type checking and can hide bugs. Instead:
209
+
210
+
1.**Use actual types from external SDKs** - When integrating with external libraries (OpenAI, LangChain, etc.), import and use their actual types:
3.**Use `object` for truly unknown types** that you only pass through:
226
+
```python
227
+
deflog_item(item: object) -> None: ...
228
+
```
229
+
230
+
4.**Use `Protocol` only as a last resort** - If external types cannot be found or imported, define a Protocol. However, **confirm with the developer first** before proceeding with this approach, as it may indicate a missing dependency or incorrect understanding of the external API.
231
+
232
+
**Why this matters:**
233
+
-`Any` disables all type checking for that variable
234
+
- Bugs that type checkers would catch go unnoticed
235
+
- Code readability suffers - developers don't know what types to expect
236
+
- Using actual SDK types provides better IDE support and ensures compatibility
237
+
- This applies to both production code AND test files
Copy file name to clipboardExpand all lines: docs/design.md
+43-1Lines changed: 43 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,9 +227,51 @@ Framework-specific adapters for MCP tool integration:
227
227
|---------|---------|------------|
228
228
|`extensions-agentframework`| Adapt MCP tools to Microsoft Agents SDK |[design.md](../libraries/microsoft-agents-a365-tooling-extensions-agentframework/docs/design.md)|
229
229
|`extensions-azureaifoundry`| Azure AI Foundry tool integration |[design.md](../libraries/microsoft-agents-a365-tooling-extensions-azureaifoundry/docs/design.md)|
230
-
|`extensions-openai`| OpenAI function calling integration |[design.md](../libraries/microsoft-agents-a365-tooling-extensions-openai/docs/design.md)|
230
+
|`extensions-openai`| OpenAI function calling integration and chat history |[design.md](../libraries/microsoft-agents-a365-tooling-extensions-openai/docs/design.md)|
The methods convert OpenAI message types to `ChatHistoryMessage` format and delegate to the core `McpToolServerConfigurationService.send_chat_history()` method.
0 commit comments