Skip to content

th-e651bc: auto-onboard every Claude session to th-mail + agentic self-rename#242

Merged
brentrager merged 1 commit into
mainfrom
th-e651bc-agent-onboard
Jul 22, 2026
Merged

th-e651bc: auto-onboard every Claude session to th-mail + agentic self-rename#242
brentrager merged 1 commit into
mainfrom
th-e651bc-agent-onboard

Conversation

@brentrager

Copy link
Copy Markdown
Contributor

Problem

Only th claude run workers registered on the th-mail agent bus. A plain claude launch was invisible and unreachable by Big Smooth / other agents.

Solution

Every session onboards at startup, then renames itself once it knows its task.

  • th agent rename --from <old> --to <new> (AgentRegistry::rename + CLI) — moves the roster row and re-addresses the agent's inbox/sent mail, so a placeholder handle can be promoted without losing history. Refuses to merge into an existing handle. 5 new tests.
  • register-agent.sh → register-always — workers keep their meaningful SMOOTH_AGENT_HANDLE; a plain session gets a placeholder cc-<repo>-<sid4> persisted to ~/.smooth/agent-sessions/<session_id>.
  • Detached registration — the th agent register Dolt write cold-boots Dolt (~0.7s). Backgrounded (( … & )) so it adds ~0ms to session start (measured 0.68s → 0.04s).
  • on-first-prompt.sh (new UserPromptSubmit hook) — fires once to nudge the session to th agent rename itself to a task-meaningful handle.
  • No auto th msg watch — Dolt is single-writer; many always-on watchers cause "database is read only". Push-watching stays opt-in via /th-mail.

Verification

  • cargo test -p smooai-smooth-pearls — 171 pass (5 new rename tests: mail-carry, collision-refuse, unknown-source, empty-target, noop-when-same).
  • th agent rename compiles; fmt + clippy clean (no new warnings).
  • Hooks hand-tested: auto path derives cc-<repo>-<sid4>, worker path preserved, first-prompt nudge fires exactly once, backgrounded register measured at 0.04s.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c1728c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@smooai/smooth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@brentrager
brentrager enabled auto-merge (squash) July 22, 2026 16:52
…f-rename

Previously only `th claude run` workers registered on the th-mail agent bus;
a plain `claude` launch was invisible and unreachable. Now every session
onboards at startup and can rename itself once it knows what it's doing.

- `th agent rename --from <old> --to <new>` (smooth-pearls AgentRegistry::rename
  + CLI): moves the roster row AND re-addresses the agent's inbox/sent mail, so
  a placeholder handle can be promoted without losing history. Refuses to merge
  into an existing handle. 5 new tests.
- register-agent.sh: register-always. Workers keep their meaningful
  SMOOTH_AGENT_HANDLE; a plain session gets a placeholder `cc-<repo>-<sid4>`,
  persisted to ~/.smooth/agent-sessions/<session_id>. The `th agent register`
  Dolt write (~0.7s cold-boot) is detached (`( … & )`) so it adds ~0ms to
  session start — measured 0.68s → 0.04s.
- on-first-prompt.sh (new UserPromptSubmit hook): fires once to nudge the
  session to `th agent rename` itself to a task-meaningful handle.
- No background `th msg watch` is auto-started — Dolt is single-writer, many
  watchers cause "database is read only". Push-watching stays opt-in via
  /th-mail.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ZctFb4oiWoJraHN2db1nX
@brentrager
brentrager force-pushed the th-e651bc-agent-onboard branch from 5b33fed to c1728c0 Compare July 22, 2026 16:57
@brentrager
brentrager merged commit c6a6377 into main Jul 22, 2026
3 checks passed
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