Repository navigation
fix(naming): Name with AI uses the node's Claude account; never titles a node with a CLI error - #1069
Merged
Merged
Conversation
…r adopt CLI errors as titles The naming agent spawned `claude -p` with the app's plain env, so every request went out as the system ~/.claude login regardless of the node's managed account. When that login was expired, claude printed "Failed to authenticate: OAuth …" to STDOUT with a nonzero exit, and runAgent treated any stdout text as the answer — so the node was renamed to the error. - generateName takes a trailing optional accountId (node header ✦, sessions sidebar, kanban card modal). Main resolves it like the pty spawn (known, non-pending, local account with an existing dir) and runs the agent with CLAUDE_CONFIG_DIR set and AUTH_ENV_STRIP removed; otherwise the system account, as before. - runAgent: a nonzero exit is always a failure, and known CLI error lines (Failed to authenticate, Invalid API key, API Error, …) are never accepted as output. Applies to commit messages and group names too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
eneskirca
enabled auto-merge
September 30, 2026 13:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
✦ Name with AI sometimes renamed a node to
Failed to authenticate: OAuth s….Two causes:
claude -pwith the app's plain env, so it always ran as the system~/.claudelogin, whatever managed account the node runs under. If that login was expired or logged out, the request failed even though the node's own account was fine.claude -pprints auth errors to stdout and exits nonzero.runAgentaccepted any stdout text as the answer, so the error became the title.Fix
pty.generateName(persistKey, cwd, accountId?)takes a trailing optionalaccountId. It is passed from the node header ✦, the sessions sidebar "Name with AI" and the kanban card modal.claudeAccounts, not pending, not remote, and its dir must exist. The agent then runs withCLAUDE_CONFIG_DIRpointed at that dir andAUTH_ENV_STRIPremoved (newclaudeAccountEnvhelper). If the account doesn't resolve, the request uses the system account, as before.runAgentnow fails on any nonzero exit. It also rejects known CLI error lines (isCliErrorOutput) even on a zero exit. This applies to AI commit messages and group names too.Surfaces
Not in scope
Testing
npm run typecheckpasses.commit-message.test.tshas new tests forisCliErrorOutputandclaudeAccountEnv.🤖 Generated with Claude Code