Repository navigation
Commit f963ea5
test(obs): exercise the worker's obs path, don't just read its source
The two existing worker tests assert on `inspect.getsource(AgentexWorker.run)` — they
pin that init_sgp_obs() and both drains are CALLED, which is worth pinning, but they
cannot catch a call that is written correctly and then raises. So the claim "a Temporal
worker starts fine without the broker token" rested on source inspection, not on the
path having been run.
That matters because a build with no broker token produces an image with no sgp-obs in
it, and for a Temporal agent the model calls happen in the worker process — the one
this PR newly touches.
Now exercised for real with the import blocked: the module imports, an AgentexWorker
constructs, init_sgp_obs() returns not_installed, and both drains complete with nothing
ever wired. Verified by hand first, at which point it passed — so this is a guard
rather than a fix.
Keeps the source-inspection tests alongside it: one proves the wiring exists, the other
proves it is harmless. Neither alone is enough.
137 tests, ruff clean, pyright 0 errors, all with sgp-obs absent.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 8be24ed commit f963ea5
1 file changed
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
19 | 35 | | |
20 | 36 | | |
21 | 37 | | |
| |||
247 | 263 | | |
248 | 264 | | |
249 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
0 commit comments