Repository navigation
Commit c08e70b
refactor(obs): drop speculative review additions, keep the measured fixes
The review rounds added ~920 lines on top of a PR whose intent is "wire
sgp-obs". Much of that defends cases that cannot occur or that I could not
verify, which is cost without benefit: more surface to review, more to keep
true later. Removing it takes the review-round churn to ~620 lines.
Removed:
- **The SGP_OBS_GENAI_ENABLED gate.** Added last commit against a variable name
I could not verify — it appears nowhere in this repo, and sgp-obs is not
installable here to check. A gate on a name that may not exist is either a
no-op or wrong, and no one has asked for the switch in anger yet.
- **The second-app ASGI warning.** A diagnostic for a process that builds two
ACP servers, or a worker and an ACP server together. The worker runs in its
own process by design, so this warns about nothing that happens.
- **Standing down when litellm's routing table is unreadable.** litellm is a
hard dependency of this package; `litellm.constants` cannot go missing at
runtime. The tri-state `bool | None` it required leaked through `_split_model`
into `inference_call` to buy nothing. Back to a plain bool.
- **The drift test that parsed litellm's main.py.** A test reading another
package's source to re-derive our constant is more likely to break on an
unrelated refactor than to catch a real change. Replaced with direct
assertions on the eight pre-empted providers, which is the fact that matters.
Kept, because each is a measured defect rather than a hypothetical:
- the async span queue drain in the worker — dropped business spans
- litellm provider routing — double-counted azure/groq/deepseek, lost bare
anthropic models
- UV_DEFAULT_INDEX in the scaffold templates — public PyPI fallback; this one
also deletes more than it adds
- the bounded sgp-obs flush — 20.04s to exit vs 0.31s, measured
- the resolve-once import cache — 84us to 12us per call, measured
Also trimmed the shutdown docstring's atexit note from thirteen lines to five;
the limitation is worth recording, at that length.
Tests: 81 across the two obs suites (was 97, the difference being coverage of
the removed code), 1714 repo-wide. Lint and pyright clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent ba0c406 commit c08e70b
4 files changed
Lines changed: 27 additions & 321 deletions
File tree
- src/agentex/lib/core
- adapters/llm
- tests
- observability
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 85 | + | |
| 86 | + | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
| 90 | + | |
110 | 91 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
121 | 96 | | |
122 | 97 | | |
123 | 98 | | |
| |||
148 | 123 | | |
149 | 124 | | |
150 | 125 | | |
151 | | - | |
| 126 | + | |
152 | 127 | | |
153 | 128 | | |
154 | 129 | | |
| |||
176 | 151 | | |
177 | 152 | | |
178 | 153 | | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | 154 | | |
183 | 155 | | |
184 | 156 | | |
| |||
272 | 244 | | |
273 | 245 | | |
274 | 246 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | 247 | | |
283 | 248 | | |
284 | 249 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
131 | 130 | | |
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
135 | 134 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
147 | 140 | | |
148 | 141 | | |
149 | 142 | | |
| |||
157 | 150 | | |
158 | 151 | | |
159 | 152 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | 153 | | |
273 | 154 | | |
274 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | 64 | | |
72 | 65 | | |
73 | 66 | | |
| |||
88 | 81 | | |
89 | 82 | | |
90 | 83 | | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 84 | | |
106 | 85 | | |
107 | 86 | | |
| |||
113 | 92 | | |
114 | 93 | | |
115 | 94 | | |
116 | | - | |
| 95 | + | |
117 | 96 | | |
118 | 97 | | |
119 | 98 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | 99 | | |
135 | 100 | | |
136 | 101 | | |
| |||
190 | 155 | | |
191 | 156 | | |
192 | 157 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
| 158 | + | |
202 | 159 | | |
203 | 160 | | |
204 | | - | |
205 | 161 | | |
206 | 162 | | |
207 | 163 | | |
| |||
387 | 343 | | |
388 | 344 | | |
389 | 345 | | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
403 | 351 | | |
404 | 352 | | |
405 | 353 | | |
| |||
447 | 395 | | |
448 | 396 | | |
449 | 397 | | |
450 | | - | |
| 398 | + | |
451 | 399 | | |
452 | | - | |
453 | 400 | | |
454 | 401 | | |
455 | 402 | | |
| |||
0 commit comments