Skip to content

fix: resolve_display_name fails on multi-hyphen tags#8

Closed
bloodcarter wants to merge 5 commits intoaannoo:mainfrom
bloodcarter:dev
Closed

fix: resolve_display_name fails on multi-hyphen tags#8
bloodcarter wants to merge 5 commits intoaannoo:mainfrom
bloodcarter:dev

Conversation

@bloodcarter
Copy link
Copy Markdown
Contributor

Bug: resolve_display_name breaks on multi-hyphen tags

Expected behavior

hcom term vc-p0-p1-parallel-vani should resolve display name vc-p0-p1-parallel-vani to base instance vani (with tag vc-p0-p1-parallel), then query its screen.

All commands that use resolve_display_name or resolve_display_name_or_stopped (e.g., hcom term, hcom resume, hcom send, hcom transcript) should correctly resolve display names where the tag contains hyphens.

Actual behavior

hcom term vc-p0-p1-parallel-vani returns:

No inject port for 'vc-p0-p1-parallel-vani'. Instance not running or not PTY-managed.

The instance IS running, but resolve_display_name fails to resolve the name.

Root cause

resolve_display_name (and resolve_display_name_or_stopped) used split_once('-') to split the display name into (tag, base_name). This only splits on the first hyphen:

Input:        vc-p0-p1-parallel-vani
split_once:   tag="vc"  name="p0-p1-parallel-vani"   ← WRONG, no such instance
Correct:      tag="vc-p0-p1-parallel"  name="vani"    ← instance "vani" with tag "vc-p0-p1-parallel"

Any display name with 2+ hyphens in the tag portion was broken. Single-hyphen tags (e.g., team-luna) worked by coincidence.

Fix

Replace split_once('-') with iteration over all hyphen positions via match_indices('-'). Each candidate split is checked against the DB until a matching (base_name, tag) pair is found.

Testing

  • cargo test — 1239 passed, 0 failed
  • Manual: hcom term vc-p0-p1-parallel-vani resolves correctly after fix

Also included

  • Skill patch: Added "No inject port" troubleshooting section to skills/hcom-agent-messaging/SKILL.md
  • Session ID resume (prior commits): hcom resume <uuid> and Codex thread name resolution

bloodcarter and others added 5 commits March 11, 2026 06:05
Allow `hcom r <session-id>` to find and resume sessions that were not
originally launched through hcom. Searches Claude, Codex, and Gemini
transcript files on disk, extracts the last working directory, and
launches with full hcom wrapping (PTY, hooks, message delivery).

Fork (`hcom f <session-id>`) gets this for free.

Active-instance guard prevents resuming a session that is already
running under another hcom instance.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When `hcom r <name>` is not a UUID and not a known hcom instance,
look up ~/.codex/session_index.jsonl for a matching thread_name
and resolve it to a session UUID. Picks the most recently updated
match when duplicates exist.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
split_once('-') only tried the first hyphen, failing for tags like
"vc-p0-p1-parallel-vani". Now iterates all split points so compound
tags resolve correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers multi-hyphen tag resolution, PTY wrapping requirement,
and base-name fallback for agents hitting this failure mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Agents were using term inject for task delegation instead of hcom send,
then listening for replies that never arrive. Added explicit guidance
on when to use each, with correct/incorrect examples.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner

@aannoo aannoo left a comment

Choose a reason for hiding this comment

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

Looks like pr mixes other unrelated commits not just the name thing

@bloodcarter
Copy link
Copy Markdown
Contributor Author

Closing to resubmit with only the fix commit — sorry for the noise.

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