fix(byte): drop trailing && from authExport (kills byte when token set)#80
fix(byte): drop trailing && from authExport (kills byte when token set)#80dcetlin wants to merge 1 commit into
Conversation
210dcab to
e14144d
Compare
startByte builds `authExport` as an element of the `inner` array that is
later `.join(' && ')`-ed. Both assignments appended their own trailing
`&&`, so the joined command emitted `... && export ...="$(cat ...)" && &&
caffeinate ...`. The `&& &&` is a shell syntax error and the byte tmux
session dies almost immediately.
It only fires when CLAUDE_CODE_OAUTH_TOKEN is set (or the slack angellist
token path), which is why token-less deployments never hit it.
Fix: remove the trailing `&&` from both assignments; the array join
supplies the separator.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e14144d to
6726f60
Compare
sf8193
left a comment
There was a problem hiding this comment.
Reviewed with dual-agent process (sp-reviewer + typescript-reviewer).
No blockers or should-fixes. The fix is correct — the old trailing && produced a double connector (&& &&) when interpolated into the inner array that's already joined with .join(' && ') on line 75. Removing it makes the shell command well-formed.
Verified: empty authExport path ('' || null → filtered by .filter(Boolean)) is unaffected. No regressions.
| if (oauthToken) { | ||
| writeFileSync(tokenFile, oauthToken, { mode: 0o600 }) | ||
| authExport = `export CLAUDE_CODE_OAUTH_TOKEN="$(cat ${shq(tokenFile)})" &&` | ||
| authExport = `export CLAUDE_CODE_OAUTH_TOKEN="$(cat ${shq(tokenFile)})"` |
There was a problem hiding this comment.
Nit (flagged by typescript-reviewer): The two authExport branches (lines 59 and 63) are identical except for the file path. Could extract a helper like const makeAuthExport = (p: string) => \export CLAUDE_CODE_OAUTH_TOKEN="$(cat ${shq(p)})"`` to reduce duplication. Purely stylistic — not blocking.
Problem
startBytebuildsauthExportas an element of theinnerarray that is later.join(' && ')-ed:Both
authExportassignments appended their own trailing&&, so the joined command emitted:The
&& &&is a shell syntax error — the byte tmux session dies almost immediately.It only fires when
CLAUDE_CODE_OAUTH_TOKENis set (or the slack angellist-token path), which is why token-less deployments never hit it. Surfaced during an external-machine bring-up.Fix
Remove the trailing
&&from both assignments; the arrayjoin(' && ')already supplies the separator.Verification
bun build cli/hydra.tscompiles.&& &&.🤖 Generated with Claude Code