Repository navigation
Title threads that an App Server turn answers, and show the placeholder only while one is coming - #1401
Conversation
On leaf.page a new thread read "Generating title" for good. A thread gets its title from a `thread_title` event, and the delivery told the agent to add `--title` to the reply that answers it. On Codex App Server, though, the turn's own messages are the reply, and `leaf thread reply` refuses that event, so the hosted agent had no command that could name the thread. A local run of the hosted-agent benchmark on main replied at 19.5 s and never titled the thread. The carrier that starts an App Server turn now names each untitled thread that the delivery answers (`codex_titles`). Each title comes from one ephemeral App Server thread that sees only the opening message, the passage it is anchored on, and a one-line instruction. Codex's tools, skills, plugins, memories and AGENTS.md are turned off for it. On the website's Codex (0.153.4) and model (`gpt-5.6-luna` at low effort), a request reads about 1,900 input tokens instead of 13,000–15,000, and it returns a title in about 3 s at the median. With a shell, the model sometimes acted on the message instead of naming it. The title request runs beside the turn without delaying it. It is written under the page's claim, and only while the thread is still untitled. Both App Server carriers title this way. The website uses its hosted model, and `leaf codex start` uses the task's configured model. The "no title yet" handling clause now applies only to an event that owes a plain `reply`. Before, it applied to every event in an untitled thread, including events answered by an App Server turn, which could not follow it. `verify_site.py` now records a `titled` milestone. `local` gives the adapter its own temporary directory, because an App Server left behind by an earlier run held the fixed socket path and made the next server exit on start. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
turn_stream_completed now carries how many model requests the turn made and the input, cached input and output tokens they summed to, so a benchmark or an Observability query can read a turn's context cost beside its duration. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The hosted task and each title thread now start with LEAF_THREAD_CONFIG, which turns off what Codex loads by default and no Leaf-started thread uses: the skills list, plugin and app suggestions, other agents, memories, browser and computer use, image generation and web search. A title thread also drops every tool and the working directory's AGENTS.md. Web search was also the one route to the network the hosted task is told to stay off. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The thread row read "Generating title" for as long as a thread had no title, whether or not anything was going to name it. An agent that answered without `--title`, a title request that failed, or a thread the user closed all left it there for good. The placeholder now stands only while the thread waits on the agent, which is when a title is on its way: on an App Server turn it comes from the carrier beside the turn, and on other carriers from the reply. Once the thread no longer waits on the agent, the row reads the thread's opening words. The carrier's title request now reads the thread from the page log and uses its first spoken message and the passage it is on. Before, it rebuilt the opening from the delivery's digest, which leaves out the batch's own messages. When a user commented and then added "also, thanks" before the turn started, the title was drawn from the afterthought. A thread with no words to title from is recorded as skipped. A refused title is recorded without its words, because they come from the user's. Both carriers start titling after the turn has started, and the generated event is built by the same `title_event` constructor as `leaf thread --title`. Behavior moved: `test_packages_and_panel_share_threads_through_gestures_and_ authored_content` asserted the placeholder on a thread the agent had already answered; it now reads the opening words. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…w records A title thread on `leaf codex start` runs in the user's own App Server, and a probe with an MCP server configured showed the thread starting it. Replacing the `mcp_servers` table in the thread's config left it running, and turning each server off by name stopped it, so the title request reads the configured servers through `config/read` and disables each one. Codex 0.153.4, the website's version, has `config/read` too. worker/README.md, which owns the hosted-turn record contract, now names the `thread_title_*` records and the token fields on `turn_stream_completed`. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # dev/leaf_dev/verify_site.py
A thread whose turn ended, stalled, or was never picked up read "Generating title" beside "Turn ended" or "Waiting for pickup" for good, because attention `waiting` covers those conditions too. The placeholder now also requires the served reason `workflow`, so those threads read their opening words. The feature gallery's pending-title demo was a thread the agent opened, which nothing is naming, so it now reads the question. Its text says so and describes the placeholder a thread the user opens shows while the agent works; the two gallery tests assert the question, and the corpus is regenerated. A new render test covers a comment nobody picked up. Title requests now read the MCP server list and start their thread in the page's directory, so a project's own servers are turned off along with the user's. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
left a comment
There was a problem hiding this comment.
The hosted title request sets sandbox: "read-only" in codex_titles.generate_title, while the hosted task deliberately uses danger-full-access because the Cloudflare container cannot create Codex's nested bubblewrap namespaces (see WebsiteCodexHost._start_thread and worker/README.md, “The container”). That leaves the new hosted title path dependent on whether App Server initializes the read-only sandbox for a tool-free turn; the mock App Server test does not exercise this. Pass the carrier's sandbox policy into the title request and use the hosted policy in the container, with tools still disabled, then verify that the Wrangler journey records a thread_title event. Until that path works, the PR's central leaf.page fix remains unverified.
The website's container cannot create Codex's bubblewrap namespaces, so the hosted task runs with danger-full-access. A title request asks for read-only. Run in the website's image (Codex 0.153.4), with `codex sandbox linux` failing there as the control, two read-only title requests returned titles in ~6 s: a sandbox confines only the tools a turn runs, and a title turn has none. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Measured rather than changed. I ran The Wrangler journey (
|
# Conflicts: # skills/leaf/assets/runtime/thread/thread-card.js # skills/leaf/scripts/AGENTS.md
On leaf.page a new thread's row read "Generating title" forever. A title is a
thread_titleevent, which the agent writes by adding--titletoleaf thread reply. But a turn Leaf starts over Codex App Server (the website, andleaf codex start) writes its reply from the turn's own messages, andleaf thread replyrefuses that event. The delivery still asked for--title, so nothing could ever name the thread. The browser, meanwhile, showed the placeholder for any untitled thread whether or not anything would name it.What changes
skills/leaf/scripts/leaf/codex_titles.py(new): when an App Server carrier starts a turn, it also names each untitled thread that turn answers. That is one ephemeral App Server thread per title whose whole context is the thread's first message and its anchored passage, with no tools and every configured MCP server disabled by name. It runs beside the turn and never delays it. The title is written as the page's claimant, only while the thread is still untitled. Wired intoworker/leaf_website(ongpt-5.6-luna) andcodex_adapter.start_delivery_turn(on the task's model).registry.json: the "add a title" handling clause now applies only toanswer.kind == "reply", so a turn-carried agent is no longer told to do something it can't.thread-card.js: the placeholder shows only while the agent's workflow on the thread is under way (attention.kind == "waiting",reason == "workflow"). A thread whose turn ended, stalled, was never picked up, or was answered without a title reads its opening words.LEAF_THREAD_CONFIGincodex.py: threads Leaf starts no longer load Codex defaults they never use (skills, plugins, multi-agent, memories, browser/image tools, web search).turn_stream_completedrecord carries model-request and token counts; newthread_title_generated/skipped/failedrecords (documented inworker/README.md);leaf-dev verify-sitereportstitledMs.Measured (
leaf-dev verify-site local, alternating arms)A title request costs ~1.9k input tokens and ~3 s at the median; about 1 in 10 took 18–28 s.
Weak points
TODO.md).verify-site wrangler.