Skip to content

Let agents name conversations with short stable titles - #939

Merged
max-sixty merged 6 commits into
mainfrom
codex/conversation-titles
Sep 22, 2026
Merged

max-sixty merged 6 commits into
mainfrom
codex/conversation-titles

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Thread headers previously used the opening message, leaving the panel full of long, truncated questions. Add leaf conversation title PAGE CONVERSATION_ID --text "Short title" so agents can name and occasionally rename a conversation without changing its messages or reply obligations. Titles appear in the panel, search, and agent context, including the first delivery into a new conversation.

Document short, stable naming for installed and hosted agents, expose the title in the package contract, and seed concise gallery titles. Regenerate the runtime and corpus.

Validation: conversation naming, live renaming, search, draft preservation, and reload tested in Chrome; full conversation-browser suite; delivery/session and hosted-agent tests; lint; runtime and browser-model tests.

This was written by Codex on behalf of max-sixty

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hosted-agent instruction added to worker/server.py keys on a field the delivery does not carry at the moment it is meant to fire. batch_threads builds each conversation digest with thread_digest(threads[t], delivered, pin) and keeps it only if digest["messages"] or digest["actions"]; the batch's own messages are elided from the digest, so a batch that is the whole conversation — a reader opening a new thread — yields an empty conversations list. This PR's own regenerated snapshot shows it: test_hosted_agent_receives_the_response_instructions_and_delivery[reply] carries "conversations":[] for the delivery of the comment that opens reader-event. "A conversation whose title is null" is therefore unobservable in exactly the first-handling case, so on leaf.page new threads stay unnamed; the instruction only fires on later deliveries into a thread, which is where a title usually already exists.

Two ways out, and the second is the one the code points at. Rewording the instruction to key on the act rather than on a null field fixes the symptom — inline suggestion below. Underneath it, batch_threads drops the entire thread record when the batch is the conversation, under a rule whose stated reason ("A root comment states its own anchor and needs no history") was written when anchor and resolution were the only thread-level facts. A title is a thread-level fact the agent is now told to act on, so the digest that omits it and the guidance that reads it cannot both be right. Carrying the digest for a thread the batch opens would keep the projection and the instruction agreeing, with no second wording to keep in step.

Separately, readThreads()'s public record gained title, but skills/leaf/references/packages.md still enumerates a Thread as "a stable key, root, ordered msgs, anchor, detached_from, resolved, settling, awaits_agent, awaits_reader, seat, and summaries", and describes threadSummary(thread) as deriving "its plain-text topic" without saying that topic now prefers the title. A package author reading that list will not know the field is there. Those lines are outside this diff — say the word and I will push the edit.

What I checked

The event kind itself holds together: the registry record matches summary/edit in required fields, admission rejects a blank, over-long, multi-line, or unknown-conversation title, build_threads applies last-title-wins without touching msgs or resolved, and the title reaches agent context (agent_state, thread_digest), browser state (the **thread spread in browser_conversation), the panel header, and thread search. The committed browser-runtime.js hashes to the manifest's new sha256 and carries title:i.title??null, so the bundle is a real rebuild.

Ran locally: test_interact_product.py -k "title or names_and_renames or edits_its_own_messages", test_render_conversations.py -k agent_titles_update, and test_interact_layer.py test_interact_anchors.py test_interact_document.py test_interact_server.py test_website_server.py. Everything touching this change passed. Two failures in that last selection are sandbox-owned and unrelated — test_staged_writes_honor_umask_without_copying_a_replaced_symlink_mode (umask differs here) and test_the_adapter_takes_its_app_server_with_it_when_it_is_told_to_stop (AF_UNIX unsupported in this container); both are green in the PR's own test job.

Comment thread worker/server.py Resolved
Keep title and other thread facts even when all speech is in the delivered batch. Update tests that previously expected those conversations to be omitted.
@max-sixty
max-sixty merged commit 26aa5e2 into main Sep 22, 2026
5 checks passed
@max-sixty
max-sixty deleted the codex/conversation-titles branch September 22, 2026 19:50
max-sixty added a commit that referenced this pull request Sep 23, 2026
Agents answering reader threads never ran `leaf conversation title`, so
the Threads panel labelled each thread with its opening words. The
naming rule reached installed agents only through
`references/conversation-threads.md`, which a session answering
deliveries doesn't reread, while the delivery's own `handling` clauses —
what the agent follows per event — said nothing about naming, even
beside `"title": null`. Since #939, only the session that built titles
ever ran the command.

Comment and reply events now carry a handling clause: when the event's
conversation has a null `title` in the batch, name it. The hosted
agent's developer instructions in `worker/server.py` shrink to the case
handling cannot reach: naming a conversation the agent opens itself.

Tests: four delivery snapshots gain the clause.
`test_codex_delivery_carries_only_the_selected_events_handling` asserted
a count of two distinct clauses; it now asserts the batch carries
exactly the selected events' clauses, which is what the count was
standing in for.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants