Skip to content

fix: fall back to the herdr space when naming a session topic - #59

Merged
TerrifiedBug merged 1 commit into
masterfrom
fix/topic-title-space-fallback
Aug 15, 2026
Merged

fix: fall back to the herdr space when naming a session topic#59
TerrifiedBug merged 1 commit into
masterfrom
fix/topic-title-space-fallback

Conversation

@TerrifiedBug

Copy link
Copy Markdown
Owner

What broke

On a two-project fleet (omp-conductor on nanoclaw), both Telegram topics ended up titled conductor, even though herdr's spaces are veltrosecurity and conductor.

Live threads.json at the time:

name workspaceLabel pane cwd
conductor conductor …/projects/conductor/worktrees
conductor veltrosecurity /root/.omp/conductor

Why

#56 set the title to ownAgentName ?? basename(cwd). Both halves fail together:

  • agentNameForSession reads herdr over a socket and swallows its own failure, so undefined is a routine outcome, not a broken host.
  • topics tidy on closes the topic on exit, so a restart cannot adopt and the title is re-derived every time rather than settled once.

Panes under a shared parent directory then all fall back to the same basename. One missed lookup is enough to retitle a live project's topic.

The knock-on: omp-conductor identified a project's topic by claim title, so once both said conductor it could not tell them apart — arm challenges, pages and digests went to the wrong topic or degraded to the flat chat. (Fixed on that side too, by matching workspaceLabel first — but the title should be right at the source.)

Change

workspaceLabel is already captured, by a different call than the agent name, and is equally one-to-one with the pane. New precedence:

herdr agent name  →  herdr space label  →  basename(cwd)

Extracted as sessionTopicTitle in topics.ts, beside the module's other pure policy (decideRoute, findAdoptableThread) and exported so the rule is unit-testable — the same shape as canAutoResumeTopic. Blank is treated as absent: Telegram rejects an empty topic name, and a space with no custom name must not consume the fallback.

Scope

Titles are set at creation; re-adoption reuses the stored name. So this affects new topics only — existing ones are untouched, exactly as documented.

Tests

5 new cases in topics.test.ts: agent name wins; space label when the lookup is empty; basename outside herdr; blank/whitespace treated as absent; and the actual regression — two panes under one tree getting distinct titles, with the pre-fix collapse pinned as the contrast.

bun run check (typecheck + test): 283 pass / 0 fail.

Docs: docs/guide.md updated to the three-step rule and why the middle step exists.

#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.
@TerrifiedBug
TerrifiedBug merged commit a35262c into master Aug 15, 2026
1 check passed
@TerrifiedBug
TerrifiedBug deleted the fix/topic-title-space-fallback branch August 15, 2026 20:30
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.

1 participant