feat: name a session topic after its herdr agent, not its cwd basename - #56
Merged
Conversation
basename(cwd) is whatever the parent directory happens to be called, so every pane under one tree claims a topic with the same useless title. A herdr agent name is assigned deliberately and is one-to-one with the session, which is exactly what a per-session topic represents. pane list does not carry it; agent list does. Falls back to basename(cwd) outside herdr, or when herdr names no agent.
This was referenced Aug 15, 2026
TerrifiedBug
added a commit
that referenced
this pull request
Aug 15, 2026
#56 titled a topic after the pane's herdr agent name, falling back to `basename(cwd)`. Both halves fail together on a multi-project fleet: `agentNameForSession` reads herdr over a socket and swallows its own failure, so "no agent name" is a routine outcome, and `topics tidy on` closes the topic on exit — so the title is re-derived on every restart rather than settled once. On a host running two projects under `~/.omp/conductor`, one missed lookup titles that pane's topic "conductor" after the shared parent directory. Both projects then carry the same title, and a consumer that identifies a project's topic by name (omp-conductor's escalation routing) can no longer tell them apart — pages, digests and arm challenges land in the wrong topic or degrade to the flat chat. The herdr space label is equally one-to-one with the pane and is captured by a different call, so it holds the title up when the agent name does not. The rule moves into `topics.ts` as `sessionTopicTitle`, beside the rest of the module's pure policy, and blank is treated as absent throughout: Telegram rejects an empty topic name. Existing topics are unaffected — a title is set at creation and re-adoption reuses the stored name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A session's topic title comes from one line:
That is whatever the parent directory happens to be called, so it is ambiguous exactly when topics matter most — several panes under one tree all claim a topic with the same title. Concretely, a conductor fleet whose pane runs in
~/.omp/conductorgets a topic called "conductor", and its sibling project's pane, running in~/.omp/conductor/projects/<name>/worktrees, would get "worktrees". Neither names the thing the operator is looking at.The plugin already captures the herdr space, but never reads the identity that is actually per-session.
Fix
Prefer the herdr agent name for the topic title, falling back to
basename(cwd).An agent name is assigned deliberately (
herdr agent start <name>,agent rename) and is one-to-one with the session — which is precisely what a per-session topic represents. The workspace label is deliberately not used: it is one-to-many over panes, so it would be no more specific than the directory it replaced, and would regress users whose label is generic while their cwd basename is meaningful.pane listdoes not carry the agent name, soagentNameForSessionreadsagent listand matches on the exactagent_session.value— the same wayfindSessionSpacealready matches. One extra herdr call, once, at claim time.Captured independently of the space snapshot so a failed space lookup still yields a correctly named topic, and a herdr call that fails warns and falls back rather than blocking the claim.
Behaviour
basename(cwd)(unchanged)basename(cwd)(unchanged)Existing topics are untouched: nothing calls
editForumTopic, and a re-adopted topic keeps the name recorded inthreads.json.Tests
Mutation-verified.
agentNameForSessionreturns the bound name, isundefinedfor an absent / empty / missing name (so the caller keeps its own fallback rather than creating a blank title), and rejects a malformed herdr reply instead of guessing. Dropping the empty-name guard fails the suite.docs/guide.mdupdated: the per-session topics section documents the agent-name-first rule and why the fallback exists.