Commit b80c6eb
committed
feat(sprites): lazy-warm ephemeral sessions too
Extends the lazy wait-for-running pattern from named-attach to the
created_by_us=True path. Sprites can transition between cold/warm/
running freely with auto-wake-on-traffic, and ``create_sprite`` already
raises eagerly on platform rejection — so the eager poll on the
ephemeral path was paying ~1.5s per session just to confirm something
the platform implicitly handles.
Now both paths skip the poll in ``_ensure_sprite``; ``_ensure_warm``
runs once on first I/O. ``_resolve_exposed_port`` calls ``_ensure_warm``
explicitly because it needs ``Sprite.url`` populated (which happens
during the post-poll refresh).
TUI startup goes from ~7.6s to ~6.0s. The ~1.5s saved is exactly the
poll we now skip; the wake-up cost shifts to the agent's first exec,
where it overlaps with model thinking time and is invisible to the user.
Updates ``test_create_ephemeral_sprite`` to assert no eager get_sprite
poll fires, mirroring the named-attach assertion.1 parent 41313e5 commit b80c6eb
2 files changed
Lines changed: 31 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
330 | 333 | | |
331 | 334 | | |
332 | 335 | | |
| |||
344 | 347 | | |
345 | 348 | | |
346 | 349 | | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
366 | 353 | | |
367 | 354 | | |
368 | 355 | | |
369 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
370 | 365 | | |
371 | 366 | | |
372 | 367 | | |
| |||
952 | 947 | | |
953 | 948 | | |
954 | 949 | | |
955 | | - | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
956 | 963 | | |
957 | 964 | | |
958 | 965 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | | - | |
382 | | - | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
383 | 385 | | |
384 | 386 | | |
385 | 387 | | |
| |||
0 commit comments