mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-08-25 14:02:22 +02:00
Revert "[eric] browser: prove a send by the posted content, not only by an emptied box"
This reverts commit 5035520629.
This commit is contained in:
@@ -148,26 +148,6 @@ async def complete_send(
|
||||
sent = True
|
||||
break
|
||||
p_why = f"payload-still-in-a-textbox (textbox rows={sum(1 for x in state3.splitlines() if '<textbox' in x)})"
|
||||
if not sent and p_why.startswith("payload-still"):
|
||||
# LinkedIn keeps the text in its composer AFTER a successful post: measured at 2.6s, then
|
||||
# again at 7.6s, on every round of a 3-round canary whose posts an independent feed read
|
||||
# found PRESENT. So a cleared composer is a fine signal on X and simply false here, and
|
||||
# waiting longer only buys a slower wrong answer.
|
||||
#
|
||||
# Ask the opposite question instead. A cleared box is ABSENCE evidence; the payload showing
|
||||
# up in the page as CONTENT is presence evidence, and presence is what "it posted" means.
|
||||
# One extra read, only on the path that was already about to report a failure.
|
||||
try:
|
||||
r_txt = await asyncio.wait_for(
|
||||
execute_tool("BrowserGetText", {}, browser_id, tab_id), timeout=6.0)
|
||||
p_page = str(r_txt.get("text") or "") if isinstance(r_txt, dict) else ""
|
||||
p_boxes = "\n".join(x for x in (await fresh_list()).splitlines() if "<textbox" in x)
|
||||
if payload and payload in p_page and payload not in p_boxes:
|
||||
sent = True
|
||||
logger.info("[browser-sendscript] receipt via rendered content: the payload is on the "
|
||||
"page outside any textbox, so it posted even though the composer kept it")
|
||||
except Exception:
|
||||
pass
|
||||
if not sent:
|
||||
logger.info(f"[browser-sendscript] receipt withheld after {sum(p_waits):.1f}s of polling: {p_why}")
|
||||
# A cleared composer is proof of delivery everywhere EXCEPT the ghost-drop hosts, which clear
|
||||
|
||||
@@ -146,12 +146,8 @@ def marker_in_page(cfg: Dict[str, str], marker: str, handle: str, site: str) ->
|
||||
# the post was really there (the cleanup that followed deleted it), the read just never
|
||||
# surfaced its text. Absence only counts as evidence once the read itself is known good, so
|
||||
# require proof we saw the destination at all before believing what we did not see on it.
|
||||
# Any evidence the audit run actually looked at a page. The first version of this listed two
|
||||
# exact "[browser-action] X" strings that the log does not emit for reads, so `saw_page` was
|
||||
# always False and every audit came back "unprovable" no matter what it saw. An instrument that
|
||||
# can only ever return "don't know" is worse than none, because it looks like data.
|
||||
saw_page = any(k in log for k in ("BrowserGetText", "BrowserListInteractives",
|
||||
"dryrun-report", "browser-action", "browser-time"))
|
||||
saw_page = any(k in log for k in ("[browser-action] BrowserGetText",
|
||||
"[browser-action] BrowserListInteractives"))
|
||||
hit = any(marker in line for line in log.splitlines()
|
||||
if "browser-action" not in line and "prompt" not in line.lower()
|
||||
and "canary-audit" not in line)
|
||||
|
||||
Reference in New Issue
Block a user