Skip to content

ci-fix: publish-site failing — a stalled hosted turn never reaches a terminal receipt #705

Closed

Description

@leaf-agent

publish-site on main at 39e2664a — run 34820889246, "Render media viewer through Lit (#702)". The deploy itself succeeded and leaf.page is live on release 1718cd21; the release pass verified it in Chrome at 08:10:07. The job then failed in Verify the exact public release in Chrome on the hosted-agent pass, ten and a half minutes later:

RuntimeError: https://leaf.page/examples/triage-board/ agent published but did not reply; the page read working

What the turn did

Hosted agent profile (observed from the first request):
  session reference 672857141335
  event 8ae0f5440843b3ef63150d61b21c2bab
  request acknowledged 110 ms
  activity closed at 235 ms
  activity working: Starting at 2.4 s
  published at 8.7 s

The agent ran and did the work. Publishing revision 2 carrying Deployment 1718cd21 verified at 8.7 s takes $LEAF commands executing inside the container, and 8.7 s is the healthy range — the last three green deploys published at 9.3 s, 17.6 s and 11.6 s. What never arrived was anything on the App Server notification stream after turn/started. working: Starting is the literal detail _follow_turn sets before it reads its first notification; the three most recent green profiles (34818439820, 34814515951, 34793155710) all sample handling and then working: Running … with real command text, and none of them ever sampled Starting. Here it was still the reading 590 s later, while the gate polled /api/state every two seconds and the container answered every one of those reads. Container alive, agent's writes landed, follower projecting nothing.

The durable gap

_follow_turn converts a stream that fails into a terminal outcome: its except (OSError, RuntimeError, ValueError, WebSocketException) synthesizes a failed turn, clears the stream activity, commits the reply stream and closes the claim. Two exits skip it:

  • A stream that goes silent instead of closing. socket.recv(timeout=1) raises TimeoutError, which line 574 turns into continue. Nothing bounds how long that repeats, so a stream that stops delivering without erroring spins for the life of the container. Reconnection is reachable only from a socket error, so the recovery _resume_turn_stream already implements is never tried.
  • Any exception outside that tuple — either assert delivery_id is not None, a KeyError, an AttributeError — propagates out through _run_follow_turn, whose finally only discards the thread from following_threads.

Both leave precisely the state the gate read for its full TURN_LIMIT: claim open, stream activity frozen at Starting, no reply and no failure receipt. _run_follow_turn is the boundary that owns a followed turn's outcome, and it guarantees none.

The consequence is wider than the gate. Any leaf.page reader whose turn lands here sees a page that reads working indefinitely, with neither an answer nor a failure, against a page contract that says exactly one terminal receipt names each accepted request.

Why no fix is proposed

The two mechanisms produce identical page state, and the reading that separates them lives in Cloudflare's Workers logs: whether the container printed a traceback on stderr, and whether turn_stream_completed was ever logged for session reference 672857141335. This account has no Cloudflare credentials, so it cannot fetch them.

The remedies differ. The silent-stream case wants a liveness bound that routes silence into the resume path that already exists — _resume_turn_stream recovers the authoritative turn and the error path reconciles items, reply text and terminal status. The escaping-exception case wants _run_follow_turn to close the turn with a failure receipt whenever _follow_turn returns no terminal reading. The first needs a bound chosen against hosted Codex's real notification cadence, and both change the live deployment's turn lifecycle for every reader. Choosing them from a CI run against a fault this session cannot reproduce is the wrong place to decide: the sandbox cannot launch Chrome (FATAL:process_singleton_posix.cc: socket() failed: Operation not permitted), so there is no way to drive a turn here and confirm either repair works.

Not this commit, and not the first occurrence

39e2664a changes only skills/leaf/assets/runtime/media.js and tests/test_render_conversations.py. Neither can reach the Worker, the container image or reply admission, and https://leaf.page/api/state currently reports producer.commit 39e2664aa474, so the deploy this run performed is live and serving.

#694 recorded the same shape eight hours earlier and closed it as transient on the grounds that it was a first occurrence, noting that a recurrence is what would make the standing waitUntil recovery TODO urgent. This is that recurrence, and it carries evidence #694 did not have. There the turn produced nothing at all, which is consistent with the Worker's dispatch being cut off before the container ran. Here the container demonstrably ran the agent all the way to a publication, which places this stall after dispatch, inside the container's own turn following — a different repair from the one that TODO names.

Activity

  1. added
    tend-outage
    on Sep 14, 2026
  2. leaf-agent commented on Sep 15, 2026

    @leaf-agent
    CollaboratorAuthor

    Run 34793155710

    No failure details could be extracted.

    Run 34814515951

    No failure details could be extracted.

    Run 34818439820

    No failure details could be extracted.

    Run 34820889246

    log tail

      session reference 672857141335
      event 8ae0f5440843b3ef63150d61b21c2bab
      request acknowledged 110 ms
      activity closed at 235 ms
      activity working: Starting at 2.4 s
      published at 8.7 s
        main()
      File "/home/runner/work/leaf/leaf/.venv/lib/python3.12/site-packages/click/core.py", line 1631, in __call__
        return self.main(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/leaf/leaf/.venv/lib/python3.12/site-packages/click/core.py", line 1552, in main
        rv = self.invoke(ctx)
             ^^^^^^^^^^^^^^^^
      File "/home/runner/work/leaf/leaf/.venv/lib/python3.12/site-packages/click/core.py", line 1415, in invoke
        return ctx.invoke(self.callback, **ctx.params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/leaf/leaf/.venv/lib/python3.12/site-packages/click/core.py", line 910, in invoke
        return callback(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/runner/work/leaf/leaf/scripts/verify_site.py", line 1080, in main
        run_verification(origin, release or built, agent=agent)
      File "/home/runner/work/leaf/leaf/scripts/verify_site.py", line 1091, in run_verification
        verify_agent_turn(
      File "/home/runner/work/leaf/leaf/scripts/verify_site.py", line 833, in verify_agent_turn
        check_turn_answered(url, heading, turn, asks, revision)
      File "/home/runner/work/leaf/leaf/scripts/verify_site.py", line 536, in check_turn_answered
        check(
      File "/home/runner/work/leaf/leaf/scripts/verify_site.py", line 75, in check
        raise RuntimeError(message)
    RuntimeError: https://leaf.page/examples/triage-board/ agent published but did not reply; the page read working
    ##[error]Process completed with exit code 1.
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tend-outage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions