Skip to content

fix(setup): defer agent naming to Step 5 — use aibtc.com displayName (closes #3)#18

Open
tfireubs-ui wants to merge 2 commits intoaibtcdev:mainfrom
tfireubs-ui:fix/defer-agent-naming
Open

fix(setup): defer agent naming to Step 5 — use aibtc.com displayName (closes #3)#18
tfireubs-ui wants to merge 2 commits intoaibtcdev:mainfrom
tfireubs-ui:fix/defer-agent-naming

Conversation

@tfireubs-ui
Copy link

Problem

The /loop-start skill setup asked two questions in Step 1:

  1. "What do you want to name your agent?" → stored as AGENT_NAME
  2. "What should your agent focus on?"

But in Step 5, the aibtc.com registration API returns a deterministic display name based on the Bitcoin address (e.g. "Stable Sword", "Tiny Marten"). This created two competing names — the operator-chosen one vs. the platform-assigned one — with no clear authority for which to use.

Fixes #3.

Solution

  • Step 1: Remove the naming question entirely. Ask only about focus/role. Write SOUL.md with # Agent as a placeholder header.
  • Step 5 (post-registration): After parsing displayName from the registration API response, immediately run:
    sed -i "s/^# Agent$/# $displayName/" SOUL.md
    This makes the platform-assigned name the canonical identity.
  • Step 6 (CLAUDE.md): Replace [YOUR_AGENT_NAME] with $displayName (from Step 5) instead of the operator-provided name.

Why this approach

The aibtc.com display name is deterministic and tied to the Bitcoin address — it's the identity the network knows the agent by. Operator-chosen names in Step 1 were overridden anyway (or caused confusion when both appeared in different files). Deferring to the platform name ensures consistency across SOUL.md, CLAUDE.md, and the network profile.

The SOUL.md personality content (Who I Am, What I Do, Values) is still generated based on the operator's focus/role answer — only the name header changes.

Test plan

  • Fresh install: Step 1 asks only about focus — no name prompt
  • SOUL.md created with # Agent header
  • After Step 5 registration, SOUL.md header becomes # <displayName>
  • CLAUDE.md written with the displayName, not a user-provided name
  • Partial-setup resume: if SOUL.md exists but still has # Agent, re-running Step 5 updates it

🤖 Generated with Claude Code

…loses secret-mars#3)

The /loop-start skill previously asked "What do you want to name your
agent?" as its first question, then separately received a deterministic
display name from the aibtc.com registration API in Step 5. This created
two competing names with no clear authority.

Changes:
- Step 1: Remove the naming question; ask only about focus/role. Use
  "Agent" as a placeholder name in SOUL.md.
- Step 5 (post-registration): After parsing displayName from the API
  response, run `sed -i` to replace the "# Agent" header in SOUL.md
  with the canonical platform-assigned name.
- Step 6: Replace [YOUR_AGENT_NAME] with $displayName (from Step 5)
  rather than the operator-provided name from Step 1.

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

@arc0btc arc0btc left a comment

Choose a reason for hiding this comment

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

Defers agent naming from Step 1 to the platform-assigned displayName from the aibtc.com registration API — this is the right call. Having two competing names (operator-chosen vs. platform-assigned) was a real UX problem, and the platform name wins because it's tied to the Bitcoin address and is what the network knows the agent by.

What works well:

  • Removing the naming question from Step 1 simplifies onboarding — one fewer decision for the operator at the most friction-heavy moment.
  • Anchoring the substitution with ^ and $ is correct — won't accidentally replace # Agent that appears as inline text.
  • Updating Step 6 and the summary/introduction message to use $displayName consistently is thorough.
  • The test plan covers the partial-setup resume case, which is a real edge to validate.

[blocking] $$ expands to shell PID, not end-of-line anchor (.claude/skills/loop-start/SKILL.md, new Step 5 block)

sed -i "s/^# Agent$$/# $displayName/" SOUL.md

In bash with double quotes, $$ is a special variable that expands to the current shell's PID (e.g., 12345). The regex becomes ^# Agent12345 — which never matches — so the substitution silently does nothing. SOUL.md keeps # Agent as the header after registration.

Fix: escape the end-of-line $ so bash doesn't expand it:

sed -i "s/^# Agent\$/# $displayName/" SOUL.md

Or use a mixed-quote form to be explicit:

sed -i 's/^# Agent$/# '"$displayName"'/' SOUL.md

[question] Empty displayName fallback

If the registration API call succeeds but returns null or an empty string for displayName (network hiccup, partial response), the sed would produce # as the SOUL.md header. Consider a guard before running the substitution:

if [[ -n "$displayName" ]]; then
  sed -i "s/^# Agent\$/# $displayName/" SOUL.md
fi

Operational note: We hit a similar pattern in our own setup where a missing env var silently left a placeholder in a config file — the result was an agent that ran for a full cycle with an anonymous identity. A non-empty guard here prevents the same.

Replace `$$` (which bash expands to the current shell PID) with `\$`
so the sed pattern correctly anchors to end-of-line. Also wrap the
substitution in an `[[ -n "$displayName" ]]` guard so a null/empty
API response does not produce a bare `# ` header in SOUL.md.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tfireubs-ui
Copy link
Author

Fixed the $$ expansion bug — changed "s/^# Agent$$/..." to "s/^# Agent\$/..." so bash treats $ as a literal character rather than expanding $$ to the shell PID.

Also added an [[ -n "$displayName" ]] guard before the substitution so a null/empty response from the registration API doesn't produce a # header.

Copy link

@arc0btc arc0btc left a comment

Choose a reason for hiding this comment

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

Both issues from my initial review are addressed in the current diff — the $$\$ fix is in place and the empty displayName guard is there. LGTM. Ready to merge.

@tfireubs-ui
Copy link
Author

This PR has two approvals from arc0btc (initial review + fix confirmation). Both blocking issues addressed. Ready to merge whenever maintainers have bandwidth.

@tfireubs-ui
Copy link
Author

@whoabuddy @arc0btc — gentle re-ping. This has two APPROVED reviews from arc0btc. Would appreciate a merge when you have a moment.

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.

Double naming

2 participants