Repository navigation
Commit 1cf396d
docs(web): document the browser-liveness lock-scope invariant (#5)
_lock only guards _ensure_browser() inside _page(); it is released before
the page reference is returned, so a caller's subsequent use of the page
happens outside the lock. This is a latent race ONLY if the documented
single-run-per-process invariant (MCP serializes tool calls) is ever
violated — not currently reachable.
Extending the lock to cover every caller's page-use span would mean
turning every `await browser._page()` call site across navigation.py /
actions.py / observation.py / resolution.py into a context-manager
pattern, for a scenario that cannot happen today. Left the mechanism
unchanged and documented the invariant clearly at both the lock
definition and _page() itself, with a pointer to the right fix
(_page() returning a lock-holding context manager) if concurrent
dispatch is ever introduced.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 767ab80 commit 1cf396d
1 file changed
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
204 | 224 | | |
205 | 225 | | |
206 | 226 | | |
| |||
527 | 547 | | |
528 | 548 | | |
529 | 549 | | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
530 | 556 | | |
531 | 557 | | |
532 | 558 | | |
0 commit comments