Skip to content

fix(homeboy): single-source homeboy_project_id and resolve real registered id#171

Merged
chubes4 merged 1 commit into
mainfrom
fix-170-dedupe-homeboy-project-id
May 30, 2026
Merged

fix(homeboy): single-source homeboy_project_id and resolve real registered id#171
chubes4 merged 1 commit into
mainfrom
fix-170-dedupe-homeboy-project-id

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented May 30, 2026

Summary

  • Removes the duplicate homeboy_project_id() (it lived in both lib/data-machine.sh and lib/homeboy.sh; the latter won by source order, silently shadowing the fix(homeboy): report attach-path results truthfully and resolve project id consistently #169 fix).
  • The surviving definition in lib/homeboy.sh now resolves in priority: $HOMEBOY_PROJECT_ID → site-root homeboy.jsondomain match against homeboy project list (the real registered id). $AGENT_SLUG and homeboy_slugify remain only as last-ditch setup-time fallbacks for not-yet-registered projects.

Why

The winning homeboy.sh copy's fallback ran homeboy_slugify on the site domain, turning extrachill.com into extrachill — not a registered project (the real one is extrachill-site). Homeboy returned {"success": false, "code": "project.not_found"}.

Latent until #169 made the attach loop parse .success instead of trusting the exit code: the now-truthful failure tripped upgrade.sh's set -e and aborted the upgrade at exit 4, right after "Attaching Homeboy components".

xtrace proof:

++ homeboy_slugify extrachill.com
+ project_id=extrachill
++ homeboy project components attach-path extrachill /var/lib/.../agents-api
+ attach_output='{ "success": false, "error": { "code": "project.not_found", "details": { "id": "extrachill" } } }'

Verification

End-to-end on a Homeboy-enabled install:

  • Resolves extrachill-site; attach loop completes 45 attached, 0 failed (exit 0) instead of aborting at exit 4.
  • Setup-time unregistered domain (brandnew-site.com) still slugifies to brandnew-site, preserving create-project behavior.
  • Only one homeboy_project_id() definition remains (grep -rn 'homeboy_project_id()' lib/).

Fixes #170

…tered id

homeboy_project_id() was defined twice — in lib/data-machine.sh and
lib/homeboy.sh. upgrade.sh sources data-machine before homeboy, so the
homeboy.sh copy won and the data-machine.sh copy (fixed in #169) was dead
code. The winning copy's final fallback ran homeboy_slugify on the site
domain, turning 'extrachill.com' into 'extrachill' — which is not a
registered Homeboy project (the real id is 'extrachill-site'). Homeboy
returned {"success": false, "code": "project.not_found"}.

This was latent until #169 made the attach loop parse the JSON .success
field instead of trusting the exit code: the now-truthful failure tripped
upgrade.sh's 'set -e' and aborted the upgrade at exit 4, right after
'Attaching Homeboy components'.

Consolidate to a single definition in lib/homeboy.sh (the one that wins by
source order) that resolves in priority: $HOMEBOY_PROJECT_ID, site-root
homeboy.json, then a domain match against 'homeboy project list' (the real
registered id). $AGENT_SLUG and homeboy_slugify remain only as last-ditch
setup-time fallbacks for projects not yet registered — they must never win
over a real lookup. Remove the shadowed duplicate from data-machine.sh.

Verified end-to-end on a Homeboy-enabled install: resolves 'extrachill-site'
and the attach loop completes '45 attached, 0 failed' (exit 0) instead of
aborting at exit 4. Setup-time unregistered domains still slugify as before.

Fixes #170
@chubes4 chubes4 merged commit 6da51a6 into main May 30, 2026
4 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.

Duplicate homeboy_project_id() — lib/homeboy.sh slugifies domain to a non-existent project id (extrachill.com -> 'extrachill', not 'extrachill-site')

1 participant