Skip to content

fix(bux): free-Codex install symlink + self-healing config (ENG-4785)#266

Merged
LarsenCundric merged 1 commit into
mainfrom
larsen/eng-4785-install-symlink
May 26, 2026
Merged

fix(bux): free-Codex install symlink + self-healing config (ENG-4785)#266
LarsenCundric merged 1 commit into
mainfrom
larsen/eng-4785-install-symlink

Conversation

@LarsenCundric
Copy link
Copy Markdown
Contributor

@LarsenCundric LarsenCundric commented May 26, 2026

Two free-Codex bootstrap-correctness fixes found while debugging the staging dogfood.

1. install.sh symlink (fresh-box ttyd crash-loop)

bux-ttyd.service execs /usr/local/bin/bux-agent-shell (the agent launcher from #265), but only bootstrap.sh symlinked it. A fresh install.sh box starts bux-ttyd without running bootstrap, so the ExecStart target was missing → ttyd crash-looped. (The pr-reviewer flagged this on #265; the fix commit missed that merge due to a GitHub PR-head sync lag — re-landing here.) Symlink added in install.sh, before the ttyd start block.

2. Self-healing free-Codex config (the "profile not found" bug)

The old guard appended the browser-use-free blocks only when the provider header was absent, so a box with a partial/old config was never repaired:

  • missing [profiles.browser-use-free] table → Codex: "profile browser-use-free not found" (the TG error you saw)
  • stale wire_api = "chat" → Codex config load error

Now bootstrap strips every existing browser-use-free table (provider, .auth, profile) and re-appends fresh ones every run, so an outdated box self-heals on the next /update — no manual config deletion needed. Implemented as a python3 heredoc (run as the bux user) instead of awk-inside-bash -c to avoid a nested-quote minefield; CP_BASE passed via env. Preserves other tables ([features] goals) and the top-level profile selector.

Tested: stale chat config heals to a valid single-block responses config (tomllib-parsed); fresh-box and idempotent (run-twice) cases verified; bash -n clean.

Why this matters

Removes the manual "delete ~/.codex/config.toml before re-bootstrapping" retest step — the current staging box (with the stale wire_api="chat" block) will now self-repair on /update.

…oop ttyd (ENG-4785)

bux-ttyd.service execs /usr/local/bin/bux-agent-shell (ENG-4785), but only
bootstrap.sh symlinked it. A fresh `install.sh` box starts bux-ttyd without
ever running bootstrap, so the ExecStart target was missing and ttyd
crash-looped. (The pr-reviewer caught this on #265, but the fix commit didn't
make it into the merge due to a GitHub PR-head sync lag — re-landing it.)

Symlink placed before the ttyd (re)start block so it exists when the service
first starts.
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@LarsenCundric LarsenCundric merged commit f1eb1e4 into main May 26, 2026
7 checks passed
@LarsenCundric LarsenCundric changed the title fix(install): symlink bux-agent-shell so fresh installs don't crash-loop ttyd (ENG-4785) fix(bux): free-Codex install symlink + self-healing config (ENG-4785) May 26, 2026
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