Commit cea253b
[agentserver] core: pre-commit cleanup — pylint/mypy/pyright clean
This commit brings core to pristine pre-commit state for the spec-016
landing (no new findings introduced by this PR):
Pylint:
- All findings in new files (`_client.py`, `_task_api_logging_policy.py`)
and modified files (`_manager.py`, `_decorator.py`, `_context.py`,
`_metadata.py`, `_local_provider.py`, `_resume_route.py`, `_base.py`,
`durable/__init__.py`) are now resolved. Net delta vs origin/main: 0.
Rating now 10.00/10.
Fixes include: filled in docstring :param/:type/:return/:rtype where
missing; added `# pylint: disable=broad-exception-caught` on
defensive parse paths; added `# pylint: disable=protected-access`
on cross-module internal-state reads; renamed redefined exception
variables (`exc` → `transport_exc`) in `_handle_failure`;
collapsed dead unused-variable assignments in `_execute_task_loop`
and `_try_drain_steering`; added too-many-* disables to functions
that intentionally exceed limits (`AgentServerHost.__init__`,
`get_active_run`, `_execute_task_loop`, `_try_drain_steering`,
`LocalFileTaskProvider.update`, `_handle_resume_request`,
`_lifecycle_start_inner`, `TaskManager`).
- `EtagConflict` removed from the public `__init__.py` re-exports
(it was already an internal-only exception per the spec 015 closeout
note in `test_contract_completeness.py`). `test_steering.py`
updated to import it directly from `_exceptions`.
- `_base.py`: removed the inner-scope reimports of `asyncio` and
`signal` in `_serve_with_shutdown_trigger` (use the top-level
imports that were already present).
Mypy:
- Sample files (`durable_streaming.py`, `durable_source.py`,
`durable_retry.py`) were calling a stale API (`host._task_manager`,
`Task.run()` without required `task_id=` keyword) — fixed to use
`get_task_manager()` and pass `task_id=`. The `durable_source.py`
sample also referenced a non-existent `source=` decorator parameter
— rewritten to use `tags=` (the existing provenance facility).
Also dropped the corresponding misleading "Source tracking" bullet
from the `durable/__init__.py` module docstring.
- Net new mypy errors: 0 (only the pre-existing
`selfhosted_invocation.py` attr-defined error remains, identical
to origin/main baseline).
Pyright:
- `_decorator.py` `input_type` assignment: added `type: ignore` on
the `Any | type[Any]` narrowing.
- `_local_provider.py` status assignment from
`TaskCreateRequest.status`: added `type: ignore`.
- `_run.py` `self._status`: explicit `TaskStatus` annotation.
- Pyright check passes overall.
Sphinx: passes.
Tests: core 439 passed (+ 6 skipped); invocations 244 passed
(+ 2 skipped) — no regressions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 7dbc8f0 commit cea253b
15 files changed
Lines changed: 239 additions & 116 deletions
File tree
- sdk/agentserver/azure-ai-agentserver-core
- azure/ai/agentserver/core
- durable
- samples
- durable_retry
- durable_source
- durable_streaming
- tests/durable
Lines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
184 | 187 | | |
185 | 188 | | |
186 | 189 | | |
187 | | - | |
| 190 | + | |
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
| |||
516 | 519 | | |
517 | 520 | | |
518 | 521 | | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | | - | |
523 | | - | |
| 522 | + | |
| 523 | + | |
524 | 524 | | |
525 | 525 | | |
526 | 526 | | |
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
| 536 | + | |
537 | 537 | | |
538 | | - | |
| 538 | + | |
539 | 539 | | |
540 | 540 | | |
541 | | - | |
| 541 | + | |
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
| |||
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
46 | | - | |
47 | 44 | | |
48 | 45 | | |
49 | 46 | | |
| |||
Lines changed: 76 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
| |||
145 | 152 | | |
146 | 153 | | |
147 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
148 | 162 | | |
149 | 163 | | |
150 | 164 | | |
151 | 165 | | |
152 | 166 | | |
153 | | - | |
| 167 | + | |
154 | 168 | | |
155 | 169 | | |
156 | 170 | | |
| |||
164 | 178 | | |
165 | 179 | | |
166 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
167 | 188 | | |
168 | 189 | | |
169 | 190 | | |
170 | 191 | | |
171 | 192 | | |
172 | | - | |
| 193 | + | |
173 | 194 | | |
174 | 195 | | |
175 | 196 | | |
| |||
195 | 216 | | |
196 | 217 | | |
197 | 218 | | |
198 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
199 | 227 | | |
200 | 228 | | |
201 | 229 | | |
| |||
251 | 279 | | |
252 | 280 | | |
253 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
254 | 289 | | |
255 | 290 | | |
256 | 291 | | |
257 | 292 | | |
258 | 293 | | |
259 | | - | |
| 294 | + | |
260 | 295 | | |
261 | 296 | | |
262 | 297 | | |
| |||
288 | 323 | | |
289 | 324 | | |
290 | 325 | | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
291 | 331 | | |
292 | 332 | | |
293 | 333 | | |
| |||
337 | 377 | | |
338 | 378 | | |
339 | 379 | | |
340 | | - | |
| 380 | + | |
341 | 381 | | |
342 | 382 | | |
343 | 383 | | |
| |||
349 | 389 | | |
350 | 390 | | |
351 | 391 | | |
352 | | - | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
353 | 397 | | |
354 | 398 | | |
355 | 399 | | |
356 | 400 | | |
357 | 401 | | |
358 | 402 | | |
359 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
360 | 409 | | |
361 | | - | |
| 410 | + | |
362 | 411 | | |
363 | 412 | | |
364 | 413 | | |
| |||
523 | 572 | | |
524 | 573 | | |
525 | 574 | | |
526 | | - | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
527 | 594 | | |
528 | 595 | | |
529 | 596 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
Lines changed: 31 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
821 | 831 | | |
822 | 832 | | |
823 | 833 | | |
| |||
857 | 867 | | |
858 | 868 | | |
859 | 869 | | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | 870 | | |
864 | 871 | | |
865 | 872 | | |
| |||
879 | 886 | | |
880 | 887 | | |
881 | 888 | | |
882 | | - | |
| 889 | + | |
883 | 890 | | |
884 | 891 | | |
885 | 892 | | |
| |||
891 | 898 | | |
892 | 899 | | |
893 | 900 | | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
894 | 914 | | |
895 | 915 | | |
896 | 916 | | |
| |||
1081 | 1101 | | |
1082 | 1102 | | |
1083 | 1103 | | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
| 1104 | + | |
| 1105 | + | |
1087 | 1106 | | |
1088 | 1107 | | |
1089 | 1108 | | |
| |||
1093 | 1112 | | |
1094 | 1113 | | |
1095 | 1114 | | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
| 1115 | + | |
| 1116 | + | |
1099 | 1117 | | |
1100 | 1118 | | |
1101 | 1119 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
0 commit comments